Commit adac2c47 authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add dedicated function to add library with system link for program version

parent a93135b7
Pipeline #120012 passed with stages
in 1 minute and 45 seconds
...@@ -7,6 +7,7 @@ if(NOT MODULE_MODE) ...@@ -7,6 +7,7 @@ if(NOT MODULE_MODE)
include(create_doc.cmake) include(create_doc.cmake)
include(environnement_prefix.cmake) include(environnement_prefix.cmake)
include(create_find_project.cmake) include(create_find_project.cmake)
include(phoenix_add_library.cmake)
endif() endif()
......
# Add Shared library with suffix by respect to the program version set with the phoenix_base_project function
# targetName : name of the library target to be created
# ARGN : list of dependencies
function(phoenix_add_library targetName)
add_library(${targetName} SHARED ${ARGN})
string(REPLACE "." ";" PROGRAM_VERSION_LIST ${PROGRAM_VERSION})
list(GET PROGRAM_VERSION_LIST 0 PROGRAM_VERSION_SO)
set_target_properties(${targetName} PROPERTIES
VERSION "${PROGRAM_VERSION}"
SOVERSION "${PROGRAM_VERSION_SO}")
endfunction(phoenix_add_library)
file(GLOB phoenixNotify_SRC "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") file(GLOB phoenixNotify_SRC "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
add_library(phoenix_notify SHARED ${phoenixNotify_SRC}) phoenix_add_library(phoenix_notify ${phoenixNotify_SRC})
install(TARGETS phoenix_notify LIBRARY DESTINATION ${LIBRARY_DIRECTORY} ARCHIVE DESTINATION ${LIBRARY_DIRECTORY}) install(TARGETS phoenix_notify LIBRARY DESTINATION ${LIBRARY_DIRECTORY} ARCHIVE DESTINATION ${LIBRARY_DIRECTORY})
......
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