Skip to content

Conversation

@ottigeda
Copy link

It would be very helpful if we could build this library as a shared library (*.so).

Copy link

@lindblandro lindblandro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary if-else construct.

###
# executable
###
if (BUILD_SHARED_LIBS)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already a global CMake option that overrides the default behavior of add_library() if present.

set(BUILD_SHARED_LIBS ON)
add_library(${PROJECT} ${SOURCES})

will build a shared library. The SOVERSION property will need to be added for symlinks to be generated at install time, but the properties can be set even if BUILD_SHARED_LIBS is not set. A valid value for SOVERSION might be the same as VERSION or just PROJECT_VERSION_MAJOR

See https://cmake.org/cmake/help/v3.13/variable/BUILD_SHARED_LIBS.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants