Refactoring CMake configs, adding Catch2 benchmark support
This commit is contained in:
@@ -9,31 +9,15 @@ set(THIRD_PARTY_DIR ${CMAKE_BINARY_DIR}/third_party)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
option(DAGGY_ENABLE_SLURM "add support for SLURM executor" ON)
|
||||
option(DAGGY_ENABLE_BENCHMARKS "Add catch2 benchmarks" ON)
|
||||
|
||||
include(cmake/rapidjson.cmake)
|
||||
include(cmake/pistache.cmake)
|
||||
include(cmake/better-enums.cmake)
|
||||
include(cmake/argparse.cmake)
|
||||
include(cmake/Catch2.cmake)
|
||||
|
||||
option(DAGGY_ENABLE_SLURM "add support for SLURM executor" ON)
|
||||
|
||||
if (DAGGY_ENABLE_SLURM)
|
||||
find_library(SLURM_LIB libslurm.so libslurm.a slurm REQUIRED)
|
||||
find_path(SLURM_INCLUDE_DIR "slurm/slurm.h" REQUIRED)
|
||||
|
||||
if (SLURM_LIB MATCHES ".*\.a")
|
||||
add_library(slurm STATIC IMPORTED)
|
||||
SET_TARGET_PROPERTIES(slurm PROPERTIES INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/")
|
||||
else ()
|
||||
add_library(slurm SHARED IMPORTED)
|
||||
endif ()
|
||||
|
||||
set_target_properties(slurm PROPERTIES IMPORTED_LOCATION ${SLURM_LIB})
|
||||
target_include_directories(slurm INTERFACE ${SLURM_INCLUDE_DIR})
|
||||
target_compile_definitions(slurm INTERFACE DAGGY_ENABLE_SLURM)
|
||||
target_link_libraries(slurm INTERFACE dl resolv)
|
||||
endif ()
|
||||
|
||||
include(cmake/daggy_features.cmake)
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
Reference in New Issue
Block a user