1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
cmake_minimum_required (VERSION 2.8.10)
PROJECT (HDFJAVA_JNI_HDF5LIB C)
set (HDFJAVA_JNI_HDF5_CSRCS
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/exceptionImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5aImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5Constants.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5dImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5eImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5fImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5gImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5iImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5Imp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5lImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5oImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5pImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5rImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5sImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5tImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5util.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5zImp.c
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/nativeData.c
)
set (HDFJAVA_JNI_HDF5_CHDRS
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5aImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5dImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5eImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5fImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5gImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5iImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5jni.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5lImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5oImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5rImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5sImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5tImp.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5util.h
${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR}/h5zImp.h
)
INCLUDE_DIRECTORIES( ${HDFJAVA_JNI_HDF5LIB_SOURCE_DIR} )
#-----------------------------------------------------------------------------
# Run all the CMake configuration tests for our build environment
#-----------------------------------------------------------------------------
include (${HDF_RESOURCES_DIR}/ConfigureChecks.cmake)
set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
########### JNI libraries always must be built shared ###############
add_library (${HDFJAVA_JNI_HDF5_LIB_TARGET} SHARED ${HDFJAVA_JNI_HDF5_CSRCS} ${HDFJAVA_JNI_HDF5_CHDRS})
TARGET_C_PROPERTIES (${HDFJAVA_JNI_HDF5_LIB_TARGET} " " " ")
TARGET_LINK_LIBRARIES (${HDFJAVA_JNI_HDF5_LIB_TARGET} ${HDF5_LINK_LIBS})
SET_GLOBAL_VARIABLE (HDFJAVA_LIBRARIES_TO_EXPORT "${HDFJAVA_LIBRARIES_TO_EXPORT};${HDFJAVA_JNI_HDF5_LIB_TARGET}")
HDFJAVA_SET_LIB_OPTIONS (${HDFJAVA_JNI_HDF5_LIB_TARGET} ${HDFJAVA_JNI_HDF5_LIB_NAME} SHARED)
if (WIN32)
get_filename_component (HDFJAVA_JNI_HDF5_DLL_NAME ${HDFJAVA_JNI_HDF5_LIB_TARGET} NAME_WE)
# message (STATUS "HDFJAVA_JNI_HDF5_DLL_NAME: ${HDFJAVA_JNI_HDF5_DLL_NAME}")
if (BUILD_TESTING)
add_custom_target (HDFJAVA_JNI_HDF5-Test-Copy ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${HDFJAVA_JNI_HDF5_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${HDFJAVA_JNI_HDF5_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
COMMENT "Copying ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${HDFJAVA_JNI_HDF5_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
)
add_dependencies (HDFJAVA_JNI_HDF5-Test-Copy ${HDFJAVA_JNI_HDF5_LIB_TARGET})
endif (BUILD_TESTING)
endif (WIN32)
#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------
if (HDFJAVA_EXPORTED_TARGETS)
install (
TARGETS
${HDFJAVA_JNI_HDF5_LIB_TARGET}
EXPORT
${HDFJAVA_EXPORTED_TARGETS}
LIBRARY DESTINATION ${HJAVA_INSTALL_LIB_DIR} COMPONENT libraries
ARCHIVE DESTINATION ${HJAVA_INSTALL_LIB_DIR} COMPONENT libraries
RUNTIME DESTINATION ${HJAVA_INSTALL_LIB_DIR} COMPONENT libraries
)
endif (HDFJAVA_EXPORTED_TARGETS)
|