Skip to content

Commit

Permalink
Install the shared library libopenscap.so to $prefix/lib
Browse files Browse the repository at this point in the history
Make sure that the oscap tool links with the libopenscap.so
  • Loading branch information
jan-cerny committed Nov 14, 2017
1 parent 4168330 commit 19b1cc4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ endif()

add_library(openscap SHARED ${OBJECTS_TO_LINK_AGAINST})
set_target_properties(openscap PROPERTIES VERSION ${SONAME} SOVERSION ${SOVERSION})

install(TARGETS openscap
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
17 changes: 17 additions & 0 deletions utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
file(GLOB UTILS_SOURCES "*.c")

# see https://cmake.org/Wiki/CMake_RPATH_handling

# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)


add_executable(oscap ${UTILS_SOURCES})
target_link_libraries(oscap openscap ${XML2_LIBRARIES} ${XSLT_LIBRARIES} ${EXSLT_LIBRARIES} ${PCRE_LIBRARIES} ${CURL_LIBRARIES} ${RPM_LIBRARIES})

Expand Down

0 comments on commit 19b1cc4

Please sign in to comment.