aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--config.h.cmake.in5
-rw-r--r--libcrystfel/CMakeLists.txt5
-rw-r--r--libcrystfel/src/integration.c8
4 files changed, 12 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 170a7c36..e13d9c5a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,7 @@ find_package(PINKINDEXER)
find_package(NBP)
find_package(FDIP)
find_package(OpenCL)
+find_package(Curses)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
@@ -55,6 +56,7 @@ set(HAVE_OPENCL ${OpenCL_FOUND})
set(HAVE_CBFLIB ${CBF_FOUND})
set(HAVE_GDKPIXBUF ${GDKPIXBUF_FOUND})
set(HAVE_GDK ${GDK_FOUND})
+set(HAVE_CURSES ${CURSES_FOUND})
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(stdlib.h HAVE_STDLIB_H)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 5cf46cdd..d30e2485 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -10,6 +10,7 @@
#cmakedefine HAVE_TIFF
#cmakedefine HAVE_XGANDALF
#cmakedefine HAVE_FDIP
+#cmakedefine HAVE_CURSES
/* We avoid adding the full path to cbf.h, because CBFlib unhelpfully installs
* some conflicting HDF5 headers which we want to keep out of the include path.
@@ -19,10 +20,6 @@
#cmakedefine HAVE_CBF_CBF_H
#cmakedefine HAVE_CBFLIB_CBF_H
-/* Implement us .... */
-#undef HAVE_CURSES
-#undef HAVE_CURSES_COLOR
-
#define PACKAGE_VERSION "0.6.3"
#define CRYSTFEL_VERSIONSTRING "+@GIT_SHA1@"
diff --git a/libcrystfel/CMakeLists.txt b/libcrystfel/CMakeLists.txt
index 9a05c1a0..5d0ee069 100644
--- a/libcrystfel/CMakeLists.txt
+++ b/libcrystfel/CMakeLists.txt
@@ -111,6 +111,11 @@ if (CBF_FOUND)
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
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index c18ae110..d7a34954 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;