diff options
author | Thomas White <taw@physics.org> | 2020-08-27 10:52:41 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-08-27 10:52:41 +0200 |
commit | 6520cb697a87413e8f3ee22d5f5817261f7bf3ab (patch) | |
tree | dc93d5f269856278445cda883ad12507645462cd /CMakeLists.txt | |
parent | beed39e09a3573380ee2cc0792b547c2f2d52852 (diff) |
Build system parts for SLURM library
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 222cb534..329e9677 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,11 @@ find_package(GSL REQUIRED) find_package(OpenCL) find_package(PkgConfig) +# Find SLURM +set(CMAKE_REQUIRED_LIBRARIES "-lslurm") +check_symbol_exists(slurm_api_version "slurm/slurm.h" HAVE_SLURM) +unset(CMAKE_REQUIRED_LIBRARIES) + # Request HDF5 1.10-style API (can't use 1.12-style yet) add_definitions(-DH5_USE_110_API) @@ -406,13 +411,20 @@ if (GTK_FOUND) set(CRYSTFEL_GUI_SOURCES src/crystfel_gui.c src/crystfelimageview.c src/gui_peaksearch.c src/gui_index.c src/gui_backend_local.c - src/gui_project.c src/crystfelindexingopts.c - src/gui_backend_slurm.c) + src/gui_project.c src/crystfelindexingopts.c) + + if (HAVE_SLURM) + set(CRYSTFEL_GUI_SOURCES ${CRYSTFEL_GUI_SOURCES} src/gui_backend_slurm.c) + endif (HAVE_SLURM) add_executable(crystfel ${CRYSTFEL_GUI_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/version.c) target_include_directories(crystfel PRIVATE ${COMMON_INCLUDES} ${GTK_INCLUDE_DIRS}) - target_link_libraries(crystfel ${COMMON_LIBRARIES} util ${GTK_LIBRARIES}) + target_link_libraries (crystfel ${COMMON_LIBRARIES} util ${GTK_LIBRARIES}) + + if (HAVE_SLURM) + target_link_libraries(crystfel slurm) + endif (HAVE_SLURM) list(APPEND CRYSTFEL_EXECUTABLES crystfel) |