diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2018-05-14 16:20:03 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2018-05-14 16:20:03 (GMT) |
commit | ea66ac1e67bf2e5ccc59f30e6b648bb39c8f5e42 (patch) | |
tree | e71e1c6ffd6b6b4126ed232402beb5a80e5335d9 /tools/lib | |
parent | e6bc326ec0c417ef7b003da535b2e071442d2067 (diff) | |
parent | dcc66a4f157ace0858b788228550f3e104df3242 (diff) | |
download | hdf5-ea66ac1e67bf2e5ccc59f30e6b648bb39c8f5e42.zip hdf5-ea66ac1e67bf2e5ccc59f30e6b648bb39c8f5e42.tar.gz hdf5-ea66ac1e67bf2e5ccc59f30e6b648bb39c8f5e42.tar.bz2 |
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit 'dcc66a4f157ace0858b788228550f3e104df3242': (35 commits)
GGC requires attribute before function
Correct COMPILE defs usage
Add missing module_dir property
Text cleanup
Correct sentence punctuation.
Add release note.
Use set_property for MT flag
Correct command usage
Remove APPEND
Fix typo
Add missing test lib
add missing folder to path
Fix another command revert
Missed a command revert
Revert to old style for LINK_FLAGS gen expr not working
LINK_FLAGS must be separate property sets
Fix link flags syntax
Revert refactor link flags
refactor link flags to interface
Refactor link flags
...
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/CMakeLists.txt | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 090c8a4..32166bc 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -2,11 +2,6 @@ cmake_minimum_required (VERSION 3.10) project (HDF5_TOOLS_LIB C) #----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) - -#----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- @@ -38,40 +33,39 @@ set (H5_TOOLS_LIB_HDRS ) add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) -target_include_directories(${HDF5_TOOLS_LIB_TARGET} INTERFACE "${HDF5_TOOLS_LIB_SOURCE_DIR}") -set_property(TARGET ${HDF5_TOOLS_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") -TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) -if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) - target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES}) -endif () +target_include_directories(${HDF5_TOOLS_LIB_TARGET} + PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" +) +#target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG>) +TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC) +target_link_libraries (${HDF5_TOOLS_LIB_TARGET} + PUBLIC ${HDF5_LIB_TARGET} + PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}> +) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC 0) -set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES - FOLDER libraries/tools - INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" -) -#set_property (TARGET ${HDF5_TOOLS_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG) +set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) set (install_targets ${HDF5_TOOLS_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) - target_include_directories(${HDF5_TOOLS_LIBSH_TARGET} INTERFACE "${HDF5_TOOLS_LIB_SOURCE_DIR}") - set_property(TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") - TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) - if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) - target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) - endif () + target_include_directories(${HDF5_TOOLS_LIBSH_TARGET} + PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + ) + target_compile_definitions(${HDF5_TOOLS_LIBSH_TARGET} + PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" + #PRIVATE H5DIFF_DEBUG + ) + TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED) + target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} + PUBLIC ${HDF5_LIBSH_TARGET} + PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}> + ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED "TOOLS") - set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES - FOLDER libraries/tools - COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" - INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" - INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 - ) - #set_property (TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG) + set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES FOLDER libraries/tools) set (install_targets ${install_targets} ${HDF5_TOOLS_LIBSH_TARGET}) endif () |