Skip to content

Commit

Permalink
Merge pull request #5 from yangacer/master
Browse files Browse the repository at this point in the history
Fix missing rpath.
  • Loading branch information
rnovacek committed Jun 27, 2014
2 parents aca6c7f + d101695 commit 4e66715
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions cmake/modules/rpath.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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${LIB_SUFFIX}")

# 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)

# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
ENDIF("${isSystemDir}" STREQUAL "-1")
2 changes: 1 addition & 1 deletion src/konkret/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(konkret_SRCS
kstr.c
print.c
)

include(rpath)
include_directories(${CMPI_INCLUDE_DIR})

add_library(libkonkret SHARED ${konkret_SRCS})
Expand Down
2 changes: 1 addition & 1 deletion src/program/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

include (rpath)
include_directories(${CMPI_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src)

add_executable(konkret main.cpp)
Expand Down

0 comments on commit 4e66715

Please sign in to comment.