Skip to content

Commit

Permalink
RPATH handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Das committed Feb 22, 2022
1 parent 2ff70cd commit f4efef6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
20 changes: 4 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,10 @@ ELSE()
SET(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address -fsanitize=undefined")
ENDIF()

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

# 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")
endif("${isSystemDir}" STREQUAL "-1")
# Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "\$ORIGIN")


ENDIF()

Expand Down
5 changes: 5 additions & 0 deletions src/bare_etiss_processor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@

project(bare_etiss_processor)

SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")

add_executable(bare_etiss_processor main.cpp)
target_link_libraries(bare_etiss_processor ETISS)

# Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir)



set(ETISS_DIR ${CMAKE_INSTALL_PREFIX} )
configure_file(
run_helper.sh.in
Expand Down

0 comments on commit f4efef6

Please sign in to comment.