diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-04-26 21:41:04 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-04-26 21:41:04 (GMT) |
commit | 2347bffaa2d48b62a22575fbc93b1f5c2716d8d4 (patch) | |
tree | 963395e7cd4bd66761194c8cee840906b16abb3a /hl/src | |
parent | bc9a773b994cde788e97e5e998eb5fcd21ec8a39 (diff) | |
download | hdf5-2347bffaa2d48b62a22575fbc93b1f5c2716d8d4.zip hdf5-2347bffaa2d48b62a22575fbc93b1f5c2716d8d4.tar.gz hdf5-2347bffaa2d48b62a22575fbc93b1f5c2716d8d4.tar.bz2 |
TRILABS-19 remove add_defintions and use generator expressions
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/CMakeLists.txt | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index bec40ec..aa33e59 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -30,29 +30,30 @@ set (HL_HEADERS ) add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS}) -set_property(TARGET ${HDF5_HL_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") -TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") +target_include_directories(${HDF5_HL_LIB_TARGET} + PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" +) +TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC) target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0) -set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES - FOLDER libraries/hl - INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" -) +set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") set (install_targets ${HDF5_HL_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS}) - set_property(TARGET ${HDF5_HL_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") - TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED " " " ") + target_include_directories(${HDF5_HL_LIBSH_TARGET} + PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + ) + target_compile_definitions(${HDF5_HL_LIBSH_TARGET} + PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" + ) + TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED "HL") - set_target_properties (${HDF5_HL_LIBSH_TARGET} PROPERTIES - FOLDER libraries/hl - 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_target_properties (${HDF5_HL_LIBSH_TARGET} PROPERTIES FOLDER libraries/hl) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIBSH_TARGET}") set (install_targets ${install_targets} ${HDF5_HL_LIBSH_TARGET}) endif () |