From 045c0bae56b70a12b24ae29fcd5a3852310f2c6e Mon Sep 17 00:00:00 2001 From: gitlost Date: Wed, 3 Mar 2021 13:58:32 +0000 Subject: [PATCH] #219 frontend cmake: compile bundled getopt if not available, props Schaich Alonso --- frontend/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/CMakeLists.txt b/frontend/CMakeLists.txt index 05db17d2..d731ac9f 100644 --- a/frontend/CMakeLists.txt +++ b/frontend/CMakeLists.txt @@ -2,7 +2,15 @@ project(zint_frontend) -set(zint_frontend_SRCS main.c ) +include(CheckFunctionExists) + +check_function_exists(getopt HAVE_GETOPT) + +set(zint_frontend_SRCS main.c) + +if(NOT HAVE_GETOPT) + set(zint_frontend_SRCS ${zint_frontend_SRCS} getopt.c getopt1.c) +endif(NOT HAVE_GETOPT) include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend")