From 746cc0c5ff9c60a14933bb62eb761bea4d223343 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 14 Jun 2018 15:23:13 +0200 Subject: Add CMake check to find forkpty() --- libcrystfel/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libcrystfel/CMakeLists.txt') 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 -- cgit v1.2.3