diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-10-29 17:15:13 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-10-29 17:15:13 (GMT) |
commit | 0ce736c15a393e26ede6235740dadc72bb41006c (patch) | |
tree | dd81608c0a572ff6b7615799978ede239d32a390 /config/cmake_ext_mod | |
parent | 8c26358eca11455235df239a7e9f3a225b3141da (diff) | |
download | hdf5-0ce736c15a393e26ede6235740dadc72bb41006c.zip hdf5-0ce736c15a393e26ede6235740dadc72bb41006c.tar.gz hdf5-0ce736c15a393e26ede6235740dadc72bb41006c.tar.bz2 |
HDFFV-10594, HDFFV-10332, HDFFV-9059 merge from develop
Diffstat (limited to 'config/cmake_ext_mod')
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 52 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFLibMacros.cmake | 9 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFMacros.cmake | 17 |
3 files changed, 44 insertions, 34 deletions
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index b0deab7..6afac35 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -142,10 +142,6 @@ endif () macro (HDF_FUNCTION_TEST OTHER_TEST) if (NOT DEFINED ${HDF_PREFIX}_${OTHER_TEST}) set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") - set (OTHER_TEST_ADD_LIBRARIES) - if (CMAKE_REQUIRED_LIBRARIES) - set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif () foreach (def HAVE_SYS_TIME_H @@ -168,8 +164,8 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - "${OTHER_TEST_ADD_LIBRARIES}" + COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}" + LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) if (${OTHER_TEST}) @@ -277,13 +273,12 @@ if (NOT WINDOWS) set (HDF_EXTRA_C_FLAGS -D_GNU_SOURCE) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) - if (HDF_ENABLE_LARGE_FILE) + if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN) set (msg "Performing TEST_LFS_WORKS") TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS - OUTPUT_VARIABLE OUTPUT + COMPILE_DEFINITIONS "-DTEST_LFS_WORKS" ) # The LARGEFILE definitions were from the transition period @@ -300,14 +295,14 @@ if (NOT WINDOWS) set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" + "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n" ) endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" + "Test TEST_LFS_WORKS Compile failed\n" ) endif () endif () @@ -573,36 +568,27 @@ endif () if (WINDOWS) if (NOT HDF_NO_IOEO_TEST) message (STATUS "Checking for InitOnceExecuteOnce:") - if (NOT DEFINED ${${HDF_PREFIX}_HAVE_IOEO}) + if (NOT DEFINED ${HDF_PREFIX}_HAVE_IOEO) if (LARGEFILE) set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) endif () - set (MACRO_CHECK_FUNCTION_DEFINITIONS - "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") - if (CMAKE_REQUIRED_LIBRARIES) - set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - else () - set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - endif () + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") if (CMAKE_REQUIRED_INCLUDES) - set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES - "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") else () set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) endif () TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_EXT_DIR}/HDFTests.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} - "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" - "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" - COMPILE_OUTPUT_VARIABLE OUTPUT) + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFTests.c + COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${MACRO_CHECK_FUNCTION_DEFINITIONS}" + LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" + CMAKE_FLAGS "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}" + COMPILE_OUTPUT_VARIABLE OUTPUT + ) # if it did not compile make the return value fail code of 1 if (NOT HAVE_IOEO_COMPILED) set (HAVE_IOEO_EXITCODE 1) @@ -653,8 +639,8 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} - OUTPUT_VARIABLE OUTPUT + COMPILE_DEFINITIONS "${CURRENT_TEST_DEFINITIONS}" + RUN_OUTPUT_VARIABLE OUTPUT ) if (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) if (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) @@ -666,7 +652,7 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " endif () else () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n" + "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed\n" ) endif () diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 54e408b..8a37af3 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -30,6 +30,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -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") EXTERNALPROJECT_ADD (JPEG @@ -47,6 +48,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -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 "TGZ") EXTERNALPROJECT_ADD (JPEG @@ -64,6 +66,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -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} ) endif () externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) @@ -121,6 +124,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -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") EXTERNALPROJECT_ADD (SZIP @@ -139,6 +143,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -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 "TGZ") EXTERNALPROJECT_ADD (SZIP @@ -157,6 +162,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -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} ) endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) @@ -213,6 +219,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -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") EXTERNALPROJECT_ADD (ZLIB @@ -230,6 +237,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -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 "TGZ") EXTERNALPROJECT_ADD (ZLIB @@ -247,6 +255,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -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} ) endif () externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 4694387..147ae2f 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -280,7 +280,7 @@ macro (HDF_README_PROPERTIES target_fortran) endif () elseif (APPLE) set (BINARY_EXAMPLE_ENDING "tar.gz") - set (BINARY_INSTALL_ENDING "dmg") + set (BINARY_INSTALL_ENDING "sh") # if packaging changes - use dmg set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") else () @@ -358,6 +358,21 @@ macro (HDF_DIR_PATHS package_prefix) endif () endif () + set (CMAKE_SKIP_BUILD_RPATH FALSE) + set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + set (CMAKE_BUILD_WITH_INSTALL_RPATH ON) + if (APPLE) + set (CMAKE_INSTALL_NAME_DIR "@rpath") + set (CMAKE_INSTALL_RPATH + "@executable_path/../${${package_prefix}_INSTALL_LIB_DIR}" + "@executable_path/" + "@loader_path/../${${package_prefix}_INSTALL_LIB_DIR}" + "@loader_path/" + ) + else () + set (CMAKE_INSTALL_RPATH "\$ORIGIN/../${${package_prefix}_INSTALL_LIB_DIR}:\$ORIGIN/") + endif () + if (DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) endif () |