aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-06-14 15:23:13 +0200
committerThomas White <taw@physics.org>2018-06-14 17:15:01 +0200
commit746cc0c5ff9c60a14933bb62eb761bea4d223343 (patch)
tree61ba1a40362c4d8132e5f19803fbcdbd48a8812a /libcrystfel/CMakeLists.txt
parented31303341ad073c4ed3468fb97f236d8b0d01ab (diff)
Add CMake check to find forkpty()
Diffstat (limited to 'libcrystfel/CMakeLists.txt')
-rw-r--r--libcrystfel/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/libcrystfel/CMakeLists.txt b/libcrystfel/CMakeLists.txt
index 311cb790..82c29446 100644
--- a/libcrystfel/CMakeLists.txt
+++ b/libcrystfel/CMakeLists.txt
@@ -22,6 +22,15 @@ unset(CMAKE_REQUIRED_DEFINITIONS)
# Check for nice clock function
check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+# 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 ( NOT(HAVE_FORKPTY_PTY_H OR HAVE_FORKPTY_UTIL_H) )
+ message(FATAL_ERROR "Couldn't find forkpty()")
+endif()
+
configure_file(config.h.cmake.in config.h)
set(LIBCRYSTFEL_SOURCES