Skip to content
Snippets Groups Projects
Commit a311db25 authored by marco's avatar marco
Browse files

added NO_RPATH option to executable

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1907 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 9ab0f289
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,8 @@ macro(parse_argument_list PREFIX ARG_NAMES OPT_NAMES)
set(_CURR_ARG_NAME "${_ARG}")
set(_CURR_ARG_LIST)
else()
list(FIND OPT_NAMES ${_ARG} _IS_OPT_NAME)
set(_LOPT_NAMES ${OPT_NAMES})
list(FIND _LOPT_NAMES ${_ARG} _IS_OPT_NAME)
if (_IS_OPT_NAME GREATER -1)
set(${PREFIX}_${_ARG} TRUE)
else()
......@@ -257,12 +258,12 @@ endmacro()
#-------------------------------------------------------------------------------
macro(executable)
parse_argument_list(_ARG
"NAME;SOURCES;LINK;DEPENDS_ON" "" ${ARGN})
"NAME;SOURCES;LINK;DEPENDS_ON" "NO_RPATH" ${ARGN})
if (NOT _ARG_NAME)
message(FATAL_ERROR "invalid use of executable(): a name must be provided")
endif()
add_executable(${_ARG_NAME} ${_ARG_SOURCES})
if (APPLE)
if (APPLE AND NOT _ARG_NO_RPATH)
set_target_properties(${_ARG_NAME} PROPERTIES
LINK_FLAGS "-Wl,-rpath,@loader_path/../lib")
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment