hdf5/config/cmake/HDF5Macros.cmake
Allen Byrne 9edd184ae9 [svn-r27846] Fix generated files process.
Add script for post processing of flex/bison files.
2015-09-21 15:05:23 -05:00

43 lines
1.9 KiB
CMake

#-------------------------------------------------------------------------------
macro (H5_SET_LIB_OPTIONS libtarget libname libtype)
set (LIB_OUT_NAME "${libname}")
if (${libtype} MATCHES "SHARED")
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)
set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${HDF5_PACKAGE_SOVERSION}")
else (WIN32)
set_target_properties (${libtarget} PROPERTIES SOVERSION ${HDF5_PACKAGE_SOVERSION})
endif (WIN32)
endif (${libtype} MATCHES "SHARED")
HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype})
#-- Apple Specific install_name for libraries
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)
set_target_properties (${libtarget} PROPERTIES
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}
)
endif (HDF5_BUILD_WITH_INSTALL_NAME)
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)
endif (APPLE)
endmacro (H5_SET_LIB_OPTIONS)