Skip to content

Commit 92ee5ee

Browse files
Add Cmake option to deactivate suffix of so files.
Force tests to link with the library in build directory.
1 parent 7086411 commit 92ee5ee

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ target_include_directories(${PROJECT_NAME}
170170
$<INSTALL_INTERFACE:include>
171171
)
172172
173-
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
173+
OPTION(SUFFIX_SO_VERSION
174+
"Suffix shared library name by a string depending on git status of project"
175+
ON)
176+
177+
IF (${SUFFIX_SO_VERSION} EQUAL "ON")
178+
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
179+
ENDIF ()
174180
175181
IF (UNIX)
176182
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CMAKE_DL_LIBS} pthread)

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33

44
ADD_DEFINITIONS(-DDEBUG=2)
5+
SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags)
56

67
# Add Boost path to include directories.
78
#INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})

0 commit comments

Comments
 (0)