Unverified Commit 6a1dbb3a authored by Florent Lamiraux's avatar Florent Lamiraux Committed by GitHub

[CMake] Add Cmake option to deactivate suffix of so files. (#51)

* [CMake] Add Cmake option to deactivate suffix of so files.
Co-authored-by: Joseph Mirabel's avatarJoseph Mirabel <josephmirabel@gmail.com>
parent e93f334a
......@@ -21,6 +21,10 @@ INCLUDE(cmake/sphinx.cmake)
SET(PKG_CONFIG_ADDITIONAL_VARIABLES plugindir ${PKG_CONFIG_ADDITIONAL_VARIABLES})
OPTION(SUFFIX_SO_VERSION
"Suffix shared library name by a string depending on git status of project"
ON)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
......
......@@ -27,7 +27,10 @@ IF(UNIX)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CMAKE_DL_LIBS})
ENDIF(UNIX)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
IF (SUFFIX_SO_VERSION)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF ()
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dynamic-graph::dynamic-graph)
INSTALL(TARGETS ${LIBRARY_NAME}
......
......@@ -30,10 +30,13 @@ ADD_CUSTOM_COMMAND(TARGET interpreter-test-runfile POST_BUILD
SET(LIBRARY_NAME "custom_entity")
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${LIBRARY_NAME}.cpp)
IF (SUFFIX_SO_VERSION)
SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF ()
SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PROPERTIES
PREFIX ""
SOVERSION ${PROJECT_VERSION}
INSTALL_RPATH ${DYNAMIC_GRAPH_PLUGINDIR})
target_link_libraries(${LIBRARY_NAME} dynamic-graph::dynamic-graph)
......
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