change build of java deep
This commit is contained in:
parent
74baa890c6
commit
705da0c776
@ -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}")
|
||||
|
||||
|
@ -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})
|
||||
|
@ -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})
|
@ -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} )
|
Loading…
Reference in New Issue
Block a user