CMakeLists.txt 1.37 KB
Newer Older
1
2
3
4
5
6
7
8
9
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)

# see https://rix0r.nl/blog/2015/08/13/cmake-guide/
# Must use GNUInstallDirs to install libraries into correct
# locations on all platforms.
include(GNUInstallDirs)

find_package( DD4hep REQUIRED COMPONENTS DDCore DDG4 )

Whitney Armstrong's avatar
Whitney Armstrong committed
10
find_package(ROOT REQUIRED COMPONENTS Geom GenVector MathCore)
11
12
13
include(${ROOT_USE_FILE})


14
set(exe_name npdet_fields)
Whitney Armstrong's avatar
Whitney Armstrong committed
15
16
add_executable(${exe_name} src/${exe_name}.cxx)
target_include_directories(${exe_name} PUBLIC
17
  PRIVATE include )
Whitney Armstrong's avatar
Whitney Armstrong committed
18
target_compile_features(${exe_name}
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  PUBLIC cxx_auto_type
  PUBLIC cxx_trailing_return_types
  PRIVATE cxx_variadic_templates )
target_link_libraries(${exe_name} PUBLIC DDCore DDG4 ROOT::Core ROOT::Hist ROOT::GenVector ROOT::Gpad)
install(TARGETS ${exe_name}
  EXPORT NPDetTargets
  RUNTIME DESTINATION bin )


# npdet_to_step needs ROOT's GeoCad library
if(TARGET ROOT::GeoCad)
  set(exe_name npdet_to_step)
  add_executable(${exe_name} src/${exe_name}.cxx)
  target_include_directories(${exe_name} PUBLIC
    PRIVATE include )
  target_compile_features(${exe_name}
35
36
    PUBLIC cxx_auto_type
    PUBLIC cxx_trailing_return_types
37
    PRIVATE cxx_variadic_templates )
Whitney Armstrong's avatar
Whitney Armstrong committed
38
  target_link_libraries(${exe_name} PUBLIC DDCore DDG4 ROOT::Core ROOT::Hist ROOT::GenVector ROOT::Gpad ROOT::GeoCad)
39
  install(TARGETS ${exe_name}
40
    EXPORT NPDetTargets
41
42
    RUNTIME DESTINATION bin )
endif(TARGET ROOT::GeoCad)
43