This repository has been archived by the owner on Dec 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·56 lines (41 loc) · 1.68 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
set(source_file 1DPlotting.cpp)
set(Project_name 1DPlotting)
project(${Project_name})
# Before launch Cmake, add the root environnement for CLion
# https://stackoverflow.com/questions/37662130/clion-or-cmake-does-not-see-environment-variable
#list(APPEND CMAKE_PREFIX_PATH /home/rtesse/Software/ROOT/root-buid/)
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
message(STATUS $ENV{ROOTSYS})
#----------------------------------------------------------------------------
# Find ROOT
#
find_package(ROOT)
if(ROOT_FOUND)
message("ROOT found")
include(${ROOT_USE_FILE})
else()
message("Error ROOT NOT FOUND")
endif()
#----------------------------------------------------------------------------
# Find GSL
#
find_package(GSL REQUIRED) # See below (2)
#-------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${ROOT_INCLUDE_DIRS})
link_directories(${ROOT_INCLUDE_DIRS})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cpp)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
add_executable(${Project_name} ${source_file} ${sources} ${headers})
target_link_libraries(${Project_name} ${ROOT_LIBRARIES} GSL::gsl GSL::gslcblas)
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS ${Project_name} DESTINATION bin)