2010-05-14 00:01:50 +08:00
|
|
|
#-------------------------------------------------------------------------------
|
2015-02-13 05:52:48 +08:00
|
|
|
macro (H5_SET_LIB_OPTIONS libtarget libname libtype)
|
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")
|
2016-03-01 05:07:27 +08:00
|
|
|
if (ARGN)
|
|
|
|
set (PACKAGE_SOVERSION ${ARGN})
|
|
|
|
else (ARGN)
|
|
|
|
set (PACKAGE_SOVERSION ${HDF5_PACKAGE_SOVERSION})
|
|
|
|
endif (ARGN)
|
2014-03-12 05:14:57 +08:00
|
|
|
if (WIN32)
|
|
|
|
set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR})
|
|
|
|
else (WIN32)
|
|
|
|
set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION})
|
|
|
|
endif (WIN32)
|
|
|
|
set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION})
|
|
|
|
if (WIN32)
|
2016-03-01 05:07:27 +08:00
|
|
|
set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${PACKAGE_SOVERSION}")
|
2014-03-12 05:14:57 +08:00
|
|
|
else (WIN32)
|
2016-03-01 05:07:27 +08:00
|
|
|
set_target_properties (${libtarget} PROPERTIES SOVERSION ${PACKAGE_SOVERSION})
|
2014-03-12 05:14:57 +08:00
|
|
|
endif (WIN32)
|
|
|
|
endif (${libtype} MATCHES "SHARED")
|
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)
|
2014-06-17 03:26:18 +08:00
|
|
|
set_target_properties (${libtarget} PROPERTIES
|
2010-05-14 00:01:50 +08:00
|
|
|
LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}"
|
|
|
|
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
|
|
|
BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME}
|
|
|
|
)
|
2014-03-12 05:14:57 +08:00
|
|
|
endif (HDF5_BUILD_WITH_INSTALL_NAME)
|
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})
|
|
|
|
endif (${libtype} MATCHES "SHARED")
|
|
|
|
endif (HDF5_BUILD_FRAMEWORKS)
|
2014-03-12 05:14:57 +08:00
|
|
|
endif (APPLE)
|
2016-03-01 05:07:27 +08:00
|
|
|
|
2015-02-13 05:52:48 +08:00
|
|
|
endmacro (H5_SET_LIB_OPTIONS)
|