diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d2db1d..ef4e1c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.6) +cmake_minimum_required (VERSION 2.8.10) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- @@ -274,10 +274,10 @@ SET (H5_ENABLE_SHARED_LIB NO) SET (H5_ENABLE_STATIC_LIB NO) IF (BUILD_SHARED_LIBS) SET (LIB_TYPE SHARED) - ADD_DEFINITIONS (-DH5_BUILT_AS_DYNAMIC_LIB) + SET (H5_BUILT_AS_DYNAMIC_LIB 1) SET (H5_ENABLE_SHARED_LIB YES) ELSE (BUILD_SHARED_LIBS) - ADD_DEFINITIONS (-DH5_BUILT_AS_STATIC_LIB) + SET (H5_BUILT_AS_STATIC_LIB 1) SET (H5_ENABLE_STATIC_LIB YES) IF (NOT WIN32) # should this be a user setting : Everyone uses it anyway ? @@ -666,7 +666,7 @@ IF (WIN32 AND NOT CYGWIN) IF (HDF5_ENABLE_THREADSAFE) # check for unsupported options IF (HDF5_ENABLE_PARALLEL) - MESSAGE (FATAL " **** Parallel and Threadsafe options are mutually exclusive **** ") + MESSAGE (FATAL_ERROR " **** Parallel and Threadsafe options are mutually exclusive **** ") ENDIF (HDF5_ENABLE_PARALLEL) SET (H5_HAVE_THREADSAFE 1) IF (H5_HAVE_IOEO) @@ -675,7 +675,7 @@ IF (WIN32 AND NOT CYGWIN) ELSE (H5_HAVE_IOEO) IF (NOT H5_HAVE_PTHREAD_H) SET (H5_HAVE_THREADSAFE 0) - MESSAGE (FATAL " **** Threadsafe option requires thread library **** ") + MESSAGE (FATAL_ERROR " **** Threadsafe option requires thread library **** ") ENDIF (NOT H5_HAVE_PTHREAD_H) ENDIF (H5_HAVE_IOEO) ENDIF (HDF5_ENABLE_THREADSAFE) @@ -757,8 +757,16 @@ SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") IF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) IF (HDF5_BUILD_FORTRAN) + IF (BUILD_SHARED_LIBS AND APPLE) + MESSAGE (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ") + ENDIF (BUILD_SHARED_LIBS AND APPLE) OPTION (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) INCLUDE (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) + IF (HDF5_ENABLE_F2003) + IF (NOT FORTRAN_HAVE_ISO_C_BINDING) + SET (HDF5_ENABLE_F2003 OFF) + ENDIF (NOT FORTRAN_HAVE_ISO_C_BINDING) + ENDIF (HDF5_ENABLE_F2003) # ----------------------------------------------------------------------- # wrapper script variables @@ -793,7 +801,7 @@ IF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") IF (HDF5_BUILD_CPP_LIB) # check for unsupported options IF (HDF5_ENABLE_PARALLEL) - MESSAGE (FATAL " **** Parallel and C++ options are mutually exclusive **** ") + MESSAGE (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") ENDIF (HDF5_ENABLE_PARALLEL) IF (CMAKE_NO_STD_NAMESPACE) SET (H5_NO_STD 1) @@ -994,7 +1002,6 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_PACKAGE_VENDOR "HDF_Group") SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${HDF5_PACKAGE_NAME}") - SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${HDF5_PACKAGE_NAME}-${HDF5_PACKAGE_VERSION}-${LIB_TYPE}") SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") @@ -1007,10 +1014,15 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_PACKAGE_RELOCATABLE TRUE) IF (WIN32) + SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${HDF5_PACKAGE_NAME}-${HDF5_PACKAGE_VERSION}-${LIB_TYPE}") SET (CPACK_MONOLITHIC_INSTALL ON) SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") SET (CPACK_NSIS_MODIFY_PATH ON) SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${HDF5_PACKAGE_VERSION}") + ELSEIF (APPLE) + SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + SET (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}") + SET (CPACK_PACKAGING_INSTALL_PREFIX "/") ELSE (WIN32) SET (CPACK_PACKAGING_INSTALL_PREFIX "/usr") SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) |