From 705da0c7765241d82e4c0adc2f68d4f678be7405 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Thu, 18 Feb 2010 07:48:32 +0100 Subject: [PATCH] change build of java deep --- CASA/CMakeLists.txt | 2 +- CASA/jwrapper/CMakeLists.txt | 76 ++++++++++++++++++++++++++--- CASA/jwrapper/jnsscs/CMakeLists.txt | 54 -------------------- CASA/jwrapper/src/CMakeLists.txt | 69 -------------------------- 4 files changed, 70 insertions(+), 131 deletions(-) delete mode 100644 CASA/jwrapper/jnsscs/CMakeLists.txt delete mode 100644 CASA/jwrapper/src/CMakeLists.txt diff --git a/CASA/CMakeLists.txt b/CASA/CMakeLists.txt index bffd6fb2..8edd5da0 100644 --- a/CASA/CMakeLists.txt +++ b/CASA/CMakeLists.txt @@ -10,7 +10,7 @@ SET (VERSION_MINOR "8") SET (VERSION_PATCH "0") SET (VERSION_SUB "0") SET (VERSION_DEVEL "0") -SET (VERSION_SUFFIX "-pre2") +SET (VERSION_SUFFIX "-pre3") SET (VERSION_PATCH "${VERSION_PATCH}${VERSION_SUFFIX}") diff --git a/CASA/jwrapper/CMakeLists.txt b/CASA/jwrapper/CMakeLists.txt index d44e8e8f..35d3d6f2 100644 --- a/CASA/jwrapper/CMakeLists.txt +++ b/CASA/jwrapper/CMakeLists.txt @@ -2,28 +2,90 @@ # Project ############## -project(jwrapper) +PROJECT(jwrapper Java) -add_subdirectory(src) -add_subdirectory(jnsscs) - -################################# -# Dependencies -############## +# CMake configuration: +CMAKE_MINIMUM_REQUIRED(VERSION 2.6 ) +SET (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) ################################# # Compiler Switches ############## +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${JNI_INCLUDE_DIRS} +) + +link_directories( + ${CMAKE_BINARY_DIR}/micasadk +) + + INCLUDE_DIRECTORIES( + ${JAVA_INCLUDE_PATH} + ${JAVA_INCLUDE_PATH2} + ) + +################################# +# Dependencies +############## + +# CASAJAVA JAVA parts + SET(VERSION 1.1) + SET(PKG miCASA) + SET(JAR_FILE ${PKG}.jar) + + FILE(GLOB JAVA_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/com/novell/casa/*.java) + + ADD_CUSTOM_TARGET(CASAJAVA_CLASSES + COMMAND ${JAVA_COMPILE} -sourcepath ${CMAKE_CURRENT_SOURCE_DIR}/src -d ${CMAKE_CURRENT_BINARY_DIR} ${JAVA_FILES} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Creating miCASA classes" + VERBATIM + ) + +# FILE(GLOB JAVA_COMPILED_FILES ${CMAKE_CURRENT_BINARY_DIR}/com/novell/casa/*.class) + + ADD_CUSTOM_TARGET(CASAJAVA_JAR + COMMAND ${JAVA_ARCHIVE} -cvf ${JAR_FILE} -C ${CMAKE_CURRENT_BINARY_DIR} com/novell/casa/ + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Creating miCASA.jar" + VERBATIM + ) + ADD_DEPENDENCIES(CASAJAVA_JAR CASAJAVA_CLASSES) + + ADD_CUSTOM_TARGET(CASAJAVA_H + COMMAND ${JAVA_HEADER_COMPILE} -o ${CMAKE_CURRENT_BINARY_DIR}/com_novell_casa_MiCasa.h -classpath ${CMAKE_CURRENT_BINARY_DIR} com.novell.casa.MiCasa + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Creating com_novell_casa_MiCasa.h" + VERBATIM + ) + ADD_DEPENDENCIES(CASAJAVA_H CASAJAVA_JAR) + + ################################# # Source Files ############## +# CASAJAVA module + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + + SET (CASAJAVA_SRC jnsscs/jmicasa.c ) + + add_library(jmicasa SHARED "${CASAJAVA_SRC}") + ADD_DEPENDENCIES(jmicasa CASAJAVA_H) + set_target_properties(jmicasa PROPERTIES VERSION 1.1.1 SOVERSION 1 LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/jnsscs/jmicasa_lux.exp) + ################################# # Linking ############## + target_link_libraries(jmicasa micasa) + ################################# # Install Files ############## +install(TARGETS jmicasa DESTINATION ${LIB_INSTALL_DIR}) diff --git a/CASA/jwrapper/jnsscs/CMakeLists.txt b/CASA/jwrapper/jnsscs/CMakeLists.txt deleted file mode 100644 index c3d1aac9..00000000 --- a/CASA/jwrapper/jnsscs/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -################################# -# Project -############## - -project(jmicasa) - -################################# -# Dependencies -############## - -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/com_novell_casa_MiCasa.h - COMMAND "${JAVA_HEADER_COMPILE}" -jni -d ${CMAKE_CURRENT_BINARY_DIR} - com.novell.casa.MiCasa - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/jwrapper/src/class - COMMENT "generating jni header file ${CMAKE_CURRENT_BINARY_DIR}/com_novell_casa_MiCasa.h" -) - - -################################# -# Compiler Switches -############## - -INCLUDE_DIRECTORIES( - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${JNI_INCLUDE_DIRS} -) - -link_directories( - ${CMAKE_BINARY_DIR}/micasadk -) - - -# add_definitions( -DSSCS_LINUX_PLAT_F -DN_PLAT_UNIX -DUNIX -DLINUX -DIAPX38 ) - -################################# -# Source Files -############## - -add_library(jmicasa SHARED jmicasa.c ${CMAKE_CURRENT_BINARY_DIR}/com_novell_casa_MiCasa.h) - -################################# -# Linking -############## - -set_target_properties(jmicasa PROPERTIES VERSION 1.1.1 SOVERSION 1 LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/jmicasa_lux.exp) -target_link_libraries(jmicasa micasa) - -################################# -# Install Files -############## - -install(TARGETS jmicasa DESTINATION ${LIB_INSTALL_DIR}) diff --git a/CASA/jwrapper/src/CMakeLists.txt b/CASA/jwrapper/src/CMakeLists.txt deleted file mode 100644 index c86519fd..00000000 --- a/CASA/jwrapper/src/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -################################# -# Project -############## - -project(miCASA4java Java) - -SET(CMAKE_VERBOSE_MAKEFILE 1) - -################################# -# Dependencies -############## - -SET (CLASS_DIR "class") -SET (JAR_DIR "jar") -FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_DIR}) -FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${JAR_DIR}) - -################################# -# Compiler Switches -############## - -INCLUDE_DIRECTORIES( - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} -) - -#add_definitions( -DSSCS_LINUX_PLAT_F -DN_PLAT_UNIX -DUNIX -DLINUX -DIAPX38 ) - -################################# -# Source Files -############## - -SET (JAR_FILE miCASA.jar) -SET (JAVA_FILES MiCasaException MiCasa MiCasaTest NetCredential) - -################################# -# Linking -############## - -# compile all .java files with javac to .class -ADD_CUSTOM_COMMAND( -OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${JAVA_FILES}.class -COMMAND ${CMAKE_Java_COMPILER} -ARGS -d ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_DIR} -${CMAKE_CURRENT_SOURCE_DIR}/com/novell/casa/*.java -) - -# build .jar file from .class files -ADD_CUSTOM_COMMAND( -OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${JAR_FILE} -DEPENDS -${CMAKE_CURRENT_BINARY_DIR}/${JAVA_FILES}.class -COMMAND ${CMAKE_COMMAND} -ARGS -E chdir ${CMAKE_CURRENT_BINARY_DIR} -${CMAKE_Java_ARCHIVE} -cfv ${JAR_DIR}/${JAR_FILE} -C ${CLASS_DIR} com/novell/casa/ -) - -################################# -# Install Files -############## - -# the target -ADD_CUSTOM_TARGET( -${JAR_FILE} -ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${JAR_FILE}) - -# GLOBAL_ADD_ITEM( ${JAR_FILE} ) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${JAR_DIR}/${JAR_FILE} DESTINATION ${LIB_INSTALL_DIR} ) \ No newline at end of file