Skip to content

Commit

Permalink
Cetmodules migration
Browse files Browse the repository at this point in the history
  • Loading branch information
gartung committed Feb 22, 2024
1 parent d2a2027 commit 1e1a160
Show file tree
Hide file tree
Showing 9 changed files with 703 additions and 250 deletions.
35 changes: 17 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# ======================================================================


cmake_minimum_required (VERSION 3.19 FATAL_ERROR)
cmake_minimum_required (VERSION 3.20 FATAL_ERROR) ### MIGRATE-CHANGED (migrate-3.22.02) - VERSION 3.19 -> 3.20
# cmake_policy(VERSION 3.19) ### MIGRATE-ACTION-COMPATIBILITY (migrate-3.22.02) - Uncomment to preserve compatibility with older CMake versions

find_package(cetmodules REQUIRED) ### MIGRATE-ADDED (migrate-3.22.02) - find_package(cetmodules) must precede project()
project(dunecalib LANGUAGES CXX)
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 09.82.02d01)

# cetbuildtools contains our cmake modules
find_package(cetbuildtools REQUIRED)

list(APPEND CMAKE_MODULE_PATH $ENV{CANVAS_ROOT_IO_DIR}/Modules)
list(APPEND CMAKE_MODULE_PATH $ENV{ART_DIR}/Modules)
list(APPEND CMAKE_MODULE_PATH $ENV{CANVAS_ROOT_IO_DIR}/Modules) ### MIGRATE-ACTION-RECOMMENDED (migrate-3.22.02) - prefer find_package() to find external CMake modules
list(APPEND CMAKE_MODULE_PATH $ENV{ART_DIR}/Modules) ### MIGRATE-ACTION-RECOMMENDED (migrate-3.22.02) - prefer find_package() to find external CMake modules


include(CetCMakeEnv)
Expand All @@ -24,26 +25,24 @@ cet_set_compiler_flags(DIAGS CAUTIOUS
EXTRA_FLAGS -pedantic -Wno-unused-local-typedefs
)

cet_report_compiler_flags()
cet_report_compiler_flags() ### MIGRATE-ACTION-RECOMMENDED (migrate-3.22.02) - add args: REPORT_THRESHOLD VERBOSE

find_ups_product( art )
find_ups_product( art_root_io )
find_ups_product( canvas_root_io )
find_ups_boost( )
find_ups_root()
find_ups_product( cetbuildtools )
find_ups_product( larcore )
find_ups_product( larcorealg )
find_ups_product( nuevdb )
find_ups_product( libwda )
find_ups_geant4( )
find_package( art REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(art ...) -> find_package(art REQUIRED ...)
find_package( art_root_io REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(art_root_io ...) -> find_package(art_root_io REQUIRED ...)
find_package( canvas_root_io REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(canvas_root_io ...) -> find_package(canvas_root_io REQUIRED ...)
find_package( Boost REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(...) -> find_package(REQUIRED ...)
find_package(ROOT REQUIRED) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(...) -> find_package(REQUIRED ...)
find_package( larcore REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(larcore ...) -> find_package(larcore REQUIRED ...)
find_package( larcorealg REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(larcorealg ...) -> find_package(larcorealg REQUIRED ...)
find_package( nuevdb REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(nuevdb ...) -> find_package(nuevdb REQUIRED ...)
find_package( libwda REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(libwda ...) -> find_package(libwda REQUIRED ...)
find_package( Geant4 REQUIRED ) ### MIGRATE-CHANGED (migrate-3.22.02) - find_ups_product(...) -> find_package(REQUIRED ...)

# macros for artdaq_dictionary and simple_plugin
include(ArtDictionary)
include(ArtMake)
include(BuildPlugins)

add_subdirectory(dunecalib)
add_subdirectory(ups)

include(UseCPack)
cet_cmake_config() ### MIGRATE-ADDED (migrate-3.22.02) - required cmd
112 changes: 112 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"configurePresets" : [
{
"cacheVariables" : {
"CMAKE_BUILD_TYPE" : {
"type" : "STRING",
"value" : "RelWithDebInfo"
},
"CMAKE_CXX_EXTENSIONS" : {
"type" : "BOOL",
"value" : "OFF"
},
"CMAKE_CXX_STANDARD_REQUIRED" : {
"type" : "BOOL",
"value" : "ON"
}
},
"description" : "Configuration settings translated from ups/product_deps",
"displayName" : "Configuration from product_deps",
"hidden" : true,
"name" : "from_product_deps"
},
{
"cacheVariables" : {
"CMAKE_CXX_COMPILER" : {
"type" : "STRING",
"value" : "$env{CETPKG_CXX_COMPILER}"
},
"CMAKE_CXX_STANDARD" : {
"type" : "STRING",
"value" : "$env{CETPKG_CXX_STANDARD}"
},
"CMAKE_C_COMPILER" : {
"type" : "STRING",
"value" : "$env{CETPKG_C_COMPILER}"
},
"CMAKE_Fortran_COMPILER" : {
"type" : "STRING",
"value" : "$env{CETPKG_Fortran_COMPILER}"
},
"UPS_CXX_COMPILER_ID" : {
"type" : "STRING",
"value" : "$env{CETPKG_CXX_COMPILER_ID}"
},
"UPS_CXX_COMPILER_VERSION" : {
"type" : "STRING",
"value" : "$env{CETPKG_CXX_COMPILER_VERSION}"
},
"UPS_C_COMPILER_ID" : {
"type" : "STRING",
"value" : "$env{CETPKG_C_COMPILER_ID}"
},
"UPS_C_COMPILER_VERSION" : {
"type" : "STRING",
"value" : "$env{CETPKG_C_COMPILER_VERSION}"
},
"UPS_Fortran_COMPILER_ID" : {
"type" : "STRING",
"value" : "$env{CETPKG_Fortran_COMPILER_ID}"
},
"UPS_Fortran_COMPILER_VERSION" : {
"type" : "STRING",
"value" : "$env{CETPKG_Fortran_COMPILER_VERSION}"
},
"WANT_UPS" : {
"type" : "BOOL",
"value" : true
},
"dunecalib_EXEC_PREFIX_INIT" : {
"type" : "STRING",
"value" : "$env{CETPKG_FQ_DIR}"
},
"dunecalib_UPS_BUILD_ONLY_DEPENDENCIES_INIT" : {
"type" : "STRING",
"value" : "cetmodules"
},
"dunecalib_UPS_PRODUCT_FLAVOR_INIT" : {
"type" : "STRING",
"value" : "$env{CETPKG_FLAVOR}"
},
"dunecalib_UPS_PRODUCT_NAME_INIT" : {
"type" : "STRING",
"value" : "dunecalib"
},
"dunecalib_UPS_QUALIFIER_STRING_INIT" : {
"type" : "STRING",
"value" : "$env{CETPKG_QUALSPEC}"
}
},
"description" : "Extra configuration for UPS package generation",
"displayName" : "UPS extra configuration",
"hidden" : true,
"name" : "extra_for_UPS"
},
{
"description" : "Default configuration including settings from ups/product_deps",
"displayName" : "Default configuration",
"inherits" : "from_product_deps",
"name" : "default"
},
{
"description" : "Default configuration for UPS package generation",
"displayName" : "Default configuration for UPS",
"inherits" : [
"default",
"extra_for_UPS"
],
"name" : "for_UPS"
}
],
"version" : 3
}
10 changes: 5 additions & 5 deletions dunecalib/Calib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ art_make_library( LIBRARY_NAME dunecalib::Calib
cetlib_except::cetlib_except
messagefacility::MF_MessageLogger
fhiclcpp::fhiclcpp
ROOT_BASIC_LIB_LIST
ROOT::Core ROOT::Hist

)

art_make_exec( NAME getXYZCalibProtoDUNE
cet_make_exec( NAME getXYZCalibProtoDUNE
SOURCE getXYZCalibProtoDUNE.cc
LIBRARIES
dunecalib::Calib
)
) ### MIGRATE-CHANGED (migrate-3.22.02) - art_make_exec() -> cet_make_exec()

art_make_exec( NAME getLinConstsProtoDUNE
cet_make_exec( NAME getLinConstsProtoDUNE
SOURCE getLinConstsProtoDUNE.cc
LIBRARIES
dunecalib::Calib
)
) ### MIGRATE-CHANGED (migrate-3.22.02) - art_make_exec() -> cet_make_exec()

install_headers()
install_fhicl()
Expand Down
2 changes: 0 additions & 2 deletions dunecalib/CalibServices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ cet_build_plugin(XYZCalibServiceProtoDUNE art::service
messagefacility::MF_MessageLogger
cetlib::cetlib
cetlib_except::cetlib_except
ROOT_BASIC_LIB_LIST

)

Expand All @@ -34,7 +33,6 @@ cet_build_plugin(LifetimeCalibServiceProtoDUNE art::service
canvas::canvas
cetlib::cetlib
cetlib_except::cetlib_except
ROOT_BASIC_LIB_LIST

)

Expand Down
6 changes: 0 additions & 6 deletions ups/CMakeLists.txt

This file was deleted.

12 changes: 0 additions & 12 deletions ups/product-config.cmake.in

This file was deleted.

Loading

0 comments on commit 1e1a160

Please sign in to comment.