Commit 9b9e7dfe authored by Andrew Burns's avatar Andrew Burns

Merge branch 'sonames' into 'master'

proper SOVERSION and VERSION setting on libraries

See merge request !28
parents 5f928d58 e8bbd57e
......@@ -16,6 +16,11 @@ include(CheckCXXSourceCompiles)
set(XDMF_LIBNAME "Xdmf" CACHE STRING "Name for this xdmf library to avoid collision")
set(XDMF_MAJOR_VERSION 3)
set(XDMF_MINOR_VERSION 0)
set(XDMF_PATCH_VERSION 0)
set(XDMF_VERSION "${XDMF_MAJOR_VERSION}.${XDMF_MINOR_VERSION}.${XDMF_PATCH_VERSION}")
if(BUILD_SHARED_LIBS)
set(LIBTYPE SHARED)
set(BUILD_SHARED 1)
......@@ -365,13 +370,20 @@ if(NOT XDMF_BUILD_CORE_ONLY)
if(XDMF_STATIC_AND_SHARED)
add_library(XdmfObjects OBJECT ${XdmfSources})
SET_TARGET_PROPERTIES(
XdmfObjects PROPERTIES
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
set_target_properties(XdmfObjects PROPERTIES
POSITION_INDEPENDENT_CODE True)
add_library(${XDMF_LIBNAME} $<TARGET_OBJECTS:XdmfObjects>)
if (BUILD_SHARED_LIBS)
add_library(Xdmf_Static STATIC $<TARGET_OBJECTS:XdmfObjects>)
set_target_properties(Xdmf_Static PROPERTIES
OUTPUT_NAME "Xdmf")
set_target_properties(
Xdmf_Static PROPERTIES
OUTPUT_NAME "Xdmf"
)
endif (BUILD_SHARED_LIBS)
else()
if (WIN32)
......@@ -384,6 +396,11 @@ if(NOT XDMF_BUILD_CORE_ONLY)
add_library(${XDMF_LIBNAME} ${LIBTYPE} ${XdmfSources})
endif ()
endif()
SET_TARGET_PROPERTIES(
${XDMF_LIBNAME} PROPERTIES
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
if(XDMF_BUILD_DSM)
if (NOT WIN32)
target_link_libraries(${XDMF_LIBNAME} XdmfCore XdmfDSM)
......
......@@ -10,7 +10,11 @@ include(TestBigEndian)
if(VERSION_CONTROL_AUTOUPDATE OR
NOT EXISTS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/XdmfVersion.hpp)
VersionCreate("Xdmf" "3" "3" "0" "XDMFCORE_EXPORT" "XdmfCore.hpp")
VersionCreate(
"Xdmf"
"${XDMF_MAJOR_VERSION}" "${XDMF_MINOR_VERSION}" "${XDMF_PATCH_VERSION}"
"XDMFCORE_EXPORT" "XdmfCore.hpp"
)
endif()
if(BUILD_SHARED_LIBS)
......@@ -236,17 +240,31 @@ endif()
if (XDMF_STATIC_AND_SHARED)
add_library(XdmfCoreObjects OBJECT ${XdmfCoreSources})
set_target_properties(XdmfCoreObjects PROPERTIES
POSITION_INDEPENDENT_CODE True)
SET_TARGET_PROPERTIES(
XdmfCoreObjects PROPERTIES
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
set_target_properties(
XdmfCoreObjects PROPERTIES
POSITION_INDEPENDENT_CODE True
)
add_library(XdmfCore ${LIBTYPE} $<TARGET_OBJECTS:XdmfCoreObjects>)
if (BUILD_SHARED_LIBS)
add_library(XdmfCore_Static STATIC $<TARGET_OBJECTS:XdmfCoreObjects>)
set_target_properties(XdmfCore_Static PROPERTIES
OUTPUT_NAME "XdmfCore")
set_target_properties(
XdmfCore_Static PROPERTIES
OUTPUT_NAME "XdmfCore"
)
endif (BUILD_SHARED_LIBS)
else()
add_library(XdmfCore ${LIBTYPE} ${XdmfCoreSources})
endif()
SET_TARGET_PROPERTIES(
XdmfCore PROPERTIES
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} PARENT_SCOPE)
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} PARENT_SCOPE)
......
......@@ -124,9 +124,19 @@ if (XDMF_DSM_IS_CRAY)
endif (XDMF_DSM_IS_CRAY)
add_library(XdmfDSMObjects OBJECT ${XdmfDSMSources})
SET_TARGET_PROPERTIES(
XdmfDSMObjects PROPERTIES
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
set_target_properties(XdmfDSMObjects PROPERTIES
POSITION_INDEPENDENT_CODE True)
add_library(XdmfDSM $<TARGET_OBJECTS:XdmfDSMObjects>)
SET_TARGET_PROPERTIES(
XdmfDSM PROPERTIES
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
if (BUILD_SHARED_LIBS)
add_library(XdmfDSM_Static STATIC $<TARGET_OBJECTS:XdmfDSMObjects>)
if (UNIX)
......
......@@ -94,6 +94,11 @@ endif(XDMF_BUILD_PARTITIONER)
if (XDMF_STATIC_AND_SHARED)
add_library(XdmfUtilsObjects OBJECT ${XdmfUtilsSources})
SET_TARGET_PROPERTIES(
XdmfUtilsObjects PROPERTIES
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
set_target_properties(XdmfUtilsObjects PROPERTIES
POSITION_INDEPENDENT_CODE True)
add_library(XdmfUtils $<TARGET_OBJECTS:XdmfUtilsObjects>)
......@@ -107,6 +112,11 @@ if (XDMF_STATIC_AND_SHARED)
else ()
add_library(XdmfUtils ${XdmfUtilsSources})
endif ()
SET_TARGET_PROPERTIES(
XdmfUtils PROPERTIES
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
target_link_libraries(XdmfUtils ${XdmfUtilsLinkLibraries})
if (BUILD_SHARED_LIBS)
......@@ -169,7 +179,7 @@ if(XDMF_BUILD_FORTRAN)
endif(XDMF_BUILD_FORTRAN)
install(FILES ${XdmfUtilsHeaders} DESTINATION include)
install(TARGETS XdmfUtils
install(TARGETS XdmfUtils
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
......@@ -179,7 +189,7 @@ install(TARGETS XdmfUtils_Static
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif (BUILD_SHARED_LIBS)
install(TARGETS ${XdmfUtilsExecutables}
install(TARGETS ${XdmfUtilsExecutables}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment