Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c31369e
added root include to duneanaobj/SR/CMLists
LiamOS Aug 27, 2024
383f6e2
changed root include dirs to path
LiamOS Aug 27, 2024
59c79f9
added cetbuildtools dep to CMakeLists.txt
LiamOS Aug 27, 2024
771ff5f
removed cet_cmake_config from CMLists
LiamOS Aug 27, 2024
735fdab
removed extra / from proxy genproxy command
LiamOS Aug 27, 2024
a5c7771
included top directory for SRProxy
LiamOS Aug 27, 2024
449ed37
included build dir for SRProxy include to work
LiamOS Aug 27, 2024
ec6a059
included build dir for FlatRecord include to work
LiamOS Aug 27, 2024
17cd034
fixed install directory maybe?
LiamOS Aug 27, 2024
f529e98
actually install the headers maybe? useful...
LiamOS Aug 27, 2024
2276336
actually install the headers maybe? useful...2
LiamOS Aug 27, 2024
a5af180
actually install the headers maybe? useful...3
LiamOS Aug 27, 2024
ad68160
actually install the headers maybe? useful...4
LiamOS Aug 27, 2024
059787d
actually install the headers maybe? useful...5
LiamOS Aug 27, 2024
da0b42f
actually install the headers maybe? useful...6
LiamOS Aug 27, 2024
5b4b6d8
actually install the headers maybe? useful...7
LiamOS Aug 27, 2024
98eaa8f
actually install the headers maybe? useful...8
LiamOS Aug 27, 2024
0bcc233
actually install the headers maybe? useful...9
LiamOS Aug 27, 2024
2a21ab8
installs libraries and headies now? inshallah
LiamOS Aug 27, 2024
1b30f8f
fixing library building?
LiamOS Aug 27, 2024
6628101
installing more flat and proxy libs
LiamOS Aug 27, 2024
1e81b4e
installing dict
LiamOS Aug 27, 2024
654c309
no idea how to build a dictionary tbh
LiamOS Aug 27, 2024
97d4fd9
Fixed Flat include install path
LiamOS Aug 27, 2024
51b5f22
adding config writing so find_package can find this package
LiamOS Aug 27, 2024
a881e42
adding version info that makes config writer happy
LiamOS Aug 27, 2024
027f985
copied PackageConfig.cmake.in from edep-sim
LiamOS Aug 27, 2024
1485f9c
Actually install the config files
LiamOS Aug 27, 2024
2b6d013
missing 'Config' includes
LiamOS Aug 27, 2024
08a26d0
Install duneanaobjTargets.cmake file for pkgconfig/find_package
LiamOS Aug 28, 2024
8df2a47
corrected targets export
LiamOS Aug 28, 2024
3468933
Removed copy/pasted EDepSim references
LiamOS Aug 28, 2024
6e39801
Merge branch 'main' into minimal-edit-spack-build
LiamOS Aug 29, 2024
7353f5a
unfudged the indentation for the sanity of reviewers
LiamOS Aug 29, 2024
9a85c1e
unfudged the indentation for the sanity of reviewers
LiamOS Aug 29, 2024
937a3a7
unfudged the indentation for the sanity of reviewers
LiamOS Aug 29, 2024
1800c93
added inc and lib dirs to config file
LiamOS Sep 4, 2024
f7e78cd
added inc and lib dirs to config file
LiamOS Sep 4, 2024
3125f9b
added inc and lib dirs to config file
LiamOS Sep 4, 2024
ad87341
added inc and lib dirs to config file
LiamOS Sep 4, 2024
8ae9092
merged main
LiamOS Sep 12, 2024
e76063b
removed HEAD merge marker
LiamOS Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cmake_minimum_required (VERSION 3.20 FATAL_ERROR)
# cmake_policy(VERSION 3.18)

find_package(cetmodules REQUIRED)
project(duneanaobj LANGUAGES CXX)
project(duneanaobj VERSION 03.06.01 LANGUAGES CXX)
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 03.06.01)

message(STATUS "\n\n ========================== ${PROJECT_NAME} ==========================")
Expand All @@ -36,10 +36,10 @@ if(DEFINED ENV{UPS_DIR})
# Removing that qualifier, we need to supply that information manually,
# and maintain it too.
cet_set_compiler_flags(DIAGS CAUTIOUS
WERROR
NO_UNDEFINED
ALLOW_DEPRECATIONS
EXTRA_FLAGS -pedantic -Wno-unused-local-typedefs -Wno-undefined-var-template -I $ENV{CLANG_FQ_DIR}/include/c++/v1
WERROR
NO_UNDEFINED
ALLOW_DEPRECATIONS
EXTRA_FLAGS -pedantic -Wno-unused-local-typedefs -Wno-undefined-var-template -I $ENV{CLANG_FQ_DIR}/include/c++/v1
)

cet_report_compiler_flags()
Expand All @@ -51,12 +51,27 @@ if(DEFINED ENV{UPS_DIR})

# packaging utility


cet_cmake_config() # Put this here but am not sure... probably not going to see a lot of use anyway /shrug
else()
# This is where the real stuff happens, ain't nobody usin' this cet sit
find_package(ROOT)
include(BuildDictionary)
include_directories(.)

# Include module with function 'write_basic_package_version_file'
include(CMakePackageConfigHelpers)

# Write the ConfigVersion.cmake file which can be used to
# check if a version meets the requested properties.
write_basic_package_version_file(duneanaobjConfigVersion.cmake COMPATIBILITY SameMajorVersion)

# Write the Config.cmake file so that a user package can
# access this with find_package.
configure_package_config_file(PackageConfig.cmake.in duneanaobjConfig.cmake PATH_VARS CMAKE_INSTALL_PREFIX INSTALL_DESTINATION lib/cmake/duneanaobj)

# Install the config files.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/duneanaobjConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/duneanaobjConfigVersion.cmake DESTINATION lib/cmake/duneanaobj)
install(EXPORT duneanaobjTargets NAMESPACE duneanaobj:: DESTINATION lib/cmake/duneanaobj)# INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

add_subdirectory(duneanaobj)

cet_cmake_config()
45 changes: 45 additions & 0 deletions PackageConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
##########################
# Scaldily nicked from edep-sim by Liam, sound lad Clark
#
# A template for a <package>Config.cmake that can be found by using
# the find_package macro. This should be modified to import all of
# the dependencies required by the local package. The template is
# fairly generic, except for the "find_package" related code between
# the beginning and ending boiler plate.
#
# This expect that any targets that are being exported will be
# installed using a command like
#
# install(TARGETS myTarget
# EXPORT <project>Targets
# etc)
#
# Note that the <project> is set in the project(<name> <version>) macro
# that should be at the start of your top level CMakeLists.txt
##########################

############# BOILER PLATE
# Include the cmake boiler plate. The next line should not be touched
@PACKAGE_INIT@
############# END BOILER PLATE

##########################
# Add any specific packages that the current package depends on. This is
# where the find_package commands needed to make the current package
# compile should be listed.
##########################

find_package(ROOT REQUIRED)
if(ROOT_FOUND)
include(${ROOT_USE_FILE})
endif(ROOT_FOUND)

#########################
# Leave the next couple of lines alone since it will automatically customize
# for your package.
#########################

############# BOILER PLATE
include("@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/@PROJECT_NAME@Targets.cmake")
check_required_components("@PROJECT_NAME@")
############# END BOILER PLATE
19 changes: 13 additions & 6 deletions duneanaobj/StandardRecord/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ add_subdirectory(Proxy)
add_subdirectory(Flat)

# for classes_def.xml!!
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} "$ENV{ROOT_INCLUDE_PATH}")

set( PACKAGE duneanaobj_StandardRecord )
FILE( GLOB src_files *.cxx )
FILE( GLOB inc_files *.h )

# For this directory only, pedantic option to catch uninitialized SR fields
# add_compile_options(-Weffc++)
Expand All @@ -23,10 +24,16 @@ if(DEFINED CETMODULES_CURRENT_PROJECT_NAME)
install_headers()
install_source()
else()
add_library(duneanaobj_StandardRecord
${src_files})
target_link_libraries(duneanaobj_StandardRecord
ROOT::Core ROOT::Physics )
add_library(duneanaobj_StandardRecord SHARED ${src_files})
target_link_libraries(duneanaobj_StandardRecord PUBLIC ROOT::Core ROOT::Physics)

# n.b.: missing the dictionary and installation!
#ROOT_GENERATE_DICTIONARY(duneanaobj_StandardRecord_dict DICTIONARY_LIBRARIES duneanaobj_StandardRecord)
# TODO: Need to generate the dictionary

install(TARGETS duneanaobj_StandardRecord
EXPORT duneanaobjTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
INCLUDES DESTINATION ${CMAKE_INSTALL_PREFIX}/include/duneanaobj)
install(FILES ${inc_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/duneanaobj/StandardRecord)
endif()
13 changes: 7 additions & 6 deletions duneanaobj/StandardRecord/Flat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ add_custom_command(# Rebuild if anything in StandardRecord/ changes
DEPENDS ${SR_DEPENDENCIES}
OUTPUT FlatRecord.cxx FlatRecord.h FwdDeclare.h
COMMAND gen_srproxy --flat -i duneanaobj/StandardRecord/StandardRecord.h -o FlatRecord --target caf::StandardRecord --include-path ${PROJECT_SOURCE_DIR}:$ENV{ROOT_INC} --output-path duneanaobj/StandardRecord/Flat/ --prolog ${CMAKE_CURRENT_SOURCE_DIR}/Prolog.h --extra-cflags ' -D_Float16=short -fsized-deallocation'
)
)

include_directories($ENV{SRPROXY_INC})
include_directories($ENV{SRPROXY_INC} ${CMAKE_BINARY_DIR})

if(DEFINED CETMODULES_CURRENT_PROJECT_NAME)
cet_make_library(LIBRARY_NAME duneanaobj_StandardRecordFlat
SOURCE FlatRecord.cxx
LIBRARIES ${ROOT_BASIC_LIB_LIST} ROOT::TreePlayer
)
)

if (DEFINED ENV{MRB_BUILDDIR} AND NOT "$ENV{MRB_BUILDDIR}" STREQUAL "")
set(builddir $ENV{MRB_BUILDDIR}/duneanaobj)
Expand All @@ -21,11 +21,12 @@ if(DEFINED CETMODULES_CURRENT_PROJECT_NAME)
endif()
install_headers(EXTRAS ${builddir}/duneanaobj/StandardRecord/Flat/FlatRecord.h ${builddir}/duneanaobj/StandardRecord/Flat/FwdDeclare.h)
else()
add_library(duneanaobj_StandardRecordFlat
FlatRecord.cxx)
add_library(duneanaobj_StandardRecordFlat SHARED FlatRecord.cxx)
target_link_libraries(duneanaobj_StandardRecordFlat ${ROOT_BASIC_LIB_LIST} ROOT::TreePlayer)

install(TARGETS duneanaobj_StandardRecordFlat)
install(FILES ${CMAKE_BINARY_DIR}/duneanaobj/StandardRecord/Flat/FlatRecord.h ${CMAKE_BINARY_DIR}/duneanaobj/StandardRecord/Flat/FwdDeclare.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/duneanaobj)
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/duneanaobj/StandardRecord/Flat)
# DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/duneanaobj)

endif()
21 changes: 11 additions & 10 deletions duneanaobj/StandardRecord/Proxy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
FILE(GLOB SR_DEPENDENCIES duneanaobj/StandardRecord/*.h)

add_custom_command(# Rebuild if anything in StandardRecord/ changes
DEPENDS ${SR_DEPENDENCIES}
OUTPUT SRProxy.cxx SRProxy.h FwdDeclare.h
COMMAND gen_srproxy -i duneanaobj/StandardRecord/StandardRecord.h -o SRProxy --target caf::StandardRecord --include-path ${PROJECT_SOURCE_DIR}:$ENV{ROOT_INC} --output-path duneanaobj/StandardRecord/Proxy/ --prolog ${CMAKE_CURRENT_SOURCE_DIR}/Prolog.h --epilog-fwd ${CMAKE_CURRENT_SOURCE_DIR}/EpilogFwd.h --extra-cflags ' -D_Float16=short -fsized-deallocation'
)
DEPENDS ${SR_DEPENDENCIES}
OUTPUT SRProxy.cxx SRProxy.h FwdDeclare.h
COMMAND gen_srproxy -i duneanaobj/StandardRecord/StandardRecord.h -o SRProxy --target caf::StandardRecord --include-path ${PROJECT_SOURCE_DIR}:$ENV{ROOT_INC} --output-path duneanaobj/StandardRecord/Proxy --prolog ${CMAKE_CURRENT_SOURCE_DIR}/Prolog.h --epilog-fwd ${CMAKE_CURRENT_SOURCE_DIR}/EpilogFwd.h --extra-cflags ' -D_Float16=short -fsized-deallocation'
)

include_directories($ENV{SRPROXY_INC})
include_directories($ENV{SRPROXY_INC} ${CMAKE_BINARY_DIR})

# This is a very picky error buried inside template instantiations
#add_definitions(-Wno-int-in-bool-context)

if(DEFINED CETMODULES_CURRENT_PROJECT_NAME)
message(STATUS "CETMODULES_CURRENT_PROJECT_NAME = '${CETMODULES_CURRENT_PROJECT_NAME}'")
cet_make_library(LIBRARY_NAME duneanaobj_StandardRecordProxy
SOURCE SRProxy.cxx Instantiations.cxx
LIBRARIES ${ROOT_BASIC_LIB_LIST} ROOT::TreePlayer)
SOURCE SRProxy.cxx Instantiations.cxx
LIBRARIES ${ROOT_BASIC_LIB_LIST} ROOT::TreePlayer)

if (DEFINED ENV{MRB_BUILDDIR} AND NOT "$ENV{MRB_BUILDDIR}" STREQUAL "")
message(STATUS "MRB_BUILDDIR = $ENV{MRB_BUILDDIR}")
set(builddir $ENV{MRB_BUILDDIR}/duneanaobj)
else()
message(STATUS "BUILDDIR defaulting to ${CMAKE_BINARY_DIR}")
set(builddir ${CMAKE_BINARY_DIR})
endif()
install_headers(EXTRAS ${builddir}/duneanaobj/StandardRecord/Proxy/SRProxy.h ${builddir}/duneanaobj/StandardRecord/Proxy/FwdDeclare.h)
else()
add_library(duneanaobj_StandardRecordProxy
SRProxy.cxx Instantiations.cxx)
add_library(duneanaobj_StandardRecordProxy SHARED SRProxy.cxx Instantiations.cxx)
target_link_libraries(duneanaobj_StandardRecordProxy ${ROOT_BASIC_LIB_LIST} ROOT::TreePlayer)

install(TARGETS duneanaobj_StandardRecordProxy)
install(FILES ${CMAKE_BINARY_DIR}/duneanaobj/StandardRecord/Proxy/SRProxy.h ${CMAKE_BINARY_DIR}/duneanaobj/StandardRecord/Proxy/FwdDeclare.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/duneanaobj)
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/duneanaobj/StandardRecord/Proxy)
endif()