From ca493a8b3b635ddae1e1bc74ef997a86f26ac027 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Mon, 28 Sep 2020 21:38:28 +0200 Subject: [PATCH] Move check for getopt.h to config-checks.cmake --- CMakeLists.txt | 5 ----- cmake/config_checks.cmake | 1 + config-cmake.h.in | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49476553a..4e1168ea7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,11 +153,6 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/builddate.h "#define BUILDDATE \"${GRAPHV message(STATUS "Graphviz version: ${GRAPHVIZ_VERSION_FULL}") -# =================== Generate config.h with proper defines ==================== -# This check for getopt is used later in the build, so it is done here. -include(CheckIncludeFile) -check_include_file(getopt.h HAVE_GETOPT_H) - include(config_checks) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/cmake/config_checks.cmake b/cmake/config_checks.cmake index aa241caa6..ca8a7dd87 100644 --- a/cmake/config_checks.cmake +++ b/cmake/config_checks.cmake @@ -18,6 +18,7 @@ check_include_file( unistd.h HAVE_UNISTD_H ) check_include_file( vfork.h HAVE_VFORK_H ) check_include_file( X11/Intrinsic.h HAVE_X11_INTRINSIC_H ) check_include_file( X11/Xaw/Text.h HAVE_X11_XAW_TEXT_H ) +check_include_file( getopt.h HAVE_GETOPT_H ) # Function checks include(CheckFunctionExists) diff --git a/config-cmake.h.in b/config-cmake.h.in index ff98abbc3..831d9364f 100644 --- a/config-cmake.h.in +++ b/config-cmake.h.in @@ -17,6 +17,7 @@ #cmakedefine HAVE_VFORK_H #cmakedefine HAVE_X11_INTRINSIC_H #cmakedefine HAVE_X11_XAW_TEXT_H +#cmakedefine HAVE_GETOPT_H // Functions #cmakedefine HAVE_DRAND48 -- 2.40.0