Changeset 19756 for trunk/Mars


Ignore:
Timestamp:
10/11/19 09:33:21 (5 years ago)
Author:
tbretz
Message:
Some minor improvements to root detection output. If a root build directory is used, the pcm files are not at the right location -> create links.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/CMakeLists.txt

    r19715 r19756  
    129129
    130130#---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
     131#SET(ROOT_CONFIG_DEBUG 1)
    131132FIND_PACKAGE(ROOT REQUIRED COMPONENTS ${ROOT_PACKAGES})
    132133
    133134IF(NOT DEFINED ROOT_CONFIG_EXECUTABLE)
    134    FIND_PACKAGE_MESSAGE(RootFound "Found ROOT: ${ROOT_INCLUDE_DIRS} [${ROOT_VERSION}]" "[${ROOT_INCLUDE_DIRS}][${ROOT_LIBRARY_DIR}][${ROOT_VERSION}]")
     135   FIND_PACKAGE_MESSAGE(RootFound "Found ROOT: ${ROOT_INCLUDE_DIRS}" "[${ROOT_INCLUDE_DIRS}][${ROOT_LIBRARY_DIR}][${ROOT_VERSION}]")
    135136ENDIF()
    136137
    137138#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
     139FIND_PACKAGE_MESSAGE(RootInclude "Setup ROOT: [${ROOT_VERSION}] ${ROOT_USE_FILE}" "[${ROOT_VERSION}][${ROOT_USE_FILE}]")
    138140IF(DEFINED ROOT_USE_FILE)
    139    FIND_PACKAGE_MESSAGE(RootInclude "Setup ROOT: ${ROOT_USE_FILE}" "[${ROOT_USE_FILE}]")
    140141   INCLUDE(${ROOT_USE_FILE})
    141142ELSE()
    142    FIND_PACKAGE_MESSAGE(RootInclude "Setup ROOT: ${ROOT_VERSION}" "[${ROOT_VERSION}]")
    143143   # From RootUseFile.cmake (root 6)
    144144   INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
     
    149149   SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}")
    150150ENDIF()
     151
    151152
    152153# -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree
     
    240241
    241242        INSTALL(DIRECTORY ${subdir}/ DESTINATION "include" FILES_MATCHING PATTERN "*.h")
     243
     244        # This is a hack if somebody tries to run root from
     245        # the compile directory rather than from a package
     246        # install directory. In this case, the pcm files
     247        # are not where the library is where they should be
     248        ADD_CUSTOM_COMMAND(
     249            OUTPUT  lib/${_CINT}_rdict.pcm
     250            COMMAND ln -s ../dictionary/${_CINT}_rdict.pcm ${_CINT}_rdict.pcm
     251            WORKING_DIRECTORY lib
     252        VERBATIM)
     253        ADD_CUSTOM_TARGET(${_CINT}.p ALL DEPENDS lib/${_CINT}_rdict.pcm)
    242254
    243255ENDMACRO()
     
    309321SET_SOURCE_FILES_PROPERTIES(dictionary/Core.cxx PROPERTIES COMPILE_FLAGS "-Wno-deprecated-register")
    310322
     323# This is a hack if somebody tries to run root from
     324# the compile directory rather than from a package
     325# install directory. In this case, the pcm files
     326# are not where the library is where they should be
     327ADD_CUSTOM_COMMAND(
     328    OUTPUT  lib/Core_rdict.pcm
     329    COMMAND ln -s ../dictionary/Core_rdict.pcm Core_rdict.pcm
     330    WORKING_DIRECTORY lib
     331VERBATIM)
     332ADD_CUSTOM_TARGET(Core.p ALL DEPENDS lib/Core_rdict.pcm)
     333
     334
    311335TARGET_LINK_LIBRARIES(mars
    312336        ZLIB::ZLIB
Note: See TracChangeset for help on using the changeset viewer.