crafting-interpreters/1/HelloWorldJava/CMakeLists.txt
2020-10-12 20:46:11 -07:00

20 lines
499 B
CMake

cmake_minimum_required(VERSION 2.8)
find_package(Java REQUIRED)
include(UseJava)
enable_testing()
project(HelloWorldJava NONE)
add_jar(HelloWorldJava HelloWorld/HelloWorldJava.java)
get_target_property(_jarFile HelloWorldJava JAR_FILE)
get_target_property(_classDir HelloWorldJava CLASSDIR)
message(STATUS "Jar file ${_jarFile}")
message(STATUS "Class compiled to ${_classDir}")
add_test(
NAME TestHelloWorldJava
COMMAND ${Java_JAVA_EXECUTABLE} -cp ${_jarFile} HelloWorld/HelloWorldJava)