Skip to content
Snippets Groups Projects
Commit 7e1463f4 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

CMakeLists.txt: cxx standard and ActsDd4hep plugin

parent a1e25644
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,30 @@ project(NPDet ...@@ -7,7 +7,30 @@ project(NPDet
VERSION 1.2.0 VERSION 1.2.0
LANGUAGES CXX) LANGUAGES CXX)
# C++ standard
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "Set the C++ standard to be used")
if(NOT CMAKE_CXX_STANDARD MATCHES "17|20|23")
message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Build type
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type configuration" FORCE)
message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}")
endif()
# Error on all warnings
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
#FIXME not ready for this...
#add_compile_options(-Wall -Wextra -Werror -pedantic)
endif()
# Export compile commands as json for run-clang-tidy
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(BUILD_DATA_MODEL "build the dd4pod datamodel" ON) option(BUILD_DATA_MODEL "build the dd4pod datamodel" ON)
set(USE_GEOCAD ON CACHE BOOL "build the geocad library. Requires opencascade") set(USE_GEOCAD ON CACHE BOOL "build the geocad library. Requires opencascade")
......
...@@ -13,9 +13,15 @@ dd4hep_configure_output() ...@@ -13,9 +13,15 @@ dd4hep_configure_output()
#----------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------
#set(CMAKE_PREFIX_PATH $ENV{HOME}/lib CMAKE_PREFIX_PATH) find_package(DD4hep REQUIRED COMPONENTS DDCore DDG4)
#find_package(Acts REQUIRED COMPONENTS Core IdentificationPlugin TGeoPlugin DD4hepPlugin PATHS /home/whit/lib/cmake NO_DEFAULT_PATH) find_package(ActsDD4hep)
find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep ) if(ActsDD4hep_FOUND)
add_compile_definitions(USE_ACTSDD4HEP)
set(ActsDD4hep ActsDD4hep::ActsDD4hep)
else()
find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep)
set(ActsDD4hep ActsCore ActsPluginDD4hep)
endif()
add_subdirectory(pid/sdet) add_subdirectory(pid/sdet)
...@@ -63,16 +69,14 @@ dd4hep_add_plugin(GenDetectors ...@@ -63,16 +69,14 @@ dd4hep_add_plugin(GenDetectors
pid/src/HexagonalScintPreShower_geo.cpp pid/src/HexagonalScintPreShower_geo.cpp
pid/src/ThresholdGasCherenkov_geo.cpp pid/src/ThresholdGasCherenkov_geo.cpp
pid/src/HeavyGasCherenkov_geo.cpp pid/src/HeavyGasCherenkov_geo.cpp
USES DD4hep::DDCore DD4hep::DDG4 ActsCore ActsPluginDD4hep USES DD4hep::DDCore DD4hep::DDG4 ${ActsDD4hep}
NOINSTALL NOINSTALL
) )
target_link_libraries(GenDetectors target_link_libraries(GenDetectors
#PUBLIC DDG4_PIDsdet #PUBLIC DDG4_PIDsdet
PUBLIC DD4hep::DDCore DD4hep::DDRec DD4hep::DDG4 PUBLIC DD4hep::DDCore DD4hep::DDRec DD4hep::DDG4
PUBLIC ActsCore PUBLIC ${ActsDD4hep}
PUBLIC ActsPluginDD4hep
PUBLIC ActsPluginTGeo
) )
#target_include_directories(GenDetectors #target_include_directories(GenDetectors
# PUBLIC beamline/include # PUBLIC beamline/include
......
...@@ -4,7 +4,13 @@ ...@@ -4,7 +4,13 @@
#include "DDRec/Surface.h" #include "DDRec/Surface.h"
#include "DDRec/DetectorData.h" #include "DDRec/DetectorData.h"
#if defined(USE_ACTSDD4HEP)
#include "ActsDD4hep/ActsExtension.hpp"
#include "ActsDD4hep/ConvertMaterial.hpp"
#else
#include "Acts/Plugins/DD4hep/ActsExtension.hpp" #include "Acts/Plugins/DD4hep/ActsExtension.hpp"
#include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp"
#endif
using namespace std; using namespace std;
using namespace dd4hep; using namespace dd4hep;
......
...@@ -3,7 +3,14 @@ ...@@ -3,7 +3,14 @@
#include "TMath.h" #include "TMath.h"
#include "DDRec/Surface.h" #include "DDRec/Surface.h"
#include "DDRec/DetectorData.h" #include "DDRec/DetectorData.h"
#if defined(USE_ACTSDD4HEP)
#include "ActsDD4hep/ActsExtension.hpp"
#include "ActsDD4hep/ConvertMaterial.hpp"
#else
#include "Acts/Plugins/DD4hep/ActsExtension.hpp" #include "Acts/Plugins/DD4hep/ActsExtension.hpp"
#include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp"
#endif
using namespace std; using namespace std;
using namespace dd4hep; using namespace dd4hep;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment