diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 66 |
1 files changed, 43 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 60f48a5..0401f9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -643,41 +643,61 @@ IF (HDF5_PACKAGE_EXTLIBS) ADD_DEPENDENCIES (SZIP-Library-Copy SZIP) ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - GET_FILENAME_COMPONENT(ZLIB_DLL_NAME ${ZLIB_LIBRARY} NAME_WE) - # MESSAGE (STATUS "ZLIB_DLL_NAME: ${ZLIB_DLL_NAME}") - GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH) - # MESSAGE (STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}") - ADD_CUSTOM_TARGET (ZLIB-Release-Copy ALL +ENDIF (HDF5_PACKAGE_EXTLIBS) + +IF (WIN32 AND NOT CYGWIN) + IF (BUILD_SHARED_LIBS) + FILE (MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BLDTYPE}) + IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + GET_FILENAME_COMPONENT(ZLIB_DLL_NAME ${ZLIB_LIBRARY} NAME_WE) + # MESSAGE (STATUS "ZLIB_DLL_NAME: ${ZLIB_DLL_NAME}") + GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH) + # MESSAGE (STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}") + ADD_CUSTOM_TARGET (ZLIB-Release-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ + COMMENT "Copying ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" + ) + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ADD_DEPENDENCIES (ZLIB-Release-Copy ZLIB) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_PACKAGE_EXTLIBS) + SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) + ADD_CUSTOM_TARGET (ZLIB-Dll-Copy ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - ADD_DEPENDENCIES (ZLIB-Release-Copy ZLIB) + ADD_DEPENDENCIES (ZLIB-Dll-Copy ZLIB) ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + ENDIF (HDF5_PACKAGE_EXTLIBS) + ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - GET_FILENAME_COMPONENT(SZIP_DLL_NAME ${SZIP_LIBRARY} NAME_WE) - # MESSAGE (STATUS "SZIP_DLL_NAME: ${SZIP_DLL_NAME}") - GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH) - # MESSAGE (STATUS "SZIP_BIN_PATH: ${SZIP_BIN_PATH}") - ADD_CUSTOM_TARGET (SZIP-Release-Copy ALL + IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + GET_FILENAME_COMPONENT(SZIP_DLL_NAME ${SZIP_LIBRARY} NAME_WE) + # MESSAGE (STATUS "SZIP_DLL_NAME: ${SZIP_DLL_NAME}") + GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH) + # MESSAGE (STATUS "SZIP_BIN_PATH: ${SZIP_BIN_PATH}") + ADD_CUSTOM_TARGET (SZIP-Release-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ + COMMENT "Copying ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" + ) + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + ADD_DEPENDENCIES (SZIP-Release-Copy SZIP) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + IF (HDF5_PACKAGE_EXTLIBS) + SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) + ADD_CUSTOM_TARGET (SZIP-Dll-Copy ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - ADD_DEPENDENCIES (SZIP-Release-Copy SZIP) + ADD_DEPENDENCIES (SZIP-Dll-Copy SZIP) ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + ENDIF (HDF5_PACKAGE_EXTLIBS) + ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (WIN32 AND NOT CYGWIN) -ENDIF (HDF5_PACKAGE_EXTLIBS) + ENDIF (BUILD_SHARED_LIBS) +ENDIF (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Option to use threadsafe |