Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 38 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,25 @@ endif()
include(cmake/settings.cmake)
include(cmake/doxygen.cmake)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")


message(STATUS "*** Build Type: " ${CMAKE_BUILD_TYPE})
message(STATUS "*** Compiler Flags: " ${DEFAULT_COMPILE_FLAGS})
message(STATUS "*** Install libs to: " ${LIBRARY_OUTPUT_PATH})
message(STATUS "*** Install bin to: " ${EXECUTABLE_OUTPUT_PATH})

message(STATUS "${CMAKE_MODULE_PATH}")

find_package(APLCONpp REQUIRED)
include_directories(${APLCONpp_INCLUDE_DIR})


# require a fairly recent ROOT version
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(ROOT "5.30" REQUIRED)


# since all subprojects need ROOT, set that up here
include_directories(${ROOT_INCLUDES} ${CMAKE_SOURCE_DIR}/inc)
link_directories(${ROOT_LIBRARY_DIR})
Expand Down Expand Up @@ -48,6 +58,9 @@ else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")


set(GOAT_BASE
inc/GTree.h
inc/GTreeTrack.h
Expand Down Expand Up @@ -103,6 +116,11 @@ set(GOAT_GHIST
src/GHistTaggerBinning2.cc
)






if( PLUTO )

find_package(Pluto)
Expand Down Expand Up @@ -153,16 +171,16 @@ add_executable(pi0-example
src/pi0_example_main.cc
)
target_link_libraries(pi0-example goatbase ghist ${LIBS} ${ROOT_LIBRARIES})

add_executable(ProtEff
inc/PPhysics.h
src/PPhysics.cc
inc/PProtEff.h
src/PProtEff.cc
src/ProtEff_main.cc
)
target_link_libraries(ProtEff goatbase ghist ${LIBS} ${ROOT_LIBRARIES})

#target_link_libraries(pi0-example ${LIBS} ${ROOT_LIBRARIES} ${APLCONpp_LIBRARIES} )
#add_executable(ProtEff
# inc/PPhysics.h
# src/PPhysics.cc
# inc/PProtEff.h
# src/PProtEff.cc
# src/ProtEff_main.cc
# )
#target_link_libraries(ProtEff goatbase ghist ${LIBS} ${ROOT_LIBRARIES})
#target_link_libraries(pi0-example ${LIBS} ${ROOT_LIBRARIES} ${APLCONpp_LIBRARIES} )
add_executable(Scalers
inc/PPhysics.h
src/PPhysics.cc
Expand Down Expand Up @@ -199,6 +217,16 @@ add_executable(CBESum
)
target_link_libraries(CBESum goatbase ghist ${LIBS} ${ROOT_LIBRARIES})

#add_executable(PN-pp-recoil
# inc/PPhysics.h
# src/PPhysics.cc
# inc/PN_pp_recoil.h
# src/PN_pp_recoil.cc
# src/PN_pp_recoil_main.cc
# )
#target_link_libraries(PN-pp-recoil ${LIBS} ${ROOT_LIBRARIES} ${APLCONpp_LIBRARIES})


# install some scripts to the bin directory
# by creating symlinks
file(GLOB CORE_EXTRA_SCRIPTS "scripts/*")
Expand Down
32 changes: 32 additions & 0 deletions cmake/Modules/FindAPLCON.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# - Try to find APLCONpp
# Once done this will define
# APLCONpp_FOUND - System has APLCONpp
# APLCONpp_INCLUDE_DIRS - The APLCONpp include directories
# APLCONpp_LIBRARIES - The libraries needed to use APLCONpp

set(APLCON_SEARCH_PATHS
$ENV{APLCONSYS}
${CMAKE_SOURCE_DIR}/../APLCONpp)

find_path(APLCONpp_INCLUDE_DIR APLCON.hpp
PATHS ${APLCON_SEARCH_PATHS}
PATH_SUFFIXES src
NO_DEFAULT_PATH
)

find_library(APLCONpp_LIBRARY NAMES aplcon++
PATHS ${APLCON_SEARCH_PATHS}
PATH_SUFFIXES build
NO_DEFAULT_PATH
)

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set APLCONpp_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(APLCONpp DEFAULT_MSG
APLCONpp_LIBRARY APLCONpp_INCLUDE_DIR)

mark_as_advanced(APLCONpp_INCLUDE_DIR APLCONpp_LIBRARY)

set(APLCONpp_LIBRARIES ${APLCONpp_LIBRARY} )
set(APLCONpp_INCLUDE_DIRS ${APLCONpp_INCLUDE_DIR} )
32 changes: 32 additions & 0 deletions cmake/Modules/FindAPLCONpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# - Try to find APLCONpp
# Once done this will define
# APLCONpp_FOUND - System has APLCONpp
# APLCONpp_INCLUDE_DIRS - The APLCONpp include directories
# APLCONpp_LIBRARIES - The libraries needed to use APLCONpp

set(APLCON_SEARCH_PATHS
$ENV{APLCONSYS}
${CMAKE_SOURCE_DIR}/../APLCONpp)

find_path(APLCONpp_INCLUDE_DIR APLCON.hpp
PATHS ${APLCON_SEARCH_PATHS}
PATH_SUFFIXES src
NO_DEFAULT_PATH
)

find_library(APLCONpp_LIBRARY NAMES aplcon++
PATHS ${APLCON_SEARCH_PATHS}
PATH_SUFFIXES build
NO_DEFAULT_PATH
)

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set APLCONpp_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(APLCONpp DEFAULT_MSG
APLCONpp_LIBRARY APLCONpp_INCLUDE_DIR)

mark_as_advanced(APLCONpp_INCLUDE_DIR APLCONpp_LIBRARY)

set(APLCONpp_LIBRARIES ${APLCONpp_LIBRARY} )
set(APLCONpp_INCLUDE_DIRS ${APLCONpp_INCLUDE_DIR} )
Loading