aboutsummaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-03-12 09:48:00 +0100
committerThomas White <taw@physics.org>2018-03-12 10:17:49 +0100
commit753ceccfb4517ae0aa4445c18ae34ca52171f28d (patch)
treea2928d9de6f10813b97363ea401cc72625ed3ce2 /CMake
parent95bb73d90fed58f61dddc0d1d3e8afeb9879daaa (diff)
Add CMake
Diffstat (limited to 'CMake')
-rw-r--r--CMake/FindCBF.cmake22
-rw-r--r--CMake/FindCairo.cmake47
-rw-r--r--CMake/FindFDIP.cmake27
-rw-r--r--CMake/FindFFTW.cmake22
-rw-r--r--CMake/FindNBP.cmake26
-rw-r--r--CMake/FindPINKINDEXER.cmake26
-rw-r--r--CMake/FindXGANDALF.cmake26
-rw-r--r--CMake/config.cmake23
8 files changed, 219 insertions, 0 deletions
diff --git a/CMake/FindCBF.cmake b/CMake/FindCBF.cmake
new file mode 100644
index 00000000..390c9c2e
--- /dev/null
+++ b/CMake/FindCBF.cmake
@@ -0,0 +1,22 @@
+# - Find CBF
+# Find the native CBF includes and library
+#
+# CBF_INCLUDES - where to find fftw3.h
+# CBF_LIBRARIES - List of libraries when using CBF.
+# CBF_FOUND - True if CBF found.
+
+if (CBF_INCLUDES)
+ # Already in cache, be silent
+ set (CBF_FIND_QUIETLY TRUE)
+endif (CBF_INCLUDES)
+
+find_path (CBF_INCLUDES cbf.h PATH_SUFFIXES libcbf cbf)
+
+find_library (CBF_LIBRARIES NAMES cbf)
+
+# handle the QUIETLY and REQUIRED arguments and set CBF_FOUND to TRUE if
+# all listed variables are TRUE
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (CBF DEFAULT_MSG CBF_LIBRARIES CBF_INCLUDES)
+
+mark_as_advanced (CBF_LIBRARIES CBF_INCLUDES)
diff --git a/CMake/FindCairo.cmake b/CMake/FindCairo.cmake
new file mode 100644
index 00000000..f03079af
--- /dev/null
+++ b/CMake/FindCairo.cmake
@@ -0,0 +1,47 @@
+# - Try to find the cairo library
+# Once done this will define
+#
+# CAIRO_FOUND - system has cairo
+# CAIRO_INCLUDE_DIRS - the cairo include directory
+# CAIRO_LIBRARIES - Link these to use cairo
+#
+# Define CAIRO_MIN_VERSION for which version desired.
+#
+
+INCLUDE(FindPkgConfig)
+
+IF(Cairo_FIND_REQUIRED)
+ SET(_pkgconfig_REQUIRED "REQUIRED")
+ELSE(Cairo_FIND_REQUIRED)
+ SET(_pkgconfig_REQUIRED "")
+ENDIF(Cairo_FIND_REQUIRED)
+
+IF(CAIRO_MIN_VERSION)
+ PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo>=${CAIRO_MIN_VERSION})
+ELSE(CAIRO_MIN_VERSION)
+ PKG_SEARCH_MODULE(CAIRO ${_pkgconfig_REQUIRED} cairo)
+ENDIF(CAIRO_MIN_VERSION)
+
+IF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
+ FIND_PATH(CAIRO_INCLUDE_DIRS cairo.h)
+ FIND_LIBRARY(CAIRO_LIBRARIES cairo)
+
+ # Report results
+ IF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
+ SET(CAIRO_FOUND 1)
+ IF(NOT Cairo_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Cairo: ${CAIRO_LIBRARIES}")
+ ENDIF(NOT Cairo_FIND_QUIETLY)
+ ELSE(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
+ IF(Cairo_FIND_REQUIRED)
+ MESSAGE(SEND_ERROR "Could not find Cairo")
+ ELSE(Cairo_FIND_REQUIRED)
+ IF(NOT Cairo_FIND_QUIETLY)
+ MESSAGE(STATUS "Could not find Cairo")
+ ENDIF(NOT Cairo_FIND_QUIETLY)
+ ENDIF(Cairo_FIND_REQUIRED)
+ ENDIF(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS)
+ENDIF(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND)
+
+# Hide advanced variables from CMake GUIs
+MARK_AS_ADVANCED(CAIRO_LIBRARIES CAIRO_INCLUDE_DIRS)
diff --git a/CMake/FindFDIP.cmake b/CMake/FindFDIP.cmake
new file mode 100644
index 00000000..fb38e0db
--- /dev/null
+++ b/CMake/FindFDIP.cmake
@@ -0,0 +1,27 @@
+# - Find FDIP
+# Find the native FDIP includes and library
+#
+# FDIP_INCLUDES - where to find streakFinder.h
+# FDIP_LIBRARIES - List of libraries when using FDIP.
+# FDIP_FOUND - True if FDIP found.
+
+if (FDIP_INCLUDES)
+ # Already in cache, be silent
+ set (FDIP_FIND_QUIETLY TRUE)
+endif (FDIP_INCLUDES)
+
+find_path (FDIP_INCLUDES streakFinder.h
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/include
+ PATH_SUFFIXES fastDiffractionImageProcessing)
+
+find_library (FDIP_LIBRARIES fastDiffractionImageProcessing
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/lib)
+
+# handle the QUIETLY and REQUIRED arguments and set FDIP_FOUND to TRUE if
+# all listed variables are TRUE
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (FDIP DEFAULT_MSG FDIP_LIBRARIES FDIP_INCLUDES)
+
+mark_as_advanced (FDIP_LIBRARIES FDIP_INCLUDES)
diff --git a/CMake/FindFFTW.cmake b/CMake/FindFFTW.cmake
new file mode 100644
index 00000000..00c3401c
--- /dev/null
+++ b/CMake/FindFFTW.cmake
@@ -0,0 +1,22 @@
+# - Find FFTW
+# Find the native FFTW includes and library
+#
+# FFTW_INCLUDES - where to find fftw3.h
+# FFTW_LIBRARIES - List of libraries when using FFTW.
+# FFTW_FOUND - True if FFTW found.
+
+if (FFTW_INCLUDES)
+ # Already in cache, be silent
+ set (FFTW_FIND_QUIETLY TRUE)
+endif (FFTW_INCLUDES)
+
+find_path (FFTW_INCLUDES fftw3.h)
+
+find_library (FFTW_LIBRARIES NAMES fftw3)
+
+# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
+# all listed variables are TRUE
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (FFTW DEFAULT_MSG FFTW_LIBRARIES FFTW_INCLUDES)
+
+mark_as_advanced (FFTW_LIBRARIES FFTW_INCLUDES)
diff --git a/CMake/FindNBP.cmake b/CMake/FindNBP.cmake
new file mode 100644
index 00000000..63906ea4
--- /dev/null
+++ b/CMake/FindNBP.cmake
@@ -0,0 +1,26 @@
+# - Find NBP - numericalBraggPrediction
+# Find the native NBP includes and library
+#
+# NBP_INCLUDES - where to find IndexerBase.h
+# NBP_LIBRARIES - List of libraries when using NBP.
+# NBP_FOUND - True if NBP found.
+
+if (NBP_INCLUDES)
+ # Already in cache, be silent
+ set (NBP_FIND_QUIETLY TRUE)
+endif (NBP_INCLUDES)
+
+find_path (NBP_INCLUDES numericalBraggPrediction/ProjectionCalculation.h
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/include)
+
+find_library (NBP_LIBRARIES numericalBraggPrediction
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/lib)
+
+# handle the QUIETLY and REQUIRED arguments and set NBP_FOUND to TRUE if
+# all listed variables are TRUE
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (NBP DEFAULT_MSG NBP_LIBRARIES NBP_INCLUDES)
+
+mark_as_advanced (NBP_LIBRARIES NBP_INCLUDES)
diff --git a/CMake/FindPINKINDEXER.cmake b/CMake/FindPINKINDEXER.cmake
new file mode 100644
index 00000000..6a96786e
--- /dev/null
+++ b/CMake/FindPINKINDEXER.cmake
@@ -0,0 +1,26 @@
+# - Find PINKINDEXER
+# Find the native PINKINDEXER includes and library
+#
+# PINKINDEXER_INCLUDES - where to find IndexerBase.h
+# PINKINDEXER_LIBRARIES - List of libraries when using PINKINDEXER.
+# PINKINDEXER_FOUND - True if PINKINDEXER found.
+
+if (PINKINDEXER_INCLUDES)
+ # Already in cache, be silent
+ set (PINKINDEXER_FIND_QUIETLY TRUE)
+endif (PINKINDEXER_INCLUDES)
+
+find_path (PINKINDEXER_INCLUDES pinkIndexer/PinkIndexer.h
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/include)
+
+find_library (PINKINDEXER_LIBRARIES pinkIndexer
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/lib)
+
+# handle the QUIETLY and REQUIRED arguments and set PINKINDEXER_FOUND to TRUE if
+# all listed variables are TRUE
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (PINKINDEXER DEFAULT_MSG PINKINDEXER_LIBRARIES PINKINDEXER_INCLUDES)
+
+mark_as_advanced (PINKINDEXER_LIBRARIES PINKINDEXER_INCLUDES)
diff --git a/CMake/FindXGANDALF.cmake b/CMake/FindXGANDALF.cmake
new file mode 100644
index 00000000..1c6999a3
--- /dev/null
+++ b/CMake/FindXGANDALF.cmake
@@ -0,0 +1,26 @@
+# - Find XGANDALF
+# Find the native XGANDALF includes and library
+#
+# XGANDALF_INCLUDES - where to find IndexerBase.h
+# XGANDALF_LIBRARIES - List of libraries when using XGANDALF.
+# XGANDALF_FOUND - True if XGANDALF found.
+
+if (XGANDALF_INCLUDES)
+ # Already in cache, be silent
+ set (XGANDALF_FIND_QUIETLY TRUE)
+endif (XGANDALF_INCLUDES)
+
+find_path (XGANDALF_INCLUDES xgandalf/IndexerBase.h
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/include)
+
+find_library (XGANDALF_LIBRARIES xgandalf
+ PATHS
+ ${CMAKE_INSTALL_PREFIX}/lib)
+
+# handle the QUIETLY and REQUIRED arguments and set XGANDALF_FOUND to TRUE if
+# all listed variables are TRUE
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (XGANDALF DEFAULT_MSG XGANDALF_LIBRARIES XGANDALF_INCLUDES)
+
+mark_as_advanced (XGANDALF_LIBRARIES XGANDALF_INCLUDES)
diff --git a/CMake/config.cmake b/CMake/config.cmake
new file mode 100644
index 00000000..239ba13a
--- /dev/null
+++ b/CMake/config.cmake
@@ -0,0 +1,23 @@
+include(CheckIncludeFile)
+include(CheckLibraryExists)
+
+set(HAVE_CAIRO ${CAIRO_FOUND})
+set(HAVE_TIFF ${TIFF_FOUND})
+set(HAVE_GTK ${GTK2_FOUND})
+set(HAVE_FFTW ${FFTW_FOUND})
+set(HAVE_XGANDALF ${XGANDALF_FOUND})
+set(HAVE_FDIP ${FDIP_FOUND})
+set(HAVE_OPENCL ${OpenCL_FOUND})
+set(HAVE_CBFLIB ${CBF_FOUND})
+
+
+check_include_file(fcntl.h HAVE_FCNTL_H)
+check_include_file(stdlib.h HAVE_STDLIB_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
+if(OpenCL_FOUND)
+ check_include_file(CL/cl.h HAVE_CL_CL_H "-I${OpenCL_INCLUDE_DIRS}")
+endif(OpenCL_FOUND)
+
+check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)