# $Id: CMakeLists.txt 68058 2013-03-13 14:47:43Z gcosmo $ #---------------------------------------------------------------------------- # Setup the project cmake_minimum_required(VERSION 2.6 FATAL_ERROR) project(CALIOPE) SET(CMAKE_MODULE_PATH /opt/geant4.10.00/cmake/Modules/) #---------------------------------------------------------------------------- # Find ROOT Package find_package(ROOT) #---------------------------------------------------------------------------- # Setup ROOT include directories and compile definitions include(${CMAKE_MODULE_PATH}FindROOT.cmake) include_directories(${ROOT_INCLUDE_DIR}) link_directories(${ROOT_LIBRARY_DIR}) include_directories(/home/cbartram/root/include) #---------------------------------------------------------------------------- # Find Geant4 package, activating all available UI and Vis drivers by default # You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui # to build a batch mode only executable option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON) if(WITH_GEANT4_UIVIS) find_package(Geant4 REQUIRED ui_all vis_all) else() find_package(Geant4 REQUIRED) endif() #---------------------------------------------------------------------------- # Setup Geant4 include directories and compile definitions # Setup include directory for this project # include(${Geant4_USE_FILE}) include_directories(${PROJECT_SOURCE_DIR}/include) #---------------------------------------------------------------------------- EXECUTE_PROCESS(COMMAND rootcint -f /home/cbartram/geant4_workdir/dictionary/RootOutputDataCALIOPEDICT.cxx -c -I$(ROOTSYS)/include ${PROJECT_SOURCE_DIR}/include/RootOutputData.hh) #---------------------------------------------------------------------------- # Locate sources and headers for this project # NB: headers are included so they will show up in IDEs file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) include_directories(headers) #---------------------------------------------------------------------------- # Add the executable, and link it to the Geant4 libraries and ROOT # set(ROOTPWA_DICTIONARY /home/cbartram/geant4_workdir/dictionary/RootOutputDataCALIOPEDICT.cxx) # set dictionary path root_generate_dictionary( "${ROOTPWA_DICTIONARY}" # path to dictionary to generate "${CMAKE_CURRENT_SOURCE_DIR}/include;${ROOTSYS}/include" # list of includes "RootOutputData.hh" # list of classes to process ) link_directories(/home/cbartram/cry_v1.7/lib) link_directories(/home/cbartram/geant4_workdir/dictionary) include_directories(${ROOT_INCLUDE_DIR}) add_executable(CALIOPE CALIOPE.cc ${sources} ${headers}) target_link_libraries(CALIOPE ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} /home/cbartram/cry_v1.7/lib/libCRY.a ${ROOTPWA_DICTIONARY}) #---------------------------------------------------------------------------- # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX # install(TARGETS CALIOPE DESTINATION bin)