diff options
author | Thomas White <taw@physics.org> | 2018-05-17 15:31:45 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-05-17 15:39:22 +0200 |
commit | a9f48b6507b0326a34b84d7600f5eb791993eeb1 (patch) | |
tree | b89b6e73477125336c35c6d7d9996bd8ebae7fd7 /libcrystfel | |
parent | 87fd650abf11da75e7abd2ff90821cf7cb041b91 (diff) | |
parent | a9f4c0ff4376267d90d6e8f9a0b6c012ec0588a4 (diff) |
Merge branch 'tom/cmake'
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/CMakeLists.txt | 123 | ||||
-rw-r--r-- | libcrystfel/Makefile.am | 41 | ||||
-rw-r--r-- | libcrystfel/crystfel.pc.in | 15 | ||||
-rw-r--r-- | libcrystfel/src/integration.c | 8 | ||||
-rw-r--r-- | libcrystfel/src/reflist-utils.c | 6 | ||||
-rw-r--r-- | libcrystfel/src/stream.c | 1 | ||||
-rw-r--r-- | libcrystfel/src/thread-pool.c | 9 |
7 files changed, 143 insertions, 60 deletions
diff --git a/libcrystfel/CMakeLists.txt b/libcrystfel/CMakeLists.txt new file mode 100644 index 00000000..5d0ee069 --- /dev/null +++ b/libcrystfel/CMakeLists.txt @@ -0,0 +1,123 @@ +project(libcrystfel) + +set(LIBCRYSTFEL_SOURCES + src/reflist.c + src/utils.c + src/cell.c + src/detector.c + src/thread-pool.c + src/image.c + src/hdf5-file.c + src/geometry.c + src/peakfinder8.c + src/statistics.c + src/symmetry.c + src/stream.c + src/peaks.c + src/reflist-utils.c + src/filters.c + src/render.c + src/index.c + src/dirax.c + src/mosflm.c + src/cell-utils.c + src/integer_matrix.c + src/crystal.c + src/xds.c + src/integration.c + src/predict-refine.c + src/histogram.c + src/events.c + src/felix.c + src/peakfinder8.c + src/taketwo.c +) + +if (HAVE_FFTW) + set(LIBCRYSTFEL_FFTW_SOURCES src/asdf.c) +endif (HAVE_FFTW) + +set(LIBCRYSTFEL_HEADERS + src/hdf5-file.h + src/reflist.h + src/symmetry.h + src/cell.h + src/reflist-utils.h + src/thread-pool.h + src/statistics.h + src/utils.h + src/detector.h + src/geometry.h + src/peakfinder8.h + src/peaks.h + src/stream.h + src/render.h + src/index.h + src/image.h + src/filters.h + src/dirax.h + src/mosflm.h + src/cell-utils.h + src/integer_matrix.h + src/crystal.h + src/xds.h + src/predict-refine.h + src/integration.h + src/histogram.h + src/events.h + src/asdf.h + src/felix.h + src/peakfinder8.h + src/taketwo.h +) + +add_library(${PROJECT_NAME} SHARED + ${LIBCRYSTFEL_SOURCES} + ${LIBCRYSTFEL_FFTW_SOURCES} + ${LIBCRYSTFEL_HEADERS}) + +set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") +target_include_directories(${PROJECT_NAME} INTERFACE ${PROJECT_SOURCE_DIR}/src) +target_include_directories(${PROJECT_NAME} PRIVATE ${HDF5_INCLUDE_DIRS}) +target_link_libraries(${PROJECT_NAME} PRIVATE util ${HDF5_C_LIBRARIES}) + +if (XGANDALF_FOUND) + target_include_directories(${PROJECT_NAME} PRIVATE ${XGANDALF_INCLUDES}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${XGANDALF_LIBRARIES}) +endif (XGANDALF_FOUND) + +if (FDIP_FOUND) + target_include_directories(${PROJECT_NAME} PRIVATE ${FDIP_INCLUDES}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${FDIP_LIBRARIES}) +endif (FDIP_FOUND) + +if (PINKINDEXER_FOUND) + target_include_directories(${PROJECT_NAME} PRIVATE ${PINKINDEXER_INCLUDES}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${PINKINDEXER_LIBRARIES}) +endif (PINKINDEXER_FOUND) + +if (NBP_FOUND) + target_include_directories(${PROJECT_NAME} PRIVATE ${NBP_INCLUDES}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${NBP_LIBRARIES}) +endif (NBP_FOUND) + +if (FFTW_FOUND) + target_include_directories(${PROJECT_NAME} PRIVATE ${FFTW_INCLUDES}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${FFTW_LIBRARIES}) +endif (FFTW_FOUND) + +if (CBF_FOUND) + target_include_directories(${PROJECT_NAME} PRIVATE ${CBF_INCLUDES}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${CBF_LIBRARIES}) +endif (CBF_FOUND) + +if (CURSES_FOUND) + target_include_directories(${PROJECT_NAME} PRIVATE ${CURSES_INCLUDE_DIRS}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${CURSES_LIBRARIES}) +endif (CURSES_FOUND) + +target_compile_options(${PROJECT_NAME} PRIVATE -Wall) + +install (TARGETS libcrystfel + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib) diff --git a/libcrystfel/Makefile.am b/libcrystfel/Makefile.am deleted file mode 100644 index 1d24d353..00000000 --- a/libcrystfel/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -lib_LTLIBRARIES = libcrystfel.la -libcrystfel_la_LIBADD = ../lib/libgnu.la @LIBCRYSTFEL_LIBS@ $(PTY_LIB) -libcrystfel_la_LDFLAGS = -version-info 10:0:0 - -libcrystfel_la_SOURCES = src/reflist.c src/utils.c src/cell.c src/detector.c \ - src/thread-pool.c src/image.c src/hdf5-file.c \ - src/geometry.c src/statistics.c \ - src/symmetry.c src/stream.c src/peaks.c \ - src/reflist-utils.c src/filters.c \ - src/render.c src/index.c src/dirax.c src/mosflm.c \ - src/cell-utils.c src/integer_matrix.c src/crystal.c \ - src/xds.c src/integration.c src/predict-refine.c \ - src/histogram.c src/events.c src/felix.c \ - src/taketwo.c src/peakfinder8.c - -if HAVE_FFTW -libcrystfel_la_SOURCES += src/asdf.c -endif - -libcrystfel_la_includedir=$(includedir)/crystfel/ - -libcrystfel_la_include_HEADERS = ${top_srcdir}/version.h \ - src/hdf5-file.h src/reflist.h src/symmetry.h \ - src/cell.h src/reflist-utils.h \ - src/thread-pool.h src/statistics.h \ - src/utils.h src/detector.h \ - src/geometry.h src/peaks.h src/stream.h \ - src/render.h src/index.h src/image.h \ - src/filters.h src/dirax.h src/mosflm.h \ - src/cell-utils.h \ - src/integer_matrix.h src/crystal.h \ - src/xds.h src/predict-refine.h \ - src/integration.h src/histogram.h \ - src/events.h src/asdf.h src/felix.h \ - src/taketwo.h src/peakfinder8.h - -AM_CPPFLAGS = -DDATADIR=\""$(datadir)"\" -I$(top_builddir)/lib -Wall -AM_CPPFLAGS += -I$(top_srcdir)/lib @LIBCRYSTFEL_CFLAGS@ - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = crystfel.pc diff --git a/libcrystfel/crystfel.pc.in b/libcrystfel/crystfel.pc.in index 3e9bf89b..7539cad1 100644 --- a/libcrystfel/crystfel.pc.in +++ b/libcrystfel/crystfel.pc.in @@ -1,10 +1,11 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ +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: @VERSION@ -Cflags: -I${includedir} @LIBCRYSTFEL_CFLAGS@ -Libs: -L${libdir} -lcrystfel @LIBCRYSTFEL_LIBS@ +Version: ${PROJECT_VERSION}+${GIT_SHA1} +Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR} -pthread +Libs: -L${CMAKE_INSTALL_FULL_LIBDIR} -lcrystfel +Requires: gsl diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index fcbdf658..880ae87e 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -39,7 +39,7 @@ #include <gsl/gsl_linalg.h> #include <gsl/gsl_eigen.h> -#ifdef HAVE_CURSES_COLOR +#ifdef HAVE_CURSES #include <ncurses.h> #endif @@ -177,7 +177,7 @@ static float boxi(struct intcontext *ic, struct peak_box *bx, int p, int q) } -#ifdef HAVE_CURSES_COLOR +#ifdef HAVE_CURSES static void colour_on(enum boxmask_val b) { switch ( b ) { @@ -225,7 +225,7 @@ static void colour_off(enum boxmask_val b) #endif -#ifdef HAVE_CURSES_COLOR +#ifdef HAVE_CURSES static void show_reference_profile(struct intcontext *ic, int i) { int q; @@ -254,7 +254,7 @@ static void show_reference_profile(struct intcontext *ic, int i) static void show_peak_box(struct intcontext *ic, struct peak_box *bx, pthread_mutex_t *term_lock) { -#ifdef HAVE_CURSES_COLOR +#ifdef HAVE_CURSES int q; signed int h, k, l; double fs, ss; diff --git a/libcrystfel/src/reflist-utils.c b/libcrystfel/src/reflist-utils.c index 7ff78f52..54c467b3 100644 --- a/libcrystfel/src/reflist-utils.c +++ b/libcrystfel/src/reflist-utils.c @@ -27,18 +27,20 @@ * */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <math.h> #include <stdio.h> #include <assert.h> - #include "reflist.h" #include "cell.h" #include "cell-utils.h" #include "utils.h" #include "reflist-utils.h" #include "symmetry.h" -#include "version.h" /** diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index 47661946..9d97ff98 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -44,7 +44,6 @@ #include <sys/stat.h> #include <fcntl.h> -#include "version.h" #include "cell.h" #include "cell-utils.h" #include "utils.h" diff --git a/libcrystfel/src/thread-pool.c b/libcrystfel/src/thread-pool.c index 6824947c..7ce55d85 100644 --- a/libcrystfel/src/thread-pool.c +++ b/libcrystfel/src/thread-pool.c @@ -30,6 +30,10 @@ #include <config.h> #endif +#ifdef HAVE_CPU_AFFINITY +#define _GNU_SOURCE +#include <sched.h> +#endif #include <stdarg.h> #include <stdlib.h> @@ -39,11 +43,6 @@ #include <pthread.h> #include <assert.h> -#ifdef HAVE_CPU_AFFINITY -#include <sched.h> -#endif - - #include "utils.h" |