Fork me on GitHub

Changeset 9c2ce8b in git for CMakeLists.txt


Ignore:
Timestamp:
Feb 16, 2017, 10:07:44 PM (8 years ago)
Author:
Simon Spannagel <simon.spannagel@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
9a3d132
Parents:
84d3193
Message:

Make RPTAH setting optional, default is ON

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r84d3193 r9c2ce8b  
    66set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
    77
    8 # Set up the RPATH so executables find the libraries even when installed in non-default location
    9 SET(CMAKE_MACOSX_RPATH 1)
    10 SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
    11 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
    12 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
     8# Set the runtime path of the libraries by default but allow to switch it off:
     9option(SET_RPATH "Set runtime path of the ${project} libraries?" ON)
     10IF(SET_RPATH)
     11  # Set up the RPATH so executables find the libraries even when installed in non-default location
     12  SET(CMAKE_MACOSX_RPATH 1)
     13  SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
     14  SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
     15  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
    1316
    14 # Add the automatically determined parts of the RPATH which point to directories outside
    15 # the build tree to the install RPATH
    16 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
     17  # Add the automatically determined parts of the RPATH which point to directories outside
     18  # the build tree to the install RPATH
     19  SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
    1720
    18 # the RPATH to be used when installing, but only if it's not a system directory
    19 LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
    20 IF(${isSystemDir} EQUAL -1)
    21    SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
    22 ENDIF(${isSystemDir} EQUAL -1)
    23 
     21  # the RPATH to be used when installing, but only if it's not a system directory
     22  LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
     23  IF(${isSystemDir} EQUAL -1)
     24    SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
     25  ENDIF(${isSystemDir} EQUAL -1)
     26ENDIF(SET_RPATH)
     27   
    2428# Declare ROOT dependency
    2529find_package(ROOT COMPONENTS EG Eve Geom Gui GuiHtml GenVector Hist Physics Matrix Graf RIO Tree Gpad RGL MathCore)
Note: See TracChangeset for help on using the changeset viewer.