diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 7b7fcb6f0da934cc2ae0ec5905b285c6f4713b72..f8b0b5c2181d0578845c8859d86445a3f45ea4b7 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -3,19 +3,21 @@ project (IMMCOMPLX_JAVA_MAIN Java) set(CMAKE_JAVA_TARGET_OUTPUT_NAME immutablecomplex-${IMMCOMPLX_VERSION}) -# Compiling the source files into a jar with a main +# Compile the source files into a jar with a main add_jar(immutablecomplex java/Complex.java java/Main.java ENTRY_POINT main.java.Main VERSION ${IMMCOMPLX_VERSION}) +# Get the jar location get_target_property(JAR immutablecomplex JAR_FILE) +# Set it to parent scope set(IMMCOMPLX_JAR ${JAR} PARENT_SCOPE) -# Installing the jar +# Install the jar message(STATUS "JAR_INSTALL_DIR = ${JAR_INSTALL_DIR}") install_jar(immutablecomplex ${JAR_INSTALL_DIR}) -# Creating the javadoc +# Create the javadoc create_javadoc(immutablecomplex_doc FILES java/Complex.java CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index d4d3e59311ed7d7d39604c45fe9ef8fda536ad87..def66d5b6a14c7a494a87310ff8e11d99dacfbac 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -4,9 +4,9 @@ project (IMMCOMPLX_JAVA_TEST Java) set(JUNIT_JAR ${IMMCOMPLX_JAVA_DEPENDENCIES_DIR}/junit-${JUNIT_VERSION}.jar) set(HAMCREST_JAR ${IMMCOMPLX_JAVA_DEPENDENCIES_DIR}/hamcrest-all-${HAMCREST_VERSION}.jar) -# Compiling of the test file +# Compile of the test file add_jar(immutablecomplex-test java/ComplexTest.java INCLUDE_JARS ${JUNIT_JAR} ${IMMCOMPLX_JAR}) -# Getting the jar's name +# Get the jar location get_target_property(IMMCOMPLX_TEST_JAR immutablecomplex-test JAR_FILE) # Adding test case for ctest