diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/HDF5_Examples.cmake.in | 2 | ||||
-rw-r--r-- | config/cmake/HDF5_Examples_options.cmake | 103 | ||||
-rw-r--r-- | config/cmake/README.txt.cmake.in | 2 | ||||
-rw-r--r-- | config/cmake/cacheinit.cmake | 2 | ||||
-rw-r--r-- | config/cmake/hdf5-config.cmake.in | 4 | ||||
-rw-r--r-- | config/cmake/mccacheinit.cmake | 2 | ||||
-rw-r--r-- | config/cmake/scripts/HDF5config.cmake | 2 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFLibMacros.cmake | 122 |
8 files changed, 47 insertions, 192 deletions
diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index c4d9cd8..bac174a 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -103,6 +103,8 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PAC if(WIN32) include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) else() include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) + include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) endif() diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index 6e4b510..386e99c 100644 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -57,106 +57,3 @@ #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON") ############################################################################################# -# Do not edit below this line -############################################################################################# -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if (APPLE) - # Compiler choice - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - if (NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -else () - set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") -endif () - -#----------------------------------------------------------------------------- -set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -## -------------------------- -if (CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar or zip file provided - ## -------------------------- - if (WIN32) - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else () - message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif () - - if (NOT rv EQUAL 0) - message (STATUS "extracting... [error-(${rv}) clean up]") - file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif () -endif() - -#----------------------------------------------------------------------------- -## Clear the build directory -## -------------------------- -set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) -else () - file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -endif () - -# Use multiple CPU cores to build -include (ProcessorCount) -ProcessorCount (N) -if (NOT N EQUAL 0) - if (NOT WIN32) - set (CTEST_BUILD_FLAGS -j${N}) - endif () - set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif () -set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" -) - -#----------------------------------------------------------------------------- -## -- set output to english -set ($ENV{LC_MESSAGES} "en_EN") - -#----------------------------------------------------------------------------- -configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) -ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") -## NORMAL process -## -------------------------- -ctest_start (Experimental) -ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) -if (${res} LESS 0 OR ${res} GREATER 0) - file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Configure Notes) -endif () -ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) -if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Build) -endif () -ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) -if (${res} LESS 0 OR ${res} GREATER 0) - file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") -endif () -if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) -endif () -if (${res} LESS 0 OR ${res} GREATER 0) - message (FATAL_ERROR "tests FAILED") -endif () -#----------------------------------------------------------------------------- -############################################################################################################## -message (STATUS "DONE") diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index be6ddc1..b29d50b 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -34,9 +34,9 @@ utility should be installed. To test the installation with the examples; Create a directory to run the examples. Copy HDF5Examples folder to this directory. + Copy CTestScript.cmake to this directory. Copy HDF5_Examples.cmake to this directory. Copy HDF5_Examples_options.cmake to this directory. - Copy CTestScript.cmake to this directory. The default source folder is defined as "HDF5Examples". It can be changed with the CTEST_SOURCE_NAME script option. The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@". diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index d5c5e52..5254115 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -19,6 +19,8 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Framework set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) +set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace (can be empty)" FORCE) + set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index b1ef0ac..d0f1d00 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -108,10 +108,10 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- if (NOT TARGET "@HDF5_PACKAGE@") - if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () - if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip") + if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 577144b..c35f51f 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -23,6 +23,8 @@ set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) +set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace" FORCE) + set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 83909b2..805aee1 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -34,7 +34,7 @@ cmake_minimum_required (VERSION 3.10) # CTEST_SOURCE_NAME - source folder ############################################################################## -set (CTEST_SOURCE_VERSION "1.11.4") +set (CTEST_SOURCE_VERSION "1.11.5") set (CTEST_SOURCE_VERSEXT "") ############################################################################## diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 2eda66c..9df2b4b 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -14,25 +14,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type 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 ${JPEG_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (JPEG GIT_REPOSITORY ${JPEG_URL} GIT_TAG ${JPEG_BRANCH} @@ -49,6 +31,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (JPEG @@ -67,23 +50,24 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target jpeg-static - add_library(jpeg-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "") - add_dependencies (jpeg-static JPEG) - set (JPEG_STATIC_LIBRARY "jpeg-static") + add_library(${HDF_PACKAGE_NAMESPACE}jpeg-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-static "jpeg" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-static JPEG) + set (JPEG_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-static") set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target jpeg-shared - add_library(jpeg-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "") - add_dependencies (jpeg-shared JPEG) - set (JPEG_SHARED_LIBRARY "jpeg-shared") + add_library(${HDF_PACKAGE_NAMESPACE}jpeg-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-shared "jpeg" SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-shared JPEG) + set (JPEG_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-shared") set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY}) endif () @@ -100,33 +84,14 @@ macro (PACKAGE_JPEG_LIBRARY compress_type) 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) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (JPEG-GenHeader-Copy JPEG) endif () endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) - if (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (SZIP - SVN_REPOSITORY ${SZIP_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - -DSZIP_ENABLE_ENCODING:BOOL=${encoding} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (SZIP GIT_REPOSITORY ${SZIP_URL} GIT_TAG ${SZIP_BRANCH} @@ -144,6 +109,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (SZIP @@ -163,23 +129,24 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static - add_library(szip-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "") - add_dependencies (szip-static SZIP) - set (SZIP_STATIC_LIBRARY "szip-static") + add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) + set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static") set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target szip-shared - add_library(szip-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "") - add_dependencies (szip-shared SZIP) - set (SZIP_SHARED_LIBRARY "szip-shared") + add_library(${HDF_PACKAGE_NAMESPACE}szip-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-shared "szip" SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-shared SZIP) + set (SZIP_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-shared") set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY}) endif () @@ -196,32 +163,14 @@ macro (PACKAGE_SZIP_LIBRARY compress_type) 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) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (SZIP-GenHeader-Copy SZIP) endif () endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_ZLIB_LIBRARY compress_type) - if (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (ZLIB - SVN_REPOSITORY ${ZLIB_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (ZLIB GIT_REPOSITORY ${ZLIB_URL} GIT_TAG ${ZLIB_BRANCH} @@ -238,6 +187,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (ZLIB @@ -256,6 +206,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) @@ -267,17 +218,18 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) endif () ##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target zlib-static - add_library(zlib-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "") - add_dependencies (zlib-static ZLIB) - set (ZLIB_STATIC_LIBRARY "zlib-static") + add_library(${HDF_PACKAGE_NAMESPACE}zlib-static STATIC IMPORTED) +# add_library(${HDF_PACKAGE_NAMESPACE}zlib-static ALIAS zlib-static) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-static ${ZLIB_LIB_NAME} STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB) + set (ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-static") set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target zlib-shared - add_library(zlib-shared SHARED IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "") - add_dependencies (zlib-shared ZLIB) - set (ZLIB_SHARED_LIBRARY "zlib-shared") + add_library(${HDF_PACKAGE_NAMESPACE}zlib-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-shared ${ZLIB_LIB_NAME} SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-shared ZLIB) + set (ZLIB_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-shared") set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) endif () @@ -294,7 +246,7 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type) 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) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (ZLIB-GenHeader-Copy ZLIB) endif () endmacro () |