cmake_modules/paths.cmake
changeset 9232 571e55b32da5
parent 9231 e704a6a5101a
child 9255 fd16cfa267aa
child 9276 91bd3f54fac1
equal deleted inserted replaced
9231:e704a6a5101a 9232:571e55b32da5
    55 # - the first is relative to the executable
    55 # - the first is relative to the executable
    56 # - the second is the same directory of the executable (so it runs in bin/)
    56 # - the second is the same directory of the executable (so it runs in bin/)
    57 # - the third one is the full path of the system dir
    57 # - the third one is the full path of the system dir
    58 #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html
    58 #source http://www.cmake.org/pipermail/cmake/2008-January/019290.html
    59 set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/")
    59 set(CMAKE_INSTALL_RPATH "$ORIGIN/../${target_library_install_dir}/:$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/")
    60 set(CMAKE_INSTALL_RPATH_ESCAPED "$$ORIGIN/../${target_library_install_dir}/:$$ORIGIN/:${CMAKE_INSTALL_PREFIX}/${target_library_install_dir}/")
       
    61 
    60 
    62 if(UNIX AND NOT APPLE)
    61 if(UNIX AND NOT APPLE)
    63     #make sure $ORIGIN is respected
    62     #make sure $ORIGIN is respected
    64     add_linker_flag("-zorigin")
    63     add_linker_flag("-zorigin")
    65     #apply RPATH settings to pascal and haskell executables
    64     #apply RPATH settings to pascal executables
    66     add_flag_append(CMAKE_Pascal_FLAGS "-k-rpath -k'${CMAKE_INSTALL_RPATH_ESCAPED}'")
    65     add_flag_append(CMAKE_Pascal_FLAGS "-k-rpath -k'${CMAKE_INSTALL_RPATH}'")
    67     list(APPEND haskell_flags "-optl" "-Wl,-rpath,'${CMAKE_INSTALL_RPATH_ESCAPED}'")
    66     #until we link with external things there is no need to set rpath on haskell
       
    67     #should you need it remember to escape $ with $$
       
    68     #list(APPEND haskell_flags "-optl" "-Wl,-rpath,'${CMAKE_INSTALL_RPATH_ESCAPED}'")
    68 endif()
    69 endif()
    69 
    70 
    70 #add the automatically determined parts of the RPATH
    71 #add the automatically determined parts of the RPATH
    71 #which point to directories outside the build tree to the install RPATH
    72 #which point to directories outside the build tree to the install RPATH
    72 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
    73 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)