From 05dfc85de8e6da2fdf2bd816e86edcabddeacccc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Feb 2011 14:43:07 -0500 Subject: [svn-r20153] Move ext lib handling for ext project building to a common macro. Update HDF5 project to use HDFMacros.cmake file. Add test properties for test ordering. Tested: local linux, windows --- CMakeLists.txt | 167 ++----------------- MANIFEST | 1 + c++/examples/CMakeLists.txt | 2 +- c++/test/CMakeLists.txt | 2 +- config/cmake/HDF5Macros.cmake | 117 +------------- config/cmake/HDFMacros.cmake | 321 +++++++++++++++++++++++++++++++++++++ examples/CMakeLists.txt | 4 +- fortran/examples/CMakeLists.txt | 4 +- fortran/test/CMakeLists.txt | 8 +- fortran/testpar/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 4 +- hl/c++/test/CMakeLists.txt | 4 +- hl/examples/CMakeLists.txt | 2 +- hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/test/CMakeLists.txt | 6 +- hl/test/CMakeLists.txt | 4 +- hl/tools/CMakeLists.txt | 6 +- perform/CMakeLists.txt | 22 +-- test/CMakeLists.txt | 22 +-- testpar/CMakeLists.txt | 4 +- tools/h5copy/CMakeLists.txt | 4 +- tools/h5diff/CMakeLists.txt | 4 +- tools/h5dump/CMakeLists.txt | 16 +- tools/h5import/CMakeLists.txt | 4 +- tools/h5jam/CMakeLists.txt | 10 +- tools/h5ls/CMakeLists.txt | 2 +- tools/h5repack/CMakeLists.txt | 6 +- tools/h5stat/CMakeLists.txt | 4 +- tools/misc/CMakeLists.txt | 10 +- 29 files changed, 419 insertions(+), 345 deletions(-) create mode 100644 config/cmake/HDFMacros.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index bd1c334..998b5b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,7 @@ SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") #----------------------------------------------------------------------------- # Include some macros for reusable code #----------------------------------------------------------------------------- +INCLUDE (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- @@ -457,13 +458,16 @@ OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") SET (ZLIB_USE_EXTERNAL 1) SET (SZIP_USE_EXTERNAL 1) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + SET (ZLIB_URL ${ZLIB_SVN_URL}) + SET (SZIP_URL ${SZIP_SVN_URL}) + ELSEIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") IF (NOT TGZ_PATH) SET (TGZ_PATH ${HDF5_SOURCE_DIR}) ENDIF (NOT TGZ_PATH) - SET (ZLIB_TGZ_URL ${TGZ_PATH}/${ZLIB_TGZ_NAME}) - SET (SZIP_TGZ_URL ${TGZ_PATH}/${SZIP_TGZ_NAME}) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + SET (ZLIB_URL ${TGZ_PATH}/${ZLIB_TGZ_NAME}) + SET (SZIP_URL ${TGZ_PATH}/${SZIP_TGZ_NAME}) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- @@ -483,58 +487,7 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) SET (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) ELSE (ZLIB_FOUND) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - EXTERNALPROJECT_ADD (ZLIB - SVN_REPOSITORY ${ZLIB_SVN_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - ) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - EXTERNALPROJECT_ADD (ZLIB - #LOG_DOWNLOAD 1 - URL ${ZLIB_TGZ_URL} - URL_MD5 "" - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - ) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) - - IF (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${CMAKE_IMPORT_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}z${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ENDIF (WIN32 AND NOT MINGW) - ELSE (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT MINGW) - IF (HDF_LEGACY_NAMING) - SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/zlib${CMAKE_STATIC_LIBRARY_SUFFIX}") - ELSE (HDF_LEGACY_NAMING) - SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libzlib${CMAKE_STATIC_LIBRARY_SUFFIX}") - ENDIF (HDF_LEGACY_NAMING) - ELSE (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libz${CMAKE_STATIC_LIBRARY_SUFFIX}") - ENDIF (WIN32 AND NOT MINGW) - ENDIF (BUILD_SHARED_LIBS) - SET (ZLIB_INCLUDE_DIR_GEN - "${BINARY_DIR}" - ) - SET (ZLIB_INCLUDE_DIR - "${SOURCE_DIR}/src" - ) - - SET (ZLIB_FOUND 1) - SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) + EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${ZLIB_URL} ${LIB_TYPE}) SET (H5_HAVE_FILTER_DEFLATE 1) SET (H5_HAVE_ZLIB_H 1) SET (H5_HAVE_LIBZ 1) @@ -571,55 +524,7 @@ IF (HDF5_ENABLE_SZIP_SUPPORT) SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) ELSE (SZIP_FOUND) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - EXTERNALPROJECT_ADD (SZIP - SVN_REPOSITORY ${SZIP_SVN_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DSZIP_ENABLE_ENCODING:BOOL=${HDF5_ENABLE_SZIP_ENCODING} - ) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - EXTERNALPROJECT_ADD (SZIP - #LOG_DOWNLOAD 1 - URL ${SZIP_TGZ_URL} - URL_MD5 "" - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DSZIP_ENABLE_ENCODING:BOOL=${HDF5_ENABLE_SZIP_ENCODING} - ) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) - - - IF (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT MINGW) - SET (SZIP_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${CMAKE_IMPORT_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) - SET (SZIP_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ENDIF (WIN32 AND NOT MINGW) - ELSE (BUILD_SHARED_LIBS) - SET (SZIP_LIBRARY - "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libszip${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) - ENDIF (BUILD_SHARED_LIBS) - SET (SZIP_INCLUDE_DIR_GEN - "${BINARY_DIR}" - ) - SET (SZIP_INCLUDE_DIR - "${SOURCE_DIR}/src" - ) - - SET (SZIP_FOUND 1) - SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) + EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${SZIP_URL} ${LIB_TYPE} ${HDF5_ENABLE_SZIP_ENCODING}) SET (H5_HAVE_FILTER_SZIP 1) SET (H5_HAVE_SZLIB_H 1) SET (H5_HAVE_LIBSZ 1) @@ -647,39 +552,11 @@ IF (HDF5_PACKAGE_EXTLIBS) FILE (MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BLDTYPE}) IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - ADD_CUSTOM_TARGET (ZLIB-GenHeader-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) - ADD_CUSTOM_TARGET (ZLIB-Library-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${ZLIB_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - GET_FILENAME_COMPONENT(ZLIB_LIB_NAME ${ZLIB_LIBRARY} NAME) - SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB) - ADD_DEPENDENCIES (ZLIB-Library-Copy ZLIB) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - ADD_CUSTOM_TARGET (SZIP-GenHeader-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) - ADD_CUSTOM_TARGET (SZIP-Library-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${SZIP_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - GET_FILENAME_COMPONENT(SZIP_LIB_NAME ${SZIP_LIBRARY} NAME) - SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP) - ADD_DEPENDENCIES (SZIP-Library-Copy SZIP) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) ENDIF (HDF5_PACKAGE_EXTLIBS) @@ -698,16 +575,6 @@ IF (WIN32 AND NOT CYGWIN) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ADD_DEPENDENCIES (ZLIB-Release-Copy ZLIB) ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - 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}/" - ) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ADD_DEPENDENCIES (ZLIB-Dll-Copy ZLIB) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (HDF5_PACKAGE_EXTLIBS) ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) @@ -722,16 +589,6 @@ IF (WIN32 AND NOT CYGWIN) IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ADD_DEPENDENCIES (SZIP-Release-Copy SZIP) ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - 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}/" - ) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ADD_DEPENDENCIES (SZIP-Dll-Copy SZIP) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (HDF5_PACKAGE_EXTLIBS) ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) ENDIF (BUILD_SHARED_LIBS) diff --git a/MANIFEST b/MANIFEST index ac6b83f..24397f0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1960,6 +1960,7 @@ ./config/cmake/hdf5-config.cmake.build.in ./config/cmake/hdf5-config.cmake.install.in ./config/cmake/hdf5-config-version.cmake.in +./config/cmake/HDFMacros.cmake ./config/cmake/HDF5Macros.cmake ./config/cmake/HDF5UseFortran.cmake ./config/cmake/libhdf5.settings.cmake.in diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 7bb6bb5..06edd7a 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -22,7 +22,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - H5_NAMING (cpp_ex_${example} ${LIB_TYPE}) + TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) IF (BUILD_TESTING) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 197ed84..21cb9c0 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -36,7 +36,7 @@ INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} ) ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) -H5_NAMING (cpp_testhdf5 ${LIB_TYPE}) +TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 3b15e02..b9e37bb 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -1,107 +1,6 @@ #------------------------------------------------------------------------------- -MACRO (SET_GLOBAL_VARIABLE name value) - SET (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) -ENDMACRO (SET_GLOBAL_VARIABLE) - -#------------------------------------------------------------------------------- -MACRO (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) - #set(source_group_path "Source/AIM/${NAME}") - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) - source_group(${source_group_path} FILES ${HEADERS} ${SOURCES}) - - #-- The following is needed if we ever start to use OS X Frameworks but only - #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} - # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} - #) -ENDMACRO (IDE_GENERATED_PROPERTIES) - -#------------------------------------------------------------------------------- -MACRO (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) - # INSTALL (FILES ${HEADERS} - # DESTINATION include/R3D/${NAME} - # COMPONENT Headers - # ) - - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) - source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) - - #-- The following is needed if we ever start to use OS X Frameworks but only - #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} - # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} - #) -ENDMACRO (IDE_SOURCE_PROPERTIES) - -#------------------------------------------------------------------------------- -MACRO (H5_NAMING target libtype) - IF (WIN32 AND NOT MINGW) - IF (${libtype} MATCHES "SHARED") - IF (HDF_LEGACY_NAMING) - SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "dll") - SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "${target}") - ELSE (HDF_LEGACY_NAMING) - SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "${target}dll") - ENDIF (HDF_LEGACY_NAMING) - ENDIF (${libtype} MATCHES "SHARED") - ENDIF (WIN32 AND NOT MINGW) -ENDMACRO (H5_NAMING) - -#------------------------------------------------------------------------------- MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) - # message (STATUS "${libname} libtype: ${libtype}") - IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - IF (HDF_LEGACY_NAMING) - SET (LIB_RELEASE_NAME "${libname}dll") - SET (LIB_DEBUG_NAME "${libname}ddll") - ELSE (HDF_LEGACY_NAMING) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_D") - ENDIF (HDF_LEGACY_NAMING) - ELSE (WIN32 AND NOT MINGW) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ENDIF (WIN32 AND NOT MINGW) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - IF (HDF_LEGACY_NAMING) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}d") - ELSE (HDF_LEGACY_NAMING) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_D") - ENDIF (HDF_LEGACY_NAMING) - ELSE (WIN32 AND NOT MINGW) - # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_debug") - ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") - - SET_TARGET_PROPERTIES (${libtarget} - PROPERTIES - DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME} - RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME} - MINSIZEREL_OUTPUT_NAME ${LIB_RELEASE_NAME} - RELWITHDEBINFO_OUTPUT_NAME ${LIB_RELEASE_NAME} - ) - - #----- Use MSVC Naming conventions for Shared Libraries - IF (MINGW AND ${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} - PROPERTIES - IMPORT_SUFFIX ".lib" - IMPORT_PREFIX "" - PREFIX "" - ) - ENDIF (MINGW AND ${libtype} MATCHES "SHARED") - + HDF_SET_LIB_OPTIONS (${libtarget} ${libname} ${libtype}) IF (${libtype} MATCHES "SHARED") IF (WIN32) SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) @@ -125,17 +24,3 @@ MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) ENDIF (APPLE) ENDMACRO (H5_SET_LIB_OPTIONS) - -#------------------------------------------------------------------------------- -MACRO (TARGET_FORTRAN_WIN_PROPERTIES target addlinkflags) - IF (WIN32) - IF (MSVC) - SET_TARGET_PROPERTIES (${target} - PROPERTIES - COMPILE_FLAGS "/dll" - LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" - ) - ENDIF (MSVC) - ENDIF (WIN32) -ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) - diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake new file mode 100644 index 0000000..5f46b4c --- /dev/null +++ b/config/cmake/HDFMacros.cmake @@ -0,0 +1,321 @@ +#------------------------------------------------------------------------------- +MACRO (SET_GLOBAL_VARIABLE name value) + SET (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) +ENDMACRO (SET_GLOBAL_VARIABLE) + +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_JPEG_LIBRARY compress_type lib_url jpeg_pic) + # May need to build JPEG with PIC on x64 machines with gcc + # Need to use CMAKE_ANSI_CFLAGS define so that compiler test works + + IF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (JPEG + SVN_REPOSITORY ${lib_url} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING="Release" + -DCMAKE_ANSI_CFLAGS:STRING="${jpeg_pic}" + ) + ELSEIF (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (JPEG + URL ${lib_url} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING="Release" + -DCMAKE_ANSI_CFLAGS:STRING="${jpeg_pic}" + ) + ENDIF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR) + + SET (JPEG_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libjpeg${CMAKE_STATIC_LIBRARY_SUFFIX}") + SET (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") + SET (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") + SET (JPEG_FOUND 1) + SET (JPEG_LIBRARIES ${JPEG_LIBRARY}) + SET (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_JPEG_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_JPEG_LIBRARY compress_type) + ADD_CUSTOM_TARGET (JPEG-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_INCLUDE_DIR_GEN}/jconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) + ADD_CUSTOM_TARGET (JPEG-Library-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${JPEG_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + GET_FILENAME_COMPONENT(JPEG_LIB_NAME ${JPEG_LIBRARY} NAME) + SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}) + IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ADD_DEPENDENCIES (JPEG-GenHeader-Copy JPEG) + ADD_DEPENDENCIES (JPEG-Library-Copy JPEG) + ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +ENDMACRO (PACKAGE_JPEG_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_SZIP_LIBRARY compress_type lib_url libtype encoding) + IF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (SZIP + SVN_REPOSITORY ${lib_url} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${libtype} + -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + ) + ELSEIF (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (SZIP + URL ${lib_url} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${libtype} + -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + ) + ENDIF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) + + IF (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${CMAKE_IMPORT_LIBRARY_SUFFIX}") + ELSE (WIN32 AND NOT MINGW) + SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${CMAKE_SHARED_LIBRARY_SUFFIX}") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${libtype} MATCHES "SHARED") + SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libszip${CMAKE_STATIC_LIBRARY_SUFFIX}") + ENDIF (${libtype} MATCHES "SHARED") + SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") + SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") + SET (SZIP_FOUND 1) + SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) + SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_SZIP_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_SZIP_LIBRARY compress_type libtype) + ADD_CUSTOM_TARGET (SZIP-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) + ADD_CUSTOM_TARGET (SZIP-Library-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${SZIP_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + GET_FILENAME_COMPONENT(SZIP_LIB_NAME ${SZIP_LIBRARY} NAME) + SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}) + IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP) + ADD_DEPENDENCIES (SZIP-Library-Copy SZIP) + ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + IF (WIN32 AND NOT CYGWIN) + IF (${libtype} MATCHES "SHARED") + 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}/" + ) + IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ADD_DEPENDENCIES (SZIP-Dll-Copy SZIP) + ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ENDIF (${libtype} MATCHES "SHARED") + ENDIF (WIN32 AND NOT CYGWIN) +ENDMACRO (PACKAGE_SZIP_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_ZLIB_LIBRARY compress_type lib_url libtype) + IF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (ZLIB + SVN_REPOSITORY ${lib_url} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DHDF_LEGACY_NAMING:BOOL=${HDF_LEGACY_NAMING} + ) + ELSEIF (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (ZLIB + URL ${lib_url} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DHDF_LEGACY_NAMING:BOOL=${HDF_LEGACY_NAMING} + ) + ENDIF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) + + IF (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${CMAKE_IMPORT_LIBRARY_SUFFIX}") + ELSE (WIN32 AND NOT MINGW) + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}z${CMAKE_SHARED_LIBRARY_SUFFIX}") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + IF (HDF_LEGACY_NAMING) + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/zlib${CMAKE_STATIC_LIBRARY_SUFFIX}") + ELSE (HDF_LEGACY_NAMING) + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libzlib${CMAKE_STATIC_LIBRARY_SUFFIX}") + ENDIF (HDF_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libz${CMAKE_STATIC_LIBRARY_SUFFIX}") + ENDIF (WIN32 AND NOT MINGW) + ENDIF (${libtype} MATCHES "SHARED") + SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") + SET (ZLIB_INCLUDE_DIR "${SOURCE_DIR}/src") + SET (ZLIB_FOUND 1) + SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_ZLIB_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_ZLIB_LIBRARY compress_type libtype) + ADD_CUSTOM_TARGET (ZLIB-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) + ADD_CUSTOM_TARGET (ZLIB-Library-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${ZLIB_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + GET_FILENAME_COMPONENT(ZLIB_LIB_NAME ${ZLIB_LIBRARY} NAME) + SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}) + IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB) + ADD_DEPENDENCIES (ZLIB-Library-Copy ZLIB) + ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + IF (WIN32 AND NOT CYGWIN) + IF (${libtype} MATCHES "SHARED") + 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}/" + ) + IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ADD_DEPENDENCIES (ZLIB-Dll-Copy ZLIB) + ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ENDIF (${libtype} MATCHES "SHARED") + ENDIF (WIN32 AND NOT CYGWIN) +ENDMACRO (PACKAGE_ZLIB_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) + #set(source_group_path "Source/AIM/${NAME}") + STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) + source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) + + #-- The following is needed if we ever start to use OS X Frameworks but only + #-- works on CMake 2.6 and greater + #SET_PROPERTY (SOURCE ${HEADERS} + # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} + #) +ENDMACRO (IDE_GENERATED_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) + # INSTALL (FILES ${HEADERS} + # DESTINATION include/R3D/${NAME} + # COMPONENT Headers + # ) + + STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) + source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) + + #-- The following is needed if we ever start to use OS X Frameworks but only + #-- works on CMake 2.6 and greater + #SET_PROPERTY (SOURCE ${HEADERS} + # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} + #) +ENDMACRO (IDE_SOURCE_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (TARGET_NAMING target libtype) + IF (WIN32 AND NOT MINGW) + IF (${libtype} MATCHES "SHARED") + IF (HDF_LEGACY_NAMING) + SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "dll") + SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "${target}") + ELSE (HDF_LEGACY_NAMING) + SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "${target}dll") + ENDIF (HDF_LEGACY_NAMING) + ENDIF (${libtype} MATCHES "SHARED") + ENDIF (WIN32 AND NOT MINGW) +ENDMACRO (TARGET_NAMING) + +#------------------------------------------------------------------------------- +MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) + # message (STATUS "${libname} libtype: ${libtype}") + IF (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + IF (HDF_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}dll") + SET (LIB_DEBUG_NAME "${libname}ddll") + ELSE (HDF_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}_D") + ENDIF (HDF_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}_debug") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + IF (HDF_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}d") + ELSE (HDF_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "lib${libname}") + SET (LIB_DEBUG_NAME "lib${libname}_D") + ENDIF (HDF_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value + IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}_debug") + ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + SET (LIB_RELEASE_NAME "lib${libname}") + SET (LIB_DEBUG_NAME "lib${libname}_debug") + ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + ENDIF (WIN32 AND NOT MINGW) + ENDIF (${libtype} MATCHES "SHARED") + + SET_TARGET_PROPERTIES (${libtarget} + PROPERTIES + DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME} + RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME} + MINSIZEREL_OUTPUT_NAME ${LIB_RELEASE_NAME} + RELWITHDEBINFO_OUTPUT_NAME ${LIB_RELEASE_NAME} + ) + + #----- Use MSVC Naming conventions for Shared Libraries + IF (MINGW AND ${libtype} MATCHES "SHARED") + SET_TARGET_PROPERTIES (${libtarget} + PROPERTIES + IMPORT_SUFFIX ".lib" + IMPORT_PREFIX "" + PREFIX "" + ) + ENDIF (MINGW AND ${libtype} MATCHES "SHARED") + +ENDMACRO (HDF_SET_LIB_OPTIONS) + +#------------------------------------------------------------------------------- +MACRO (TARGET_FORTRAN_WIN_PROPERTIES target addlinkflags) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (${target} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + ) + ENDIF (MSVC) + ENDIF (WIN32) +ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 86d9307..87a21881 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -24,7 +24,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - H5_NAMING (${example} ${LIB_TYPE}) + TARGET_NAMING (${example} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) IF (BUILD_TESTING) @@ -38,7 +38,7 @@ ENDIF (BUILD_TESTING) IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) - H5_NAMING (ph5example ${LIB_TYPE}) + TARGET_NAMING (ph5example ${LIB_TYPE}) TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) IF (BUILD_TESTING) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index b1a9b90..ee459e1 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -32,7 +32,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - H5_NAMING (f90_ex_${example} ${LIB_TYPE}) + TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_${example} "") IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_${example} @@ -54,7 +54,7 @@ ENDFOREACH (example ${examples}) IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - H5_NAMING (f90_ex_ph5example ${LIB_TYPE}) + TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example "") IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_ph5example diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index df370bf..e0f25b8 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -59,7 +59,7 @@ ADD_EXECUTABLE (testhdf5_fortran tH5VL.f90 tH5Z.f90 ) -H5_NAMING (testhdf5_fortran ${LIB_TYPE}) +TARGET_NAMING (testhdf5_fortran ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran "") TARGET_LINK_LIBRARIES (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} @@ -81,7 +81,7 @@ ADD_EXECUTABLE (testhdf5_fortran_1_8 tH5A_1_8.f90 tH5G_1_8.f90 ) -H5_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE}) +TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (testhdf5_fortran_1_8 "") TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} @@ -97,7 +97,7 @@ ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $) #-- Adding test for fflush1 ADD_EXECUTABLE (fflush1 fflush1.f90) -H5_NAMING (fflush1 ${LIB_TYPE}) +TARGET_NAMING (fflush1 ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (fflush1 "") TARGET_LINK_LIBRARIES (fflush1 ${HDF5_F90_LIB_TARGET} @@ -113,7 +113,7 @@ ADD_TEST (NAME fflush1 COMMAND $) #-- Adding test for fflush2 ADD_EXECUTABLE (fflush2 fflush2.f90) -H5_NAMING (fflush2 ${LIB_TYPE}) +TARGET_NAMING (fflush2 ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (fflush2 "") TARGET_LINK_LIBRARIES (fflush2 ${HDF5_F90_TEST_LIB_TARGET} diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index c94640a..c71f679 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -16,7 +16,7 @@ ADD_EXECUTABLE (parallel_test hyper.f90 mdset.f90 ) -H5_NAMING (parallel_test ${LIB_TYPE}) +TARGET_NAMING (parallel_test ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (parallel_test "") TARGET_LINK_LIBRARIES (parallel_test ${HDF5_F90_TEST_LIB_TARGET} diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 9b86027..f396523 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -11,7 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) -H5_NAMING (ptExampleFL ${LIB_TYPE}) +TARGET_NAMING (ptExampleFL ${LIB_TYPE}) TARGET_LINK_LIBRARIES ( ptExampleFL ${HDF5_HL_CPP_LIB_TARGET} @@ -20,7 +20,7 @@ TARGET_LINK_LIBRARIES ( ) ADD_EXECUTABLE (ptExampleVL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleVL.cpp) -H5_NAMING (ptExampleVL ${LIB_TYPE}) +TARGET_NAMING (ptExampleVL ${LIB_TYPE}) TARGET_LINK_LIBRARIES ( ptExampleVL ${HDF5_HL_CPP_LIB_TARGET} diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index c7fb793..7fc3418 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -17,7 +17,7 @@ IF (BUILD_TESTING) INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) - H5_NAMING (hl_ptableTest ${LIB_TYPE}) + TARGET_NAMING (hl_ptableTest ${LIB_TYPE}) TARGET_LINK_LIBRARIES ( hl_ptableTest ${HDF5_LIB_TARGET} @@ -26,8 +26,6 @@ IF (BUILD_TESTING) ${HDF5_HL_LIB_TARGET} ${HDF5_HL_CPP_LIB_TARGET} ) - GET_TARGET_PROPERTY (hl_ptableTestpath hl_ptableTest LOCATION) - GET_FILENAME_COMPONENT (hl_ptableTestexe ${hl_ptableTestpath} NAME) ADD_TEST (NAME hl_ptableTest COMMAND $) ENDIF (BUILD_TESTING) diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 298ce94..28672b6 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -43,7 +43,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) - H5_NAMING (hl_ex_${example} ${LIB_TYPE}) + TARGET_NAMING (hl_ex_${example} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) IF (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 2f56297..50fa1ea 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -16,7 +16,7 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - H5_NAMING (hl_f90_ex_${example} ${LIB_TYPE}) + TARGET_NAMING (hl_f90_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_ex_${example} "") TARGET_LINK_LIBRARIES (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index c9e236e..0a91b85 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -22,7 +22,7 @@ ADD_TEST ( #-- Adding test for hl_f90_tstlite ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) -H5_NAMING (hl_f90_tstlite ${LIB_TYPE}) +TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstlite "") TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) @@ -31,7 +31,7 @@ ADD_TEST (NAME hl_f90_tstlite COMMAND $) #-- Adding test for hl_f90_tstimage ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90) -H5_NAMING (hl_f90_tstimage ${LIB_TYPE}) +TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstimage "") TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) @@ -40,7 +40,7 @@ ADD_TEST (NAME hl_f90_tstimage COMMAND $) #-- Adding test for hl_f90_tsttable ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90) -H5_NAMING (hl_f90_tsttable ${LIB_TYPE}) +TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tsttable "") TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 4c345dd..3104008 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -22,7 +22,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- MACRO (HL_ADD_TEST hl_name files) ADD_EXECUTABLE (hl_${hl_name} ${hl_name}.c) - H5_NAMING (hl_${hl_name} ${LIB_TYPE}) + TARGET_NAMING (hl_${hl_name} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (hl_${hl_name} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -86,7 +86,7 @@ HL_ADD_TEST (test_table "test_table_be.hdf5;test_table_cray.hdf5;test_table_le.h # -------------------------------------------------------------------- IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c) - H5_NAMING (hl_gen_test_ds ${LIB_TYPE}) + TARGET_NAMING (hl_gen_test_ds ${LIB_TYPE}) TARGET_LINK_LIBRARIES (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index df45631..1d3076b 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -18,7 +18,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) -H5_NAMING (gif2h5 ${LIB_TYPE}) +TARGET_NAMING (gif2h5 ${LIB_TYPE}) TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) #-- Add h52gif program @@ -27,7 +27,7 @@ SET (hdf2gif_SRCS ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdfgifwr.c ) ADD_EXECUTABLE (hdf2gif ${hdf2gif_SRCS}) -H5_NAMING (hdf2gif ${LIB_TYPE}) +TARGET_NAMING (hdf2gif ${LIB_TYPE}) TARGET_LINK_LIBRARIES (hdf2gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) # -------------------------------------------------------------------- @@ -37,7 +37,7 @@ TARGET_LINK_LIBRARIES (hdf2gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_T # -------------------------------------------------------------------- IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) - H5_NAMING (hl_h52gifgentest ${LIB_TYPE}) + TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) # ADD_TEST (NAME hl_h52gifgentest COMMAND $) diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 578b5a6..f55888d 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -33,7 +33,7 @@ SET (h5perf_serial_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) -H5_NAMING (h5perf_serial ${LIB_TYPE}) +TARGET_NAMING (h5perf_serial ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME h5perf_serial COMMAND $) @@ -49,7 +49,7 @@ IF (HDF5_BUILD_PERFORM_STANDALONE) SET_PROPERTY (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) - H5_NAMING (h5perf_serial_alone ${LIB_TYPE}) + TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME h5perf_serial_alone COMMAND $) @@ -60,7 +60,7 @@ SET (chunk_SRCS ${HDF5_PERFORM_SOURCE_DIR}/chunk.c ) ADD_EXECUTABLE(chunk ${chunk_SRCS}) -H5_NAMING (chunk ${LIB_TYPE}) +TARGET_NAMING (chunk ${LIB_TYPE}) TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME chunk COMMAND $) @@ -70,7 +70,7 @@ SET (iopipe_SRCS ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c ) ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) -H5_NAMING (iopipe ${LIB_TYPE}) +TARGET_NAMING (iopipe ${LIB_TYPE}) TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME iopipe COMMAND $) @@ -80,7 +80,7 @@ SET (overhead_SRCS ${HDF5_PERFORM_SOURCE_DIR}/overhead.c ) ADD_EXECUTABLE (overhead ${overhead_SRCS}) -H5_NAMING (overhead ${LIB_TYPE}) +TARGET_NAMING (overhead ${LIB_TYPE}) TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_TEST (NAME overhead COMMAND $) @@ -90,7 +90,7 @@ SET (perf_meta_SRCS ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c ) ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) -H5_NAMING (perf_meta ${LIB_TYPE}) +TARGET_NAMING (perf_meta ${LIB_TYPE}) TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME perf_meta COMMAND $) @@ -100,7 +100,7 @@ SET (zip_perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c ) ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) -H5_NAMING (zip_perf ${LIB_TYPE}) +TARGET_NAMING (zip_perf ${LIB_TYPE}) TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_TEST (NAME zip_perf COMMAND $ "-h") @@ -113,7 +113,7 @@ IF (H5_HAVE_PARALLEL) ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) ADD_EXECUTABLE (h5perf ${h5perf_SRCS}) - H5_NAMING (h5perf ${LIB_TYPE}) + TARGET_NAMING (h5perf ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) @@ -129,7 +129,7 @@ IF (H5_HAVE_PARALLEL) SET_PROPERTY (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) - H5_NAMING (h5perf_alone ${LIB_TYPE}) + TARGET_NAMING (h5perf_alone ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) @@ -140,7 +140,7 @@ IF (H5_HAVE_PARALLEL) ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c ) ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) - H5_NAMING (benchpar ${LIB_TYPE}) + TARGET_NAMING (benchpar ${LIB_TYPE}) TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) @@ -150,7 +150,7 @@ IF (H5_HAVE_PARALLEL) ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c ) ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) - H5_NAMING (mpi-perf ${LIB_TYPE}) + TARGET_NAMING (mpi-perf ${LIB_TYPE}) TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8fb93b5..ca975f9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -146,7 +146,7 @@ SET (testhdf5_SRCS #-- Adding test for testhdf5 ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) -H5_NAMING (testhdf5 ${LIB_TYPE}) +TARGET_NAMING (testhdf5 ${LIB_TYPE}) TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_TEST (NAME testhdf5 COMMAND $) @@ -159,7 +159,7 @@ ADD_TEST (NAME testhdf5 COMMAND $) MACRO (ADD_H5_TEST file) ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - H5_NAMING (${file} ${LIB_TYPE}) + TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_TEST (NAME ${file} COMMAND $) @@ -311,7 +311,7 @@ SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) #-- Adding test for cache ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) -H5_NAMING (cache ${LIB_TYPE}) +TARGET_NAMING (cache ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME cache COMMAND $) @@ -319,14 +319,14 @@ SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-objects) #-- Adding test for cache_api ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) -H5_NAMING (cache_api ${LIB_TYPE}) +TARGET_NAMING (cache_api ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME cache_api COMMAND $) #-- Adding test for cache_tagging ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) -H5_NAMING (cache_tagging ${LIB_TYPE}) +TARGET_NAMING (cache_tagging ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME cache_tagging COMMAND $) @@ -338,7 +338,7 @@ ADD_EXECUTABLE (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) -H5_NAMING (ttsafe ${LIB_TYPE}) +TARGET_NAMING (ttsafe ${LIB_TYPE}) TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME ttsafe COMMAND $) @@ -346,7 +346,7 @@ ADD_TEST (NAME ttsafe COMMAND $) #-- Adding test for err_compat IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) - H5_NAMING (err_compat ${LIB_TYPE}) + TARGET_NAMING (err_compat ${LIB_TYPE}) TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME err_compat COMMAND "${CMAKE_COMMAND}" @@ -363,7 +363,7 @@ ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) -H5_NAMING (error_test ${LIB_TYPE}) +TARGET_NAMING (error_test ${LIB_TYPE}) TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" @@ -379,7 +379,7 @@ ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" #-- Adding test for links_env ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) -H5_NAMING (links_env ${LIB_TYPE}) +TARGET_NAMING (links_env ${LIB_TYPE}) TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME links_env COMMAND "${CMAKE_COMMAND}" @@ -508,7 +508,7 @@ ENDIF (HDF5_TEST_VFD) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) MACRO (ADD_H5_GENERATOR genfile) ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) - H5_NAMING (${genfile} ${LIB_TYPE}) + TARGET_NAMING (${genfile} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) ENDMACRO (ADD_H5_GENERATOR genfile) @@ -535,7 +535,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) FOREACH (gen ${H5_GENERATORS}) ADD_EXECUTABLE (${gen} ${HDF5_TEST_SOURCE_DIR}/${gen}.c) - H5_NAMING (${gen} ${LIB_TYPE}) + TARGET_NAMING (${gen} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${gen} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) ENDFOREACH (gen ${H5_GENERATORS}) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index f6ad731..efe2006 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -21,14 +21,14 @@ SET (testphdf5_SRCS #-- Adding test for testhdf5 ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) -H5_NAMING (testphdf5 ${LIB_TYPE}) +TARGET_NAMING (testphdf5 ${LIB_TYPE}) TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_TEST (NAME testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) MACRO (ADD_H5P_TEST file) ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) - H5_NAMING (${file} ${LIB_TYPE}) + TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_TEST (NAME ${file} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $ -p) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 2f39282..a2d185a 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -11,7 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # Add the h5copy and test executables # -------------------------------------------------------------------- ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) -H5_NAMING (h5copy ${LIB_TYPE}) +TARGET_NAMING (h5copy ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES h5copy) @@ -25,7 +25,7 @@ SET (H5_DEP_EXECUTABLES h5copy) IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) - H5_NAMING (h5copygentest ${LIB_TYPE}) + TARGET_NAMING (h5copygentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) #ADD_TEST (NAME h5copygentest COMMAND $) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 3041171..270bd15 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -14,7 +14,7 @@ ADD_EXECUTABLE (h5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) -H5_NAMING (h5diff ${LIB_TYPE}) +TARGET_NAMING (h5diff ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES h5diff) @@ -31,7 +31,7 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) - H5_NAMING (h5diffgentest ${LIB_TYPE}) + TARGET_NAMING (h5diffgentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) #ADD_TEST (NAME h5diffgentest COMMAND $) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 77f3763..13cfee7 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -11,7 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # Add the h5dump executables # -------------------------------------------------------------------- ADD_EXECUTABLE (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c) -H5_NAMING (h5dump ${LIB_TYPE}) +TARGET_NAMING (h5dump ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES h5dump) @@ -28,7 +28,7 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - H5_NAMING (h5dumpgentest ${LIB_TYPE}) + TARGET_NAMING (h5dumpgentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) #ADD_TEST (NAME h5dumpgentest COMMAND $) @@ -972,16 +972,28 @@ IF (BUILD_TESTING) # NATIVE default. the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST (tbin1 0 -d integer -o out1.bin -b tbinary.h5) ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove out1.h5) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-clear-out1 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES DEPENDS H5DUMP-clear-out1) ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer) + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES DEPENDS H5DUMP-h5import-out1) + SET (last_test "H5DUMP-h5diff-out1") ADD_H5_TEST (tbin2 0 -b BE -d float -o out2.bin tbinary.h5) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST (tbin3 0 -d integer -o out3.bin -b NATIVE tbinary.h5) ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove out3.h5) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-clear-out3 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-clear-out3) ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q) + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES DEPENDS H5DUMP-h5import-out3) + SET (last_test "H5DUMP-h5diff-out3") ADD_H5_TEST (tbin4 0 -d double -b FILE -o out4.bin tbinary.h5) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 8eea367..8a2ec82 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -11,7 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # Add the h5import executables # -------------------------------------------------------------------- ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) -H5_NAMING (h5import ${LIB_TYPE}) +TARGET_NAMING (h5import ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES h5import) @@ -27,7 +27,7 @@ IF (BUILD_TESTING) # Add the h5import executables # -------------------------------------------------------------------- ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) - H5_NAMING (h5importtest ${LIB_TYPE}) + TARGET_NAMING (h5importtest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ############################################################################## diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 215dbc8..fce4e0c 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -11,19 +11,19 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # Add the h5jam executables # -------------------------------------------------------------------- ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) -H5_NAMING (h5jam ${LIB_TYPE}) +TARGET_NAMING (h5jam ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) -H5_NAMING (getub ${LIB_TYPE}) +TARGET_NAMING (getub ${LIB_TYPE}) TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) -H5_NAMING (tellub ${LIB_TYPE}) +TARGET_NAMING (tellub ${LIB_TYPE}) TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) -H5_NAMING (h5unjam ${LIB_TYPE}) +TARGET_NAMING (h5unjam ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES @@ -45,7 +45,7 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) - H5_NAMING (h5jamgentest ${LIB_TYPE}) + TARGET_NAMING (h5jamgentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) #ADD_TEST (NAME h5jamgentest COMMAND $) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 431a693..d1e6bdf 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -11,7 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # Add the h5ls executable #----------------------------------------------------------------------------- ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) -H5_NAMING (h5ls ${LIB_TYPE}) +TARGET_NAMING (h5ls ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 92933d4..c6ae2ac 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -21,7 +21,7 @@ SET (REPACK_COMMON_SRCS ) ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) -H5_NAMING (h5repack ${LIB_TYPE}) +TARGET_NAMING (h5repack ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES h5repack) @@ -37,7 +37,7 @@ IF (BUILD_TESTING) # Add h5Repack test executables # -------------------------------------------------------------------- ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) - H5_NAMING (testh5repack_detect_szip ${LIB_TYPE}) + TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE}) TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME testh5repack_detect_szip COMMAND $) @@ -55,7 +55,7 @@ IF (BUILD_TESTING) ENDIF (HDF5_ENABLE_SZIP_SUPPORT) ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) - H5_NAMING (h5repacktest ${LIB_TYPE}) + TARGET_NAMING (h5repacktest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) ADD_TEST (NAME h5repacktest COMMAND $) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 8dceae8..af3937b 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -11,7 +11,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # Add the h5stat executables # -------------------------------------------------------------------- ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) -H5_NAMING (h5stat ${LIB_TYPE}) +TARGET_NAMING (h5stat ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES h5stat) @@ -28,7 +28,7 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) - H5_NAMING (h5stat_gentest ${LIB_TYPE}) + TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) #ADD_TEST (NAME h5stat_gentest COMMAND $) diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 6694458..f985e05 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -12,15 +12,15 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- #-- Misc Executables ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) -H5_NAMING (h5debug ${LIB_TYPE}) +TARGET_NAMING (h5debug ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) -H5_NAMING (h5repart ${LIB_TYPE}) +TARGET_NAMING (h5repart ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) -H5_NAMING (h5mkgrp ${LIB_TYPE}) +TARGET_NAMING (h5mkgrp ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) SET (H5_DEP_EXECUTABLES @@ -41,13 +41,13 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) - H5_NAMING (h5repart_gentest ${LIB_TYPE}) + TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) #ADD_TEST (NAME h5repart_gentest COMMAND $) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) - H5_NAMING (h5repart_test ${LIB_TYPE}) + TARGET_NAMING (h5repart_test ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) # -------------------------------------------------------------------- -- cgit v0.12