Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19251476
CMakeLists.txt
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
CMakeLists.txt
View Options
#----- list all test executables
file(GLOB executables_noroot RELATIVE ${PROJECT_SOURCE_DIR}/test *.cpp)
file(GLOB executables_root RELATIVE ${PROJECT_SOURCE_DIR}/test *.cxx)
file(GLOB executables_fortran RELATIVE ${PROJECT_SOURCE_DIR}/test *.f)
#----- include the utilitaries
add_subdirectory(utils)
set(tests "")
#----- build all tests and link them to the core library
foreach(exec_src ${executables_noroot})
string(REPLACE ".cpp" "" exec_bin ${exec_src})
add_executable(${exec_bin} ${exec_src})
set_target_properties(${exec_bin} PROPERTIES EXCLUDE_FROM_ALL true)
target_link_libraries(${exec_bin} ${CEPGEN_EXTERNAL_REQS} ${CEPGEN_LIBRARIES})
list(APPEND tests ${exec_bin})
endforeach()
foreach(exec_src ${executables_fortran})
string(REPLACE ".f" "" exec_bin ${exec_src})
add_executable(${exec_bin} ${exec_src})
set_target_properties(${exec_bin} PROPERTIES EXCLUDE_FROM_ALL true)
target_link_libraries(${exec_bin} ${CEPGEN_EXTERNAL_REQS} ${CEPGEN_LIBRARIES})
list(APPEND tests ${exec_bin})
endforeach()
#----- specify the tests requiring ROOT
find_package(ROOT)
if(ROOT_FOUND)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
else()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
endif()
include_directories(${ROOT_INCLUDE_DIRS})
link_directories(${ROOT_LIBRARY_DIR})
foreach(exec_src ${executables_root})
string(REPLACE ".cxx" "" exec_bin ${exec_src})
add_executable(${exec_bin} ${exec_src})
set_target_properties(${exec_bin} PROPERTIES EXCLUDE_FROM_ALL true)
target_link_libraries(${exec_bin} ${CEPGEN_EXTERNAL_REQS} ${CEPGEN_LIBRARIES} ${ROOT_LIBRARIES})
list(APPEND tests ${exec_bin})
endforeach()
else()
message(STATUS "ROOT not found! skipping these tests!")
endif()
message(STATUS "list of available tests: ${tests}")
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 30, 5:56 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6511419
Default Alt Text
CMakeLists.txt (1 KB)
Attached To
Mode
rCEPGEN CepGen - public repository
Attached
Detach File
Event Timeline
Log In to Comment