Changeset 19285


Ignore:
Timestamp:
Oct 24, 2018, 4:37:54 PM (10 months ago)
Author:
tbretz
Message:
This should (hopefully) make compilation compatible with root version compiled with and without cmake.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/CMakeLists.txt

    r19278 r19285  
    235235SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIPSEL -DPROTOCOL=1 -Dunix -Dlinux")
    236236
    237 # --------- config.h -------------
    238 
    239 #CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/config.h")
    240 #INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
    241 
    242 SET(CMAKE_MODULE_PATH $ENV{ROOTSYS}/etc/cmake ${CMAKE_MODULE_PATH})
    243 
    244 # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
    245 #   - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
    246 #   - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
    247 #LIST(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
    248 
    249 #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
     237# --------- ROOT -------------
     238
     239#IF(EXISTS "$ENV{ROOTSYS}/ROOTConfig.cmake")
     240IF(DEFINED $ENV{CMAKE_PREFIX_PATH}) # -- This is supposed to be root 6 --
     241   # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
     242   #   - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
     243   #   - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
     244   LIST(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
     245   #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
     246   FIND_PACKAGE(ROOT REQUIRED COMPONENTS Gui Minuit ASImage HistPainter)
     247   #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
     248   INCLUDE(${ROOT_USE_FILE})
     249ELSE()
     250   # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
     251   #   - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
     252   #   - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
     253   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{ROOTSYS}/etc/cmake")
     254   #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
     255   FIND_PACKAGE(ROOT REQUIRED COMPONENTS GQt)
     256   # From RootUseFile.cmake (root 6)
     257   INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
     258   LINK_DIRECTORIES(${ROOT_LIBRARY_DIR})
     259   ADD_DEFINITIONS(${ROOT_DEFINITIONS})
     260   SET(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}")
     261   SET(CMAKE_C_FLAGS       "${CMAKE_C_FLAGS} ${ROOT_C_FLAGS}")
     262   SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}")
     263ENDIF()
    250264
    251265# -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree
    252266# -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread
    253267# -lASImage -lMinuit -lHistPainter -lThread
    254 
    255 FIND_PACKAGE(ROOT REQUIRED COMPONENTS GQt)
    256 INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
    257 
    258268
    259269#MESSAGE("INCL_DIRS: ${ROOT_INCLUDE_DIRS}")
     
    269279#ROOT_<option>_FOUND    BOOL    True for each enabled build option (e.g. cocoa, python, xrootd, etc.)
    270280
    271 #MESSAGE(${ROOT_LIBRARIES})
    272 
     281# function ROOT_GENERATE_DICTIONARY( dictionary
     282#                                    header1 header2 ...
     283#                                    LINKDEF linkdef1 ...
     284#                                    OPTIONS opt1...)
    273285
    274286# -------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.