2017-04-18 03:32:16 +08:00
|
|
|
#
|
|
|
|
# Copyright by The HDF Group.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This file is part of HDF5. The full HDF5 copyright notice, including
|
|
|
|
# terms governing use, modification, and redistribution, is contained in
|
|
|
|
# the COPYING file, which can be found at the root of the source code
|
|
|
|
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
|
|
|
# If you do not have access to either file, you may request a copy from
|
|
|
|
# help@hdfgroup.org.
|
|
|
|
#
|
2010-05-14 00:01:50 +08:00
|
|
|
#-------------------------------------------------------------------------------
|
2018-04-10 21:55:17 +08:00
|
|
|
macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage)
|
2014-03-12 05:14:57 +08:00
|
|
|
set (LIB_OUT_NAME "${libname}")
|
2016-03-01 05:07:27 +08:00
|
|
|
# SOVERSION passed in ARGN when shared
|
2014-03-12 05:14:57 +08:00
|
|
|
if (${libtype} MATCHES "SHARED")
|
2018-04-10 21:55:17 +08:00
|
|
|
set (PACKAGE_SOVERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION})
|
2014-03-12 05:14:57 +08:00
|
|
|
if (WIN32)
|
|
|
|
set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR})
|
2017-01-11 07:09:53 +08:00
|
|
|
else ()
|
2018-04-10 21:55:17 +08:00
|
|
|
set (LIBHDF_VERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION_MAJOR})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2018-05-17 00:25:07 +08:00
|
|
|
set_target_properties (${libtarget} PROPERTIES VERSION ${PACKAGE_SOVERSION})
|
2014-03-12 05:14:57 +08:00
|
|
|
if (WIN32)
|
2018-05-17 00:25:07 +08:00
|
|
|
set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${LIBHDF_VERSION}")
|
2017-01-11 07:09:53 +08:00
|
|
|
else ()
|
2018-05-17 00:25:07 +08:00
|
|
|
set_target_properties (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
|
|
|
endif ()
|
2011-05-25 22:57:16 +08:00
|
|
|
HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype})
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#-- Apple Specific install_name for libraries
|
2014-03-12 05:14:57 +08:00
|
|
|
if (APPLE)
|
|
|
|
option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF)
|
|
|
|
if (HDF5_BUILD_WITH_INSTALL_NAME)
|
2018-05-04 00:57:30 +08:00
|
|
|
set_property(TARGET ${libtarget} APPEND PROPERTY
|
2010-05-14 00:01:50 +08:00
|
|
|
LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}"
|
2018-05-03 23:44:57 +08:00
|
|
|
)
|
|
|
|
set_target_properties (${libtarget} PROPERTIES
|
2010-05-14 00:01:50 +08:00
|
|
|
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
|
|
|
BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME}
|
|
|
|
)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2015-07-10 00:56:16 +08:00
|
|
|
if (HDF5_BUILD_FRAMEWORKS)
|
|
|
|
if (${libtype} MATCHES "SHARED")
|
|
|
|
# adapt target to build frameworks instead of dylibs
|
|
|
|
set_target_properties(${libtarget} PROPERTIES
|
|
|
|
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
|
|
|
FRAMEWORK TRUE
|
|
|
|
FRAMEWORK_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}
|
|
|
|
MACOSX_FRAMEWORK_IDENTIFIER org.hdfgroup.${libtarget}
|
|
|
|
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${HDF5_PACKAGE_VERSION_MAJOR}
|
|
|
|
MACOSX_FRAMEWORK_BUNDLE_VERSION ${HDF5_PACKAGE_VERSION_MAJOR})
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
endif ()
|
2016-03-01 05:07:27 +08:00
|
|
|
|
2017-01-11 07:09:53 +08:00
|
|
|
endmacro ()
|