diff options
author | Thomas White <taw@physics.org> | 2023-02-22 11:53:04 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-05-02 10:51:36 +0200 |
commit | 1995ba5ada88e3c1949eaf245c5e8e60dff5a3cc (patch) | |
tree | c10f317c260df73f43da650f2faf76629f561d52 | |
parent | 15e72336f9763bfa2dce4d9aa0f8dcb518b51ac1 (diff) |
Remove CMake build files
It's already far behind parity with Meson, and getting worse.
-rw-r--r-- | CMake/GetGitRevisionDescription.cmake | 168 | ||||
-rw-r--r-- | CMake/GetGitRevisionDescription.cmake.in | 41 | ||||
-rw-r--r-- | CMake/LICENSE_1_0.txt | 25 | ||||
-rw-r--r-- | CMakeLists.txt | 433 | ||||
-rw-r--r-- | INSTALL.md | 13 | ||||
-rw-r--r-- | config.h.cmake.in | 10 | ||||
-rw-r--r-- | doc/articles/speed.rst | 2 | ||||
-rw-r--r-- | libcrystfel/CMakeLists.txt | 176 | ||||
-rw-r--r-- | libcrystfel/crystfel.pc.in | 11 | ||||
-rw-r--r-- | libcrystfel/doc/coding.md | 2 | ||||
-rw-r--r-- | libcrystfel/libcrystfel-config.h.cmake.in | 19 | ||||
-rw-r--r-- | libcrystfel/src/libcrystfel-version.c.cmake.in | 4 | ||||
-rw-r--r-- | src/version.c.cmake.in | 13 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 190 |
14 files changed, 2 insertions, 1105 deletions
diff --git a/CMake/GetGitRevisionDescription.cmake b/CMake/GetGitRevisionDescription.cmake deleted file mode 100644 index 8ab03bc5..00000000 --- a/CMake/GetGitRevisionDescription.cmake +++ /dev/null @@ -1,168 +0,0 @@ -# - Returns a version string from Git -# -# These functions force a re-configure on each git commit so that you can -# trust the values of the variables in your build system. -# -# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...]) -# -# Returns the refspec and sha hash of the current head revision -# -# git_describe(<var> [<additional arguments to git describe> ...]) -# -# Returns the results of git describe on the source tree, and adjusting -# the output so that it tests false if an error occurs. -# -# git_get_exact_tag(<var> [<additional arguments to git describe> ...]) -# -# Returns the results of git describe --exact-match on the source tree, -# and adjusting the output so that it tests false if there was no exact -# matching tag. -# -# git_local_changes(<var>) -# -# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes. -# Uses the return code of "git diff-index --quiet HEAD --". -# Does not regard untracked files. -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__get_git_revision_description) - return() -endif() -set(__get_git_revision_description YES) - -# We must run the following at "include" time, not at function call time, -# to find the path to this module rather than the path to a calling list file -get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) - -function(get_git_head_revision _refspecvar _hashvar) - set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories - set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") - get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) - if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) - # We have reached the root directory, we are not in git - set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - return() - endif() - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - endwhile() - # check if this is a submodule - if(NOT IS_DIRECTORY ${GIT_DIR}) - file(READ ${GIT_DIR} submodule) - string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) - get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) - get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) - endif() - set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") - if(NOT EXISTS "${GIT_DATA}") - file(MAKE_DIRECTORY "${GIT_DATA}") - endif() - - if(NOT EXISTS "${GIT_DIR}/HEAD") - return() - endif() - set(HEAD_FILE "${GIT_DATA}/HEAD") - configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) - - configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" - "${GIT_DATA}/grabRef.cmake" - @ONLY) - include("${GIT_DATA}/grabRef.cmake") - - set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) - set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) -endfunction() - -function(git_describe _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() - - # TODO sanitize - #if((${ARGN}" MATCHES "&&") OR - # (ARGN MATCHES "||") OR - # (ARGN MATCHES "\\;")) - # message("Please report the following error to the project!") - # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") - #endif() - - #message(STATUS "Arguments to execute_process: ${ARGN}") - - execute_process(COMMAND - "${GIT_EXECUTABLE}" - describe - ${hash} - ${ARGN} - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT res EQUAL 0) - set(out "${out}-${res}-NOTFOUND") - endif() - - set(${_var} "${out}" PARENT_SCOPE) -endfunction() - -function(git_get_exact_tag _var) - git_describe(out --exact-match ${ARGN}) - set(${_var} "${out}" PARENT_SCOPE) -endfunction() - -function(git_local_changes _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() - - execute_process(COMMAND - "${GIT_EXECUTABLE}" - diff-index --quiet HEAD -- - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(res EQUAL 0) - set(${_var} "CLEAN" PARENT_SCOPE) - else() - set(${_var} "DIRTY" PARENT_SCOPE) - endif() -endfunction() diff --git a/CMake/GetGitRevisionDescription.cmake.in b/CMake/GetGitRevisionDescription.cmake.in deleted file mode 100644 index 6d8b708e..00000000 --- a/CMake/GetGitRevisionDescription.cmake.in +++ /dev/null @@ -1,41 +0,0 @@ -# -# Internal file for GetGitRevisionDescription.cmake -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(HEAD_HASH) - -file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) - -string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) -if(HEAD_CONTENTS MATCHES "ref") - # named branch - string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") - if(EXISTS "@GIT_DIR@/${HEAD_REF}") - configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - else() - configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) - file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) - if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") - set(HEAD_HASH "${CMAKE_MATCH_1}") - endif() - endif() -else() - # detached HEAD - configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) -endif() - -if(NOT HEAD_HASH) - file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) - string(STRIP "${HEAD_HASH}" HEAD_HASH) -endif() diff --git a/CMake/LICENSE_1_0.txt b/CMake/LICENSE_1_0.txt deleted file mode 100644 index 93f82505..00000000 --- a/CMake/LICENSE_1_0.txt +++ /dev/null @@ -1,25 +0,0 @@ -This license applies to GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in. - -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 97494b93..00000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,433 +0,0 @@ -cmake_minimum_required(VERSION 3.6) -set(CRYSTFEL_SHORT_VERSION 0.10.2) -set(CRYSTFEL_VERSION ${CRYSTFEL_SHORT_VERSION}) -set(CRYSTFEL_API_VERSION 16) -project(crystfel VERSION ${CRYSTFEL_VERSION} LANGUAGES C) - -cmake_policy(SET CMP0074 NEW) - -include(GNUInstallDirs) - -# Set CMAKE_MODULE_PATH to assist cmake in finding our own package definitions -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake") - -find_package(HDF5 REQUIRED COMPONENTS C HL) -find_package(Threads REQUIRED) -find_package(GSL REQUIRED) -find_package(OpenCL) -find_package(PkgConfig) - -# Request HDF5 1.10-style API (can't use 1.12-style yet) -add_definitions(-DH5_USE_110_API) -add_definitions(-DH5O_GET_INFO_BY_IDX1) - -pkg_check_modules (GLIB glib-2.0) -include_directories (${GLIB_INCLUDE_DIRS}) -link_directories (${GLIB_LIBRARY_DIRS}) - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") - -pkg_search_module(ZMQ libzmq) -if (ZMQ_FOUND) - message(STATUS "Found ZMQ") -else () - message(STATUS "ZMQ not found.") -endif () - -pkg_search_module(ASAPO libasapo-consumer) -if (ASAPO_FOUND) - message(STATUS "Found ASAP::O") -else () - message(STATUS "ASAP::O not found") -endif () - -# Find out where forkpty() is declared -set(CMAKE_REQUIRED_LIBRARIES "-lutil") -check_symbol_exists(forkpty "pty.h" HAVE_FORKPTY_PTY_H) -check_symbol_exists(forkpty "util.h" HAVE_FORKPTY_UTIL_H) -unset(CMAKE_REQUIRED_LIBRARIES) -if(HAVE_FORKPTY_PTY_H) - message(STATUS "Found forkpty() in pty.h") -elseif(HAVE_FORKPTY_UTIL_H) - message(STATUS "Found forkpty() in util.h") -else() - message(SEND_ERROR "Couldn't find forkpty()") -endif() - -pkg_search_module(GTK gtk+-3.0) -if (GTK_FOUND) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations") - link_directories(${GTK_LIBRARY_DIRS}) - - - find_program(GLIB_COMPILE_RESOURCES NAMES glib-compile-resources REQUIRED) - - add_custom_command(OUTPUT crystfel-gresources.c - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data - VERBATIM - COMMAND ${GLIB_COMPILE_RESOURCES} - ARGS --generate-source - --target=${CMAKE_CURRENT_BINARY_DIR}/crystfel-gresources.c - crystfel.gresource.xml) - - add_custom_target(crystfel-gresources - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/crystfel-gresources.c) - -else() - message(STATUS "GTK3 not found. GUI parts will not be compiled") -endif () - -pkg_search_module(CAIRO cairo) - -include(CheckCCompilerFlag) -check_c_compiler_flag("-fdiagnostics-color=always" HAVE_DIAG_COLOR) -if (HAVE_DIAG_COLOR) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always") -endif (HAVE_DIAG_COLOR) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions(-DHAVE_CONFIG_H) -set(CMAKE_C_STANDARD 99) - -# Common include directories and libraries - -set(COMMON_INCLUDES ${HDF5_INCLUDE_DIRS}) -set(COMMON_LIBRARIES libcrystfel m GSL::gsl Threads::Threads) - -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) - # If this is a Git checkout, add the revision ID - message(STATUS "This is a Git checkout: adding revision ID to version number") - include(GetGitRevisionDescription) - get_git_head_revision(GIT_REFSPEC GIT_SHA1) - string(SUBSTRING ${GIT_SHA1} 0 8 GIT_SHA1) - set(CRYSTFEL_VERSION "${CRYSTFEL_VERSION}+${GIT_SHA1}") -else () - if (DEFINED CRYSTFEL_SNAPSHOT_ID) - message(STATUS "This is a packaged snapshot: adding snapshot ID to version number") - set(CRYSTFEL_VERSION ${CRYSTFEL_VERSION}+${CRYSTFEL_SNAPSHOT_ID}) - else () - message(STATUS "This is a packaged release version") - endif () -endif () -configure_file(src/version.c.cmake.in version.c) - -include(CheckIncludeFile) -include(CheckLibraryExists) - -set(HAVE_CAIRO ${CAIRO_FOUND}) -set(HAVE_GTK ${GTK_FOUND}) -set(HAVE_OPENCL ${OpenCL_FOUND}) -set(HAVE_ZMQ ${ZMQ_FOUND}) -set(HAVE_HDF5 1) -set(HAVE_ASAPO ${ASAPO_FOUND}) - -set(PACKAGE_VERSION ${PROJECT_VERSION}) - -check_include_file(fcntl.h HAVE_FCNTL_H) -check_include_file(stdlib.h HAVE_STDLIB_H) -check_include_file(unistd.h HAVE_UNISTD_H) - -# Workarounds for weird OpenCL quirks.. -if (OpenCL_FOUND) - - # If include path ends with "OpenCL.framework", add the missing "/Headers" - string(REGEX REPLACE "OpenCL.framework$" "OpenCL.framework/Headers" - OpenCL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) - - # Check if the header is actually "CL/cl.h" - check_include_file(CL/cl.h HAVE_CL_CL_H "-I${OpenCL_INCLUDE_DIRS}") - -endif (OpenCL_FOUND) - -# Check for nice clock function -check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME) - -# Check for argp -check_symbol_exists(argp_parse "argp.h" HAVE_ARGP) -if (NOT HAVE_ARGP) - message(ERROR " argp not found. If you're building on Mac OS using libraries" - " from Homebrew, install argp-standalone.") -endif (NOT HAVE_ARGP) - -# Add the libcrystfel target -add_subdirectory(libcrystfel) - -configure_file(config.h.cmake.in config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -# Add tests -enable_testing() -add_subdirectory(tests) - -# Install scripts -install(DIRECTORY ${CMAKE_SOURCE_DIR}/scripts - DESTINATION ${CMAKE_INSTALL_DOCDIR}) - -install(FILES ${CMAKE_SOURCE_DIR}/scripts/detector-shift - ${CMAKE_SOURCE_DIR}/scripts/peakogram-stream - DESTINATION ${CMAKE_INSTALL_BINDIR}) - -# Misc resources -install(FILES ${CMAKE_SOURCE_DIR}/data/crystfel.svg - DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) - -# ---------------------------------------------------------------------- -# partial_sim - -set(PARTIAL_SIM_SOURCES src/partial_sim.c) -add_executable(partial_sim ${PARTIAL_SIM_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(partial_sim PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(partial_sim ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES partial_sim) - -# ---------------------------------------------------------------------- -# pattern_sim - -set(PATTERN_SIM_SOURCES src/pattern_sim.c src/diffraction.c) - -if(HAVE_OPENCL) - set(PATTERN_SIM_OPENCL_SOURCES src/cl-utils.c src/diffraction-gpu.c) -endif(HAVE_OPENCL) - -add_executable(pattern_sim ${PATTERN_SIM_SOURCES} ${PATTERN_SIM_OPENCL_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(pattern_sim PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(pattern_sim ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) - -if(HAVE_OPENCL) - target_include_directories(pattern_sim PRIVATE ${OpenCL_INCLUDE_DIRS}) - target_link_libraries(pattern_sim ${OpenCL_LIBRARIES}) -endif(HAVE_OPENCL) - -list(APPEND CRYSTFEL_EXECUTABLES pattern_sim) - -# ---------------------------------------------------------------------- -# cell_explorer - -if (GTK_FOUND) - - set(CELL_EXPLORER_SOURCES src/cell_explorer.c src/multihistogram.c) - - add_executable(cell_explorer ${CELL_EXPLORER_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) - target_include_directories(cell_explorer PRIVATE ${COMMON_INCLUDES} ${GTK_INCLUDE_DIRS}) - target_link_libraries(cell_explorer ${COMMON_LIBRARIES} ${GTK_LIBRARIES}) - - list(APPEND CRYSTFEL_EXECUTABLES cell_explorer) - -endif (GTK_FOUND) - -# ---------------------------------------------------------------------- -# render_hkl - -if (CAIRO_FOUND) - - set(RENDER_HKL_SOURCES src/render_hkl.c) - add_executable(render_hkl ${RENDER_HKL_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) - - target_include_directories(render_hkl PRIVATE ${COMMON_INCLUDES} ${CAIRO_INCLUDE_DIRS}) - target_link_libraries(render_hkl ${COMMON_LIBRARIES} ${CAIRO_LIBRARIES}) - - list(APPEND CRYSTFEL_EXECUTABLES render_hkl) - -endif (CAIRO_FOUND) - -# ---------------------------------------------------------------------- -# process_hkl - -set(PROCESS_HKL_SOURCES src/process_hkl.c) -add_executable(process_hkl ${PROCESS_HKL_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(process_hkl PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(process_hkl ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES process_hkl) - -# ---------------------------------------------------------------------- -# list_events - -set(LIST_EVENTS_SOURCES src/list_events.c) -add_executable(list_events ${LIST_EVENTS_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(list_events PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(list_events ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES list_events) - -# ---------------------------------------------------------------------- -# indexamajig - -set(INDEXAMAJIG_SOURCES src/indexamajig.c src/im-sandbox.c src/process_image.c) - -if ( ZMQ_FOUND ) - list(APPEND INDEXAMAJIG_SOURCES src/im-zmq.c) -endif () - -if ( ASAPO_FOUND ) - list(APPEND INDEXAMAJIG_SOURCES src/im-asapo.c) -endif () - -add_executable(indexamajig ${INDEXAMAJIG_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(indexamajig PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(indexamajig ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES indexamajig) - -if ( ZMQ_FOUND ) - target_include_directories(indexamajig PRIVATE ${ZMQ_INCLUDE_DIR}) - target_link_libraries(indexamajig ${ZMQ_LDFLAGS}) -endif () - -if ( ASAPO_FOUND ) - target_include_directories(indexamajig PRIVATE ${ASAPO_INCLUDE_DIR}) - target_link_libraries(indexamajig ${ASAPO_LDFLAGS}) -endif () - - -# ---------------------------------------------------------------------- -# get_hkl - -set(GET_HKL_SOURCES src/get_hkl.c) -add_executable(get_hkl ${GET_HKL_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(get_hkl PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(get_hkl ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES get_hkl) - -# ---------------------------------------------------------------------- -# compare_hkl - -set(COMPARE_HKL_SOURCES src/compare_hkl.c) -add_executable(compare_hkl ${COMPARE_HKL_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(compare_hkl PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(compare_hkl ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES compare_hkl) - -# ---------------------------------------------------------------------- -# check_hkl - -set(CHECK_HKL_SOURCES src/check_hkl.c) -add_executable(check_hkl ${CHECK_HKL_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(check_hkl PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(check_hkl ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES check_hkl) - -# ---------------------------------------------------------------------- -# partialator - -set(PARTIALATOR_SOURCES src/partialator.c src/post-refinement.c src/merge.c - src/rejection.c src/scaling.c) -add_executable(partialator ${PARTIALATOR_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(partialator PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(partialator ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES partialator) - -# ---------------------------------------------------------------------- -# ambigator - -set(AMBIGATOR_SOURCES src/ambigator.c) -add_executable(ambigator ${AMBIGATOR_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(ambigator PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(ambigator ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES ambigator) - -# ---------------------------------------------------------------------- -# whirligig - -set(WHIRLIGIG_SOURCES src/whirligig.c) -add_executable(whirligig ${WHIRLIGIG_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(whirligig PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(whirligig ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES whirligig) - -# ---------------------------------------------------------------------- -# make_pixelmap - -set(MAKE_PIXELMAP_SOURCES src/make_pixelmap.c) -add_executable(make_pixelmap ${MAKE_PIXELMAP_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(make_pixelmap PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(make_pixelmap ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES make_pixelmap) - -# ---------------------------------------------------------------------- -# cell_tool - -set(CELL_TOOL_SOURCES src/cell_tool.c) -add_executable(cell_tool ${CELL_TOOL_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c) -target_include_directories(cell_tool PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(cell_tool ${COMMON_LIBRARIES}) -list(APPEND CRYSTFEL_EXECUTABLES cell_tool) - -# ---------------------------------------------------------------------- -# crystfel (main graphical user interface) - -if (GTK_FOUND) - - set(CRYSTFEL_GUI_SOURCES src/crystfel_gui.c src/crystfelimageview.c - src/gui_peaksearch.c src/gui_index.c src/gui_merge.c src/gui_backend_local.c - src/gui_project.c src/crystfelindexingopts.c src/crystfelmergeopts.c - src/crystfelsymmetryselector.c src/gtk-util-routines.c src/gui_fom.c - src/gui_export.c src/gui_ambi.c src/gui_import.c - src/gtkmultifilechooserbutton.c src/gui_backend_slurm.c - src/crystfelcolourscale.c src/crystfelfomgraph.c) - - add_executable(crystfel ${CRYSTFEL_GUI_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/version.c - ${CMAKE_CURRENT_BINARY_DIR}/crystfel-gresources.c) - target_include_directories(crystfel PRIVATE ${COMMON_INCLUDES} ${GTK_INCLUDE_DIRS}) - target_link_libraries (crystfel ${COMMON_LIBRARIES} util ${GTK_LIBRARIES}) - - list(APPEND CRYSTFEL_EXECUTABLES crystfel) - -endif (GTK_FOUND) - -# ---------------------------------------------------------------------- -# Install targets - -set_target_properties(${CRYSTFEL_EXECUTABLES} - PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1) - -list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_LIBDIR}" isSystemDir) -if("${isSystemDir}" STREQUAL "-1") - set_target_properties(${CRYSTFEL_EXECUTABLES} - PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR};${CMAKE_INSTALL_RPATH}") -endif("${isSystemDir}" STREQUAL "-1") - -install(TARGETS ${CRYSTFEL_EXECUTABLES} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -install(FILES - doc/man/ambigator.1 - doc/man/cell_explorer.1 - doc/man/check_hkl.1 - doc/man/compare_hkl.1 - doc/man/get_hkl.1 - doc/man/indexamajig.1 - doc/man/list_events.1 - doc/man/partialator.1 - doc/man/partial_sim.1 - doc/man/pattern_sim.1 - doc/man/process_hkl.1 - doc/man/render_hkl.1 - doc/man/whirligig.1 - doc/man/make_pixelmap.1 - doc/man/cell_tool.1 - DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 -) - -install(FILES - doc/man/crystfel.7 - DESTINATION ${CMAKE_INSTALL_MANDIR}/man7 -) - -install(FILES - doc/man/crystfel_geometry.5 - DESTINATION ${CMAKE_INSTALL_MANDIR}/man5 -) @@ -76,11 +76,6 @@ There are very few mandatory dependencies for CrystFEL. They are: * [Bison](https://www.gnu.org/software/bison/) 2.6 or later * [Flex](https://www.gnu.org/software/flex/) -[CMake](https://cmake.org/) 3.12 or later can be used in place of Meson, -but Meson is strongly preferred. CrystFEL's CMake-based build system is -considered deprecated and will be removed at some point in the future. It -already lacks several features compared to the Meson-based system. - The following dependencies are "optional", in the sense that you can install CrystFEL without them. However, a CrystFEL installation without these will lack important features such as the graphical user interface. The following list is @@ -171,7 +166,6 @@ as follows, replacing the `meson build` step: ``` meson build -Dhdf5=disabled ``` -When building with CMake, HDF5 is a mandatory dependency. Using OpenCL for GPU acceleration --------------------------------- @@ -427,7 +421,7 @@ Installation problems and solutions flags in `CFLAGS`. One such flag is `-D_BSD_SOURCE`, which changes the prototypes of certain system calls including `getpgrp`, breaking CrystFEL. - **Solution**: Three options: + **Solution**: Two options: Option 1: Do not use your distribution's HDF5 package. Instead, compile HDF5 yourself. If you compile HDF5 with autotools (`./configure` et al.), @@ -440,11 +434,6 @@ Installation problems and solutions HDF5 will install a `pkg-config` file which Meson will use in preference to `h5cc`. - Option 3: Compile CrystFEL using CMake instead of Meson. CMake extracts - the include paths from the `h5cc` output and ignores the others. However, - note that CrystFEL's CMake build process is deprecated and will eventually be - removed. - * **Problem**: Linker error about missing HDF5 symbols: ``` diff --git a/config.h.cmake.in b/config.h.cmake.in deleted file mode 100644 index b4a45384..00000000 --- a/config.h.cmake.in +++ /dev/null @@ -1,10 +0,0 @@ -/* config.h for CrystFEL main programs */ - -#cmakedefine HAVE_GTK -#cmakedefine HAVE_CAIRO -#cmakedefine HAVE_OPENCL -#cmakedefine HAVE_CL_CL_H -#cmakedefine HAVE_CLOCK_GETTIME -#cmakedefine HAVE_ZMQ -#cmakedefine HAVE_HDF5 -#cmakedefine HAVE_ASAPO diff --git a/doc/articles/speed.rst b/doc/articles/speed.rst index 81c92502..3db8f5a3 100644 --- a/doc/articles/speed.rst +++ b/doc/articles/speed.rst @@ -17,8 +17,6 @@ add the option ``-DCMAKE_BUILD_TYPE=Release`` (or ``RelWithDebInfo``) to your CMake invokation to tell it to enable optimisations. In CrystFEL, it's particularly important to do this for the HDF5 compression plugins (this makes a factor of 3 difference in decompression speed!), XGandalf and PinkIndexer. -If you compile CrystFEL itself using CMake (not recommended - use Meson -instead), then you should add the option here as well. Tune or avoid compression diff --git a/libcrystfel/CMakeLists.txt b/libcrystfel/CMakeLists.txt deleted file mode 100644 index ea475637..00000000 --- a/libcrystfel/CMakeLists.txt +++ /dev/null @@ -1,176 +0,0 @@ -project(libcrystfel VERSION ${CRYSTFEL_SHORT_VERSION} LANGUAGES C) - -pkg_check_modules(XGANDALF xgandalf) -pkg_check_modules(PINKINDEXER pinkIndexer) -pkg_check_modules(FDIP fdip) -find_package(ZLIB) -find_package(FLEX REQUIRED) -find_package(BISON REQUIRED) -pkg_check_modules(MSGPACK msgpack) -pkg_check_modules(FFTW fftw3) -pkg_check_modules(LIBCCP4 libccp4c) - -configure_file(src/libcrystfel-version.c.cmake.in libcrystfel-version.c) - -set(HAVE_FFTW ${FFTW_FOUND}) -set(HAVE_XGANDALF ${XGANDALF_FOUND}) -set(HAVE_PINKINDEXER ${PINKINDEXER_FOUND}) -set(HAVE_FDIP ${FDIP_FOUND}) -set(HAVE_MSGPACK ${MSGPACK_FOUND}) -set(HAVE_LIBCCP4 ${LIBCCP4_FOUND}) -set(HAVE_ZLIB ${ZLIB_FOUND}) -set(HAVE_SEEDEE 0) - -# Recent enough version of zlib? -set(CMAKE_REQUIRED_LIBRARIES "-lz") -check_symbol_exists(gzbuffer "zlib.h" HAVE_GZBUFFER) -unset(CMAKE_REQUIRED_LIBRARIES) - -configure_file(libcrystfel-config.h.cmake.in libcrystfel-config.h) - -bison_target(symopp src/symop.y ${CMAKE_CURRENT_BINARY_DIR}/symop-parse.c COMPILE_FLAGS --report=all) -flex_target(symopl src/symop.l ${CMAKE_CURRENT_BINARY_DIR}/symop-lex.c - DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/symop-lex.h) -add_flex_bison_dependency(symopl symopp) -include_directories(${PROJECT_SOURCE_DIR}/src) - -set(LIBCRYSTFEL_SOURCES - src/reflist.c - src/utils.c - src/cell.c - src/thread-pool.c - src/image.c - src/geometry.c - src/peakfinder8.c - src/symmetry.c - src/stream.c - src/peaks.c - src/reflist-utils.c - src/filters.c - src/index.c - src/cell-utils.c - src/integer_matrix.c - src/crystal.c - src/integration.c - src/predict-refine.c - src/peakfinder8.c - src/rational.c - src/spectrum.c - src/datatemplate.c - src/colscale.c - src/detgeom.c - src/image-cbf.c - src/image-hdf5.c - src/fom.c - src/image-msgpack.c - src/image-seedee.c - src/profile.c - ${BISON_symopp_OUTPUTS} - ${FLEX_symopl_OUTPUTS} - src/indexers/dirax.c - src/indexers/mosflm.c - src/indexers/xds.c - src/indexers/felix.c - src/indexers/taketwo.c - src/indexers/asdf.c - src/indexers/xgandalf.c - src/indexers/pinkindexer.c - src/indexers/fromfile.c -) - -set(LIBCRYSTFEL_HEADERS - src/reflist.h - src/symmetry.h - src/cell.h - src/reflist-utils.h - src/thread-pool.h - src/utils.h - src/geometry.h - src/peaks.h - src/stream.h - src/index.h - src/image.h - src/filters.h - src/cell-utils.h - src/integer_matrix.h - src/crystal.h - src/predict-refine.h - src/integration.h - src/rational.h - src/spectrum.h - src/datatemplate.h - src/colscale.h - src/detgeom.h - src/fom.h - src/profile.h -) - -add_library(${PROJECT_NAME} SHARED - ${LIBCRYSTFEL_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/libcrystfel-version.c - ${LIBCRYSTFEL_HEADERS}) - -set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) -set_target_properties(${PROJECT_NAME} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) -#set_target_properties(${PROJECT_NAME} PROPERTIES SKIP_BUILD_RPATH FALSE) - -list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_LIBDIR}" isSystemDir) -if("${isSystemDir}" STREQUAL "-1") - set_target_properties(${PROJECT_NAME} - PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR};${CMAKE_INSTALL_RPATH}") -endif("${isSystemDir}" STREQUAL "-1") - -set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${CRYSTFEL_API_VERSION}) -set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${CRYSTFEL_SHORT_VERSION}) - -# Suppress extra "lib" in front of "libcrystfel" -set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") - -target_include_directories(${PROJECT_NAME} INTERFACE ${PROJECT_SOURCE_DIR}/src) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -target_include_directories(${PROJECT_NAME} PRIVATE ${HDF5_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} PRIVATE util ${HDF5_C_LIBRARIES} ${HDF5_C_HL_LIBRARIES} - ${ZLIB_LIBRARIES} Threads::Threads GSL::gsl m) - -if (XGANDALF_FOUND) - target_include_directories(${PROJECT_NAME} PRIVATE ${XGANDALF_INCLUDE_DIRS}) - target_link_libraries(${PROJECT_NAME} PRIVATE ${XGANDALF_LINK_LIBRARIES}) -endif (XGANDALF_FOUND) - -if (FDIP_FOUND) - target_include_directories(${PROJECT_NAME} PRIVATE ${FDIP_INCLUDE_DIRS}) - target_link_libraries(${PROJECT_NAME} PRIVATE ${FDIP_LINK_LIBRARIES}) -endif (FDIP_FOUND) - -if (PINKINDEXER_FOUND) - target_include_directories(${PROJECT_NAME} PRIVATE ${PINKINDEXER_INCLUDE_DIRS}) - target_link_libraries(${PROJECT_NAME} PRIVATE ${PINKINDEXER_LINK_LIBRARIES}) -endif (PINKINDEXER_FOUND) - -if (FFTW_FOUND) - target_include_directories(${PROJECT_NAME} PRIVATE ${FFTW_INCLUDE_DIRS}) - target_link_libraries(${PROJECT_NAME} PRIVATE ${FFTW_LINK_LIBRARIES}) -endif (FFTW_FOUND) - -if (LIBCCP4_FOUND) - target_include_directories(${PROJECT_NAME} PRIVATE ${LIBCCP4_INCLUDES}) - target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBCCP4_LIBRARIES}) -endif (LIBCCP4_FOUND) - -if (MSGPACK_FOUND) - target_include_directories(${PROJECT_NAME} PRIVATE ${MSGPACK_INCLUDES}) - target_link_libraries(${PROJECT_NAME} PRIVATE ${MSGPACK_LIBRARIES}) -endif (MSGPACK_FOUND) - -target_compile_options(${PROJECT_NAME} PRIVATE -Wall) -set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${LIBCRYSTFEL_HEADERS}") - -install(TARGETS libcrystfel - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crystfel - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - -# crystfel.pc -configure_file(crystfel.pc.in crystfel.pc) -install(FILES ${CMAKE_BINARY_DIR}/libcrystfel/crystfel.pc - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/libcrystfel/crystfel.pc.in b/libcrystfel/crystfel.pc.in deleted file mode 100644 index 3a355f06..00000000 --- a/libcrystfel/crystfel.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=${CMAKE_INSTALL_PREFIX} -exec_prefix=${CMAKE_INSTALL_PREFIX} -libdir=${CMAKE_INSTALL_FULL_LIBDIR} -includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR} - -Name: CrystFEL -Description: Useful routines for crystallography using a free-electron laser -Version: ${PROJECT_VERSION} -Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR} -Libs: -L${CMAKE_INSTALL_FULL_LIBDIR} -lcrystfel -Requires.private: gsl diff --git a/libcrystfel/doc/coding.md b/libcrystfel/doc/coding.md index 6e84e4fe..f83e5e50 100644 --- a/libcrystfel/doc/coding.md +++ b/libcrystfel/doc/coding.md @@ -15,7 +15,7 @@ to add your name to the 'AUTHORS' file in the top level folder, as well. The remainder of these rules apply to C code in libcrystfel and the core CrystFEL programs. There are currently no specific guidelines for Python, -Perl, shell script, CMake files or other parts of the codebase. +Perl, shell script, build scripts or other parts of the codebase. ### Indentation diff --git a/libcrystfel/libcrystfel-config.h.cmake.in b/libcrystfel/libcrystfel-config.h.cmake.in deleted file mode 100644 index 0b34950f..00000000 --- a/libcrystfel/libcrystfel-config.h.cmake.in +++ /dev/null @@ -1,19 +0,0 @@ -/* config.h for libcrystfel */ - -#cmakedefine HAVE_CLOCK_GETTIME -#cmakedefine HAVE_FFTW -#cmakedefine HAVE_XGANDALF -#cmakedefine HAVE_PINKINDEXER -#cmakedefine HAVE_FDIP -#cmakedefine HAVE_ZLIB -#cmakedefine HAVE_GZBUFFER -#cmakedefine HAVE_LIBCCP4 -#cmakedefine HAVE_MSGPACK -#cmakedefine HAVE_CLOCK_GETTIME -#cmakedefine HAVE_HDF5 -#cmakedefine HAVE_SEEDEE - -#cmakedefine HAVE_FORKPTY_PTY_H -#cmakedefine HAVE_FORKPTY_UTIL_H - -#define CRYSTFEL_VERSIONSTRING "${CRYSTFEL_VERSION}" diff --git a/libcrystfel/src/libcrystfel-version.c.cmake.in b/libcrystfel/src/libcrystfel-version.c.cmake.in deleted file mode 100644 index 513d7871..00000000 --- a/libcrystfel/src/libcrystfel-version.c.cmake.in +++ /dev/null @@ -1,4 +0,0 @@ -const char *libcrystfel_version_string() -{ - return "${CRYSTFEL_VERSION}"; -} diff --git a/src/version.c.cmake.in b/src/version.c.cmake.in deleted file mode 100644 index a22b4143..00000000 --- a/src/version.c.cmake.in +++ /dev/null @@ -1,13 +0,0 @@ -const char *crystfel_version_string() -{ - return "${CRYSTFEL_VERSION}"; -} - -const char *crystfel_licence_string() -{ - return "License GPLv3+: GNU GPL version 3 or later" \ - " <http://gnu.org/licenses/gpl.html>.\n" \ - "This is free software: you are free to change and redistribute it.\n" \ - "There is NO WARRANTY, to the extent permitted by law.\n\n" \ - "Written by Thomas White and others."; -} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt deleted file mode 100644 index 38520004..00000000 --- a/tests/CMakeLists.txt +++ /dev/null @@ -1,190 +0,0 @@ -add_test(NAME process_hkl_check_1 - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/process_hkl_check_1 $<TARGET_FILE:process_hkl>) -add_test(NAME process_hkl_check_2 - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/process_hkl_check_2 $<TARGET_FILE:process_hkl>) -add_test(NAME process_hkl_check_3 - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/process_hkl_check_3 $<TARGET_FILE:process_hkl>) -add_test(NAME process_hkl_check_4 - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/process_hkl_check_4 $<TARGET_FILE:process_hkl>) -add_test(NAME partialator_merge_check_1 - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/partialator_merge_check_1 $<TARGET_FILE:partialator>) -add_test(NAME partialator_merge_check_2 - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/partialator_merge_check_2 $<TARGET_FILE:partialator>) -add_test(NAME partialator_merge_check_3 - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/partialator_merge_check_3 $<TARGET_FILE:partialator>) - -add_executable(ambi_check ambi_check.c) -target_include_directories(ambi_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(ambi_check ${COMMON_LIBRARIES}) -add_test(ambi_check ambi_check) - -add_executable(cell_check cell_check.c) -target_include_directories(cell_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(cell_check ${COMMON_LIBRARIES}) -add_test(cell_check cell_check) - -add_executable(centering_check centering_check.c) -target_include_directories(centering_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(centering_check ${COMMON_LIBRARIES}) -add_test(centering_check centering_check) - -add_executable(integration_check integration_check.c histogram.c) -target_include_directories(integration_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(integration_check PRIVATE ${COMMON_LIBRARIES}) -add_test(integration_check integration_check) - -add_executable(list_check list_check.c) -target_include_directories(list_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(list_check ${COMMON_LIBRARIES}) -add_test(list_check list_check) - -add_executable(prediction_gradient_check prediction_gradient_check.c) -target_include_directories(prediction_gradient_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(prediction_gradient_check ${COMMON_LIBRARIES}) -add_test(prediction_gradient_check prediction_gradient_check) - -add_executable(prof2d_check prof2d_check.c histogram.c) -target_include_directories(prof2d_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(prof2d_check PRIVATE ${COMMON_LIBRARIES}) -add_test(prof2d_check prof2d_check) - -add_executable(ring_check ring_check.c) -target_include_directories(ring_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(ring_check PRIVATE ${COMMON_LIBRARIES}) -add_test(ring_check ring_check) - -add_executable(symmetry_check symmetry_check.c) -target_include_directories(symmetry_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(symmetry_check ${COMMON_LIBRARIES}) -add_test(symmetry_check symmetry_check) - -add_executable(transformation_check transformation_check.c) -target_include_directories(transformation_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(transformation_check ${COMMON_LIBRARIES}) -add_test(transformation_check transformation_check) - -if (HAVE_OPENCL) - add_executable(gpu_sim_check gpu_sim_check.c ../src/diffraction.c - ../src/diffraction-gpu.c ../src/cl-utils.c) - target_include_directories(gpu_sim_check PRIVATE ${COMMON_INCLUDES} ${OpenCL_INCLUDE_DIRS}) - target_link_libraries(gpu_sim_check ${COMMON_LIBRARIES} ${OpenCL_LIBRARIES}) - add_test(NAME gpu_sim_check - COMMAND gpu_sim_check ${CMAKE_CURRENT_SOURCE_DIR}/gpu_sim_check.geom) -endif (HAVE_OPENCL) - -add_executable(rational_check rational_check.c) -target_include_directories(rational_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(rational_check ${COMMON_LIBRARIES}) -add_test(rational_check rational_check) - -add_executable(spectrum_check spectrum_check.c) -target_include_directories(spectrum_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(spectrum_check ${COMMON_LIBRARIES}) -add_test(spectrum_check spectrum_check) - -add_executable(cellcompare_check cellcompare_check.c) -target_include_directories(cellcompare_check PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(cellcompare_check ${COMMON_LIBRARIES}) -add_test(cellcompare_check cellcompare_check) - -add_executable(evparse1 evparse1.c) -target_include_directories(evparse1 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(evparse1 ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -add_test(evparse1 evparse1) - -add_executable(evparse2 evparse2.c) -target_include_directories(evparse2 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(evparse2 ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -add_test(evparse2 evparse2) - -add_executable(evparse3 evparse3.c) -target_include_directories(evparse3 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(evparse3 ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -add_test(evparse3 evparse3) - -add_executable(evparse4 evparse4.c) -target_include_directories(evparse4 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(evparse4 ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -add_test(evparse4 evparse4) - -add_executable(evparse5 evparse5.c) -target_include_directories(evparse5 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(evparse5 ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -add_test(evparse5 evparse5) - -add_executable(evparse6 evparse6.c) -target_include_directories(evparse6 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(evparse6 ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -add_test(evparse6 evparse6) - -add_executable(evparse7 evparse7.c) -target_include_directories(evparse7 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(evparse7 ${COMMON_LIBRARIES} ${HDF5_C_LIBRARIES}) -add_test(evparse7 evparse7) - -add_executable(ev_enum1 ev_enum1.c) -target_include_directories(ev_enum1 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(ev_enum1 ${COMMON_LIBRARIES}) -add_test(NAME ev_enum1 - COMMAND ev_enum1 ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum1.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum1.geom) - -add_executable(ev_enum2 ev_enum2.c) -target_include_directories(ev_enum2 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(ev_enum2 ${COMMON_LIBRARIES}) -add_test(NAME ev_enum2 - COMMAND ev_enum2 ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum2.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum2.geom) - -add_executable(ev_enum3 ev_enum3.c) -target_include_directories(ev_enum3 PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(ev_enum3 ${COMMON_LIBRARIES}) -add_test(NAME ev_enum3 - COMMAND ev_enum3 ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum3.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/ev_enum3.geom) - -add_executable(wavelength_geom wavelength_geom.c) -target_include_directories(wavelength_geom PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(wavelength_geom ${COMMON_LIBRARIES}) -add_test(NAME wavelength_geom1 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom1.geom 1e-10) -add_test(NAME wavelength_geom2 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom2.geom 1.3776e-10) -add_test(NAME wavelength_geom3 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom3.geom 1.3776e-10) -add_test(NAME wavelength_geom4 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom4.geom 1.9687e-12) -add_test(NAME wavelength_geom5 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom5.geom 1.9687e-12) -add_test(NAME wavelength_geom6 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom6.geom 1.3776e-10) -add_test(NAME wavelength_geom7 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom7.geom 1.3776e-10) -add_test(NAME wavelength_geom8 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom8.geom 1.9687e-12) -add_test(NAME wavelength_geom9 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom9.geom 1.3776e-10) -add_test(NAME wavelength_geom10 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom10.geom 1.3776e-10) -add_test(NAME wavelength_geom11 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom11.geom 1.125e-10) -add_test(NAME wavelength_geom12 - COMMAND wavelength_geom ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom.h5 - ${CMAKE_CURRENT_SOURCE_DIR}/wavelength_geom12.geom 1.125e-10) - -add_executable(stream_read stream_read.c) -target_include_directories(stream_read PRIVATE ${COMMON_INCLUDES}) -target_link_libraries(stream_read ${COMMON_LIBRARIES}) -add_test(NAME stream_read - COMMAND stream_read ${CMAKE_CURRENT_SOURCE_DIR}/test.stream) |