diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-01-10 17:27:41 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-01-10 17:27:41 (GMT) |
commit | e994a90cdf664113b443aa93a83b8bed0159d2f3 (patch) | |
tree | c22fa3642fea7126c93186928559b9a65c0c8846 /config/cmake_ext_mod/HDFMacros.cmake | |
parent | 7bd06dccb543a35763a967e3f84f3c8d89f0c538 (diff) | |
download | hdf5-e994a90cdf664113b443aa93a83b8bed0159d2f3.zip hdf5-e994a90cdf664113b443aa93a83b8bed0159d2f3.tar.gz hdf5-e994a90cdf664113b443aa93a83b8bed0159d2f3.tar.bz2 |
HDFFV-10385 fix CMAKE_BUILD_TYPE usage
Diffstat (limited to 'config/cmake_ext_mod/HDFMacros.cmake')
-rw-r--r-- | config/cmake_ext_mod/HDFMacros.cmake | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 192a5c8..4c2aeb9 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -9,6 +9,23 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # + +#------------------------------------------------------------------------------- +macro (SET_HDF5_BUILD_TYPE) + if(CMAKE_CONFIGURATION_TYPES) + set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR}) + set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) + else() + if(CMAKE_BUILD_TYPE) + set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + set(HDF5_CFG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) + else() + set(HDF5_BUILD_TYPE "Release") + set(HDF5_CFG_BUILD_TYPE "Release") + endif() + endif() +endmacro () + #------------------------------------------------------------------------------- macro (SET_GLOBAL_VARIABLE name value) set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) @@ -145,7 +162,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${HDF5_BUILD_TYPE} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -160,8 +177,8 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) ) else () set_target_properties (${libtarget} PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) endif () else () @@ -181,7 +198,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) else () if (WIN32 AND NOT MINGW) set_target_properties (${libtarget} PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) else () |