This is an old revision of the document!
ROOT のライブラリを CMake で見つける方法.
以下を CMakeLists.txt に追加する.
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
#set(ROOT_REQUIRED_COMPONENTS Minuit) # Minuit が必要な場合
#set(ROOT_REQUIRED_COMPONENTS Minuit Spectrum) # Minuit と Spectrum が必要な場合
find_package(ROOT 6.18 CONFIG REQUIRED ${ROOT_REQUIRED_COMPONENTS})
include(${ROOT_USE_FILE})
message(STATUS "Found ROOT: ${ROOT_INCLUDE_DIRS}")
message("-- Required ROOT components are: ${ROOT_REQUIRED_COMPONENTS}")
boost のライブラリを CMake で見つける方法.
以下を CMakeLists.txt に追加する.
set(Boost_USER_STATIC_LIBS OFF)
find_package(Boost 1.73 COMPONENTS system filesystem log regex) # 必要なものを追加
if (Boost_FOUND)
message(STATUS "Boost library -- found")
message(STATUS "BNoost library include dir : ${Boost_INCLUDE_DIRS}")
include_directories("${Boost_INCLUDE_DIRS}")
endif()
Geant4 のライブラリを CMake で見つける方法.
以下を CMakeLists.txt に追加する.
find_package(Geant4 REQUIRED)
#find_package(Geant4 REQUIRED COMPONENTS ui_tcsh) # GUI が必要な場合
include(${Geant4_USE_FILE})
message(STATUS "Found Geant4: ${Geant4_INCLUDE_DIRS}")