crafting-interpreters/1/HelloWorldJava/CMakeLists.txt

21 lines
499 B
Text
Raw Permalink Normal View History

2020-10-13 05:46:11 +02:00
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)