diff options
-rw-r--r-- | CMake/FindCairo.cmake | 48 | ||||
-rw-r--r-- | CMake/FindFFTW.cmake | 20 | ||||
-rw-r--r-- | CMake/FindGDK.cmake | 51 | ||||
-rw-r--r-- | CMake/FindGdkPixbuf2.cmake | 51 | ||||
-rw-r--r-- | CMakeLists.txt | 15 | ||||
-rw-r--r-- | libcrystfel/CMakeLists.txt | 4 |
6 files changed, 10 insertions, 179 deletions
diff --git a/CMake/FindCairo.cmake b/CMake/FindCairo.cmake deleted file mode 100644 index 01ba7d6c..00000000 --- a/CMake/FindCairo.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# - 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) -endif(NOT CAIRO_FOUND AND NOT PKG_CONFIG_FOUND) - -# Report results -if(CAIRO_LIBRARIES AND CAIRO_INCLUDE_DIRS) - - set(CAIRO_FOUND 1) - if(NOT Cairo_FIND_QUIETLY) - message(STATUS "Found Cairo: includes '${CAIRO_INCLUDE_DIRS}', libraries '${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) diff --git a/CMake/FindFFTW.cmake b/CMake/FindFFTW.cmake deleted file mode 100644 index faccfda5..00000000 --- a/CMake/FindFFTW.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# - 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) diff --git a/CMake/FindGDK.cmake b/CMake/FindGDK.cmake deleted file mode 100644 index 5de42303..00000000 --- a/CMake/FindGDK.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# - Try to find the GDK library -# Once done this will define -# -# GDK_FOUND - system has gdk -# GDK_INCLUDE_DIRS - the gdk include directory -# GDK_LIBRARIES - Link these to use gdk -# -# Define GDK_MIN_VERSION for which version desired. -# - -include(FindPkgConfig) - -if (GDK_FIND_REQUIRED) - set(_pkgconfig_REQUIRED "REQUIRED") -else (GDK_FIND_REQUIRED) - set(_pkgconfig_REQUIRED "") -endif (GDK_FIND_REQUIRED) - -if (GDK_MIN_VERSION) - pkg_search_module(GDK ${_pkgconfig_REQUIRED} gdk-2.0>=${GDK_MIN_VERSION}) -else (GDK_MIN_VERSION) - pkg_search_module(GDK ${_pkgconfig_REQUIRED} gdk-2.0) -endif (GDK_MIN_VERSION) - -if (GDK_FOUND) - message(STATUS "Found GDK (using pkg-config): ${GDK_LIBRARIES}") -endif (GDK_FOUND) - -# Backup option if we don't have pkg-config -if (NOT GDK_FOUND AND NOT PKG_CONFIG_FOUND) - - find_path(GDK_INCLUDE_DIRS gdk/gdk.h) - find_library(GDK_LIBRARIES gdk) - - if (GDK_LIBRARIES AND GDK_INCLUDE_DIRS) - set(GDK_FOUND 1) - if (NOT GDK_FIND_QUIETLY) - message(STATUS "Found GDK_LIBRARIES}") - endif(NOT GDK_FIND_QUIETLY) - else (GDK_LIBRARIES AND GDK_INCLUDE_DIRS) - if (GDK_FIND_REQUIRED) - message(SEND_ERROR "Could not find GDK") - else (GDK_FIND_REQUIRED) - if (NOT GDK_FIND_QUIETLY) - message(STATUS "Could not find GDK") - endif (NOT GDK_FIND_QUIETLY) - endif (GDK_FIND_REQUIRED) - endif (GDK_LIBRARIES AND GDK_INCLUDE_DIRS) - -endif (NOT GDK_FOUND AND NOT PKG_CONFIG_FOUND) - diff --git a/CMake/FindGdkPixbuf2.cmake b/CMake/FindGdkPixbuf2.cmake deleted file mode 100644 index dea84f4e..00000000 --- a/CMake/FindGdkPixbuf2.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# - Try to find the gdk-pixbuf-2.0 library -# Once done this will define -# -# GDKPIXBUF_FOUND - system has gdk-pixbuf -# GDKPIXBUF_INCLUDE_DIRS - the gdk-pixbuf include directory -# GDKPIXBUF_LIBRARIES - Link these to use gdk-pixbuf -# -# Define GDKPIXBUF_MIN_VERSION for which version desired. -# - -include(FindPkgConfig) - -if (GdkPixbuf2_FIND_REQUIRED) - set(_pkgconfig_REQUIRED "REQUIRED") -else (GdkPixbuf2_FIND_REQUIRED) - set(_pkgconfig_REQUIRED "") -endif (GdkPixbuf2_FIND_REQUIRED) - -if (GDKPIXBUF_MIN_VERSION) - pkg_search_module(GDKPIXBUF ${_pkgconfig_REQUIRED} gdk-pixbuf-2.0>=${GDKPIXBUF_MIN_VERSION}) -else (GDKPIXBUF_MIN_VERSION) - pkg_search_module(GDKPIXBUF ${_pkgconfig_REQUIRED} gdk-pixbuf-2.0) -endif (GDKPIXBUF_MIN_VERSION) - -if (GDKPIXBUF_FOUND) - message(STATUS "Found GdkPixbuf2 (using pkg-config): ${GDKPIXBUF_LIBRARIES}") -endif (GDKPIXBUF_FOUND) - -# Backup option if we don't have pkg-config -if (NOT GDKPIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) - - find_path(GDKPIXBUF_INCLUDE_DIRS gdk-pixbuf/gdk-pixbuf.h) - find_library(GDKPIXBUF_LIBRARIES gdk-pixbuf) - - if (GDKPIXBUF_LIBRARIES AND GDKPIXBUF_INCLUDE_DIRS) - set(GDKPIXBUF_FOUND 1) - if (NOT GdkPixbuf2_FIND_QUIETLY) - message(STATUS "Found GdkPixbuf2: ${GDKPIXBUF_LIBRARIES}") - endif(NOT GdkPixbuf2_FIND_QUIETLY) - else (GDKPIXBUF_LIBRARIES AND GDKPIXBUF_INCLUDE_DIRS) - if (GdkPixbuf2_FIND_REQUIRED) - message(SEND_ERROR "Could not find GdkPixbuf2") - else (GdkPixbuf2_FIND_REQUIRED) - if (NOT GdkPixbuf2_FIND_QUIETLY) - message(STATUS "Could not find GdkPixbuf2") - endif (NOT GdkPixbuf2_FIND_QUIETLY) - endif (GdkPixbuf2_FIND_REQUIRED) - endif (GDKPIXBUF_LIBRARIES AND GDKPIXBUF_INCLUDE_DIRS) - -endif (NOT GDKPIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) - diff --git a/CMakeLists.txt b/CMakeLists.txt index 8537b005..cb08e2d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,11 +13,12 @@ find_package(HDF5 REQUIRED COMPONENTS C) find_package(Threads REQUIRED) find_package(GSL REQUIRED) find_package(GTK2 2.0.0 COMPONENTS gtk) -find_package(GdkPixbuf2) -find_package(GDK) find_package(TIFF) -find_package(Cairo) find_package(OpenCL) +find_package(PkgConfig REQUIRED) +pkg_search_module(CAIRO cairo) +pkg_search_module(GDK gdk-2.0) +pkg_search_module(GDKPIXBUF gdk-pixbuf-2.0) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always") @@ -182,7 +183,7 @@ if (CAIRO_FOUND) add_executable(render_hkl ${RENDER_HKL_SOURCES}) target_include_directories(render_hkl PRIVATE ${COMMON_INCLUDES} ${CAIRO_INCLUDE_DIRS}) - target_link_libraries(render_hkl ${COMMON_LIBRARIES} ${CAIRO_LIBRARIES}) + target_link_libraries(render_hkl ${COMMON_LIBRARIES} ${CAIRO_LDFLAGS}) list(APPEND CRYSTFEL_EXECUTABLES render_hkl) @@ -276,17 +277,17 @@ list(APPEND CRYSTFEL_EXECUTABLES geoptimiser) # If Cairo, gdk-pixbuf and GDK are all found, geoptimiser will add PNG support if (CAIRO_FOUND) target_include_directories(geoptimiser PRIVATE ${CAIRO_INCLUDE_DIRS}) - target_link_libraries(geoptimiser ${CAIRO_LIBRARIES}) + target_link_libraries(geoptimiser ${CAIRO_LDFLAGS}) endif (CAIRO_FOUND) if (GDKPIXBUF_FOUND) target_include_directories(geoptimiser PRIVATE ${GDKPIXBUF_INCLUDE_DIRS}) - target_link_libraries(geoptimiser ${GDKPIXBUF_LIBRARIES}) + target_link_libraries(geoptimiser ${GDKPIXBUF_LDFLAGS}) endif (GDKPIXBUF_FOUND) if (GDK_FOUND) target_include_directories(geoptimiser PRIVATE ${GDK_INCLUDE_DIRS}) - target_link_libraries(geoptimiser ${GDK_LIBRARIES}) + target_link_libraries(geoptimiser ${GDK_LDFLAGS}) endif (GDK_FOUND) if (TIFF_FOUND) diff --git a/libcrystfel/CMakeLists.txt b/libcrystfel/CMakeLists.txt index 2ca4e7e2..48690e3d 100644 --- a/libcrystfel/CMakeLists.txt +++ b/libcrystfel/CMakeLists.txt @@ -1,12 +1,12 @@ project(libcrystfel VERSION ${CRYSTFEL_SHORT_VERSION} LANGUAGES C) find_package(Curses) -find_package(FFTW) find_package(CBF) find_package(XGANDALF) find_package(PINKINDEXER) find_package(NBP) find_package(FDIP) +pkg_search_module(FFTW fftw3) set(HAVE_CURSES ${CURSES_FOUND}) set(HAVE_FFTW ${FFTW_FOUND}) @@ -148,7 +148,7 @@ endif (NBP_FOUND) if (FFTW_FOUND) target_include_directories(${PROJECT_NAME} PRIVATE ${FFTW_INCLUDES}) - target_link_libraries(${PROJECT_NAME} PRIVATE ${FFTW_LIBRARIES}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${FFTW_LDFLAGS}) endif (FFTW_FOUND) if (CBF_FOUND) |