2014-02-09 22:41:29 +04:00
|
|
|
#
|
2020-06-13 16:19:27 +03:00
|
|
|
# Resource definitions to build the FLTK project using CMake (www.cmake.org)
|
2024-02-07 20:30:11 +03:00
|
|
|
# Originally written by Michael Surette
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
2024-02-07 20:30:11 +03:00
|
|
|
# Copyright 1998-2024 by Bill Spitzak and others.
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
|
|
|
# This library is free software. Distribution and use rights are outlined in
|
|
|
|
# the file "COPYING" which should have been included with this file. If this
|
|
|
|
# file is missing or damaged, see the license at:
|
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/COPYING.php
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# Please see the following page on how to report bugs and issues:
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/bugs.php
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# check for headers, libraries and functions
|
|
|
|
#######################################################################
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
# If CMAKE_REQUIRED_QUIET is 1 (default) the search is mostly quiet,
|
|
|
|
# if it is 0 (or not defined) check_include_files() is more verbose
|
|
|
|
# and the result of the search is logged with fl_debug_var().
|
2018-02-23 22:41:52 +03:00
|
|
|
# This is useful for debugging.
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
set(CMAKE_REQUIRED_QUIET 1)
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
include(CheckIncludeFiles)
|
2024-08-25 18:45:42 +03:00
|
|
|
include(CheckSymbolExists)
|
|
|
|
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2024-02-13 16:47:28 +03:00
|
|
|
macro(fl_find_header VAR HEADER)
|
2024-02-07 20:30:11 +03:00
|
|
|
check_include_files("${HEADER}" ${VAR})
|
|
|
|
if(NOT CMAKE_REQUIRED_QUIET)
|
|
|
|
fl_debug_var(${VAR})
|
|
|
|
endif(NOT CMAKE_REQUIRED_QUIET)
|
2024-02-13 16:47:28 +03:00
|
|
|
endmacro(fl_find_header)
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2024-08-12 20:58:32 +03:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# find git revision and store it in the CMake cache for reference
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
# (1) Get current Git revision from `git rev-parse ...`
|
|
|
|
# (2) Read Git revision from file `fltk_git_rev.dat`
|
|
|
|
#
|
|
|
|
# (1) This can fail if the FLTK source directory is not a Git checkout,
|
|
|
|
# i.e. FLTK was downloaded as a distro (tarball).
|
|
|
|
# (2) If (1) fails the file `fltk_git_rev.dat` is read. This file is
|
|
|
|
# generated by the process to generate the distribution (makesrcdist).
|
|
|
|
#
|
|
|
|
|
|
|
|
set(git_rev_file ${FLTK_SOURCE_DIR}/fltk_git_rev.dat)
|
|
|
|
|
|
|
|
set(git_revision "") # temporary variable
|
|
|
|
|
|
|
|
execute_process(COMMAND
|
|
|
|
git rev-parse HEAD # --short=${git_rev_size} HEAD
|
|
|
|
OUTPUT_VARIABLE git_revision
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
WORKING_DIRECTORY ${FLTK_SOURCE_DIR}
|
|
|
|
ERROR_QUIET
|
|
|
|
)
|
|
|
|
|
|
|
|
if(git_revision STREQUAL "")
|
|
|
|
|
|
|
|
# Read git revision from a file generated by makesrcdist.
|
|
|
|
# This file is located in the FLTK source directory
|
|
|
|
|
|
|
|
if(EXISTS ${git_rev_file})
|
|
|
|
file(READ ${git_rev_file} git_revision)
|
|
|
|
string(STRIP "${git_revision}" git_revision)
|
|
|
|
else()
|
|
|
|
set(git_revision "unknown")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(FLTK_GIT_REVISION "${git_revision}"
|
|
|
|
CACHE STRING
|
|
|
|
"FLTK Git revision (do not change)"
|
|
|
|
FORCE)
|
|
|
|
|
|
|
|
# debug and unset temporary variables
|
|
|
|
# fl_debug_var(git_revision)
|
|
|
|
unset(git_rev_file)
|
|
|
|
unset(git_revision)
|
|
|
|
|
2021-02-28 16:56:19 +03:00
|
|
|
#######################################################################
|
|
|
|
# Include FindPkgConfig for later use of pkg-config
|
|
|
|
#######################################################################
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
include(FindPkgConfig)
|
2021-02-28 16:56:19 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
# fl_debug_var(PKG_CONFIG_FOUND)
|
|
|
|
# fl_debug_var(PKG_CONFIG_EXECUTABLE)
|
|
|
|
# fl_debug_var(PKG_CONFIG_VERSION_STRING)
|
2021-02-28 16:56:19 +03:00
|
|
|
|
2024-08-08 15:49:34 +03:00
|
|
|
#######################################################################
|
|
|
|
# GitHub Issue #1001: try to "repair" the CMake Cache
|
2024-08-23 19:00:43 +03:00
|
|
|
# GitHub Issue #1046: don't try "too hard" (see GitHub Issue)
|
2024-08-08 15:49:34 +03:00
|
|
|
#######################################################################
|
|
|
|
#
|
|
|
|
# Note: we renamed "our" CMake cache variable OPENGL_GLU_INCLUDE_DIR
|
|
|
|
# to FLTK_OPENGL_GLU_INCLUDE_DIR because the former is now defined
|
|
|
|
# in find_package(OpenGL) (FindOpenGL.cmake) since CMake 3.29.0.
|
|
|
|
#
|
2024-08-23 19:00:43 +03:00
|
|
|
# We remove "our" cache variable if OPENGL_GLU_INCLUDE_DIR is defined
|
|
|
|
# but FLTK_OPENGL_GLU_INCLUDE_DIR is not yet defined which indicates
|
|
|
|
# the first execution after the rename.
|
2024-08-08 15:49:34 +03:00
|
|
|
#
|
|
|
|
# FIXME: we can remove this code some time after the release of FLTK 1.4.0.
|
|
|
|
|
2024-08-23 19:00:43 +03:00
|
|
|
if(DEFINED OPENGL_GLU_INCLUDE_DIR AND NOT DEFINED FLTK_OPENGL_GLU_INCLUDE_DIR)
|
|
|
|
unset(OPENGL_GLU_INCLUDE_DIR)
|
|
|
|
unset(OPENGL_GLU_INCLUDE_DIR CACHE)
|
|
|
|
endif() # (DEFINED OPENGL_GLU_INCLUDE_DIR AND NOT ...)
|
2024-08-08 15:49:34 +03:00
|
|
|
|
2021-02-28 16:56:19 +03:00
|
|
|
#######################################################################
|
2018-02-23 22:41:52 +03:00
|
|
|
# Find header files...
|
2021-02-28 16:56:19 +03:00
|
|
|
#######################################################################
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD")
|
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES /usr/local/include)
|
|
|
|
endif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD")
|
|
|
|
|
2024-02-13 16:47:28 +03:00
|
|
|
fl_find_header(HAVE_ALSA_ASOUNDLIB_H alsa/asoundlib.h)
|
|
|
|
fl_find_header(HAVE_DLFCN_H dlfcn.h)
|
|
|
|
fl_find_header(HAVE_GL_GLU_H GL/glu.h)
|
|
|
|
fl_find_header(HAVE_LOCALE_H locale.h)
|
|
|
|
fl_find_header(HAVE_OPENGL_GLU_H OpenGL/glu.h)
|
|
|
|
fl_find_header(HAVE_STDIO_H stdio.h)
|
|
|
|
fl_find_header(HAVE_STRINGS_H strings.h)
|
|
|
|
fl_find_header(HAVE_SYS_SELECT_H sys/select.h)
|
|
|
|
fl_find_header(HAVE_SYS_STDTYPES_H sys/stdtypes.h)
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2024-02-13 16:47:28 +03:00
|
|
|
fl_find_header(HAVE_X11_XREGION_H "X11/Xlib.h;X11/Xregion.h")
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(WIN32 AND NOT CYGWIN)
|
2016-12-06 22:20:34 +03:00
|
|
|
# we don't use pthreads on Windows (except for Cygwin, see options.cmake)
|
2024-02-07 20:30:11 +03:00
|
|
|
set(HAVE_PTHREAD_H 0)
|
|
|
|
else()
|
2024-02-13 16:47:28 +03:00
|
|
|
fl_find_header(HAVE_PTHREAD_H pthread.h)
|
2024-02-07 20:30:11 +03:00
|
|
|
endif(WIN32 AND NOT CYGWIN)
|
2016-12-06 22:20:34 +03:00
|
|
|
|
2021-07-21 13:12:26 +03:00
|
|
|
# Do we have PTHREAD_MUTEX_RECURSIVE ?
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(HAVE_PTHREAD_H)
|
2021-07-21 13:12:26 +03:00
|
|
|
try_compile(HAVE_PTHREAD_MUTEX_RECURSIVE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/pthread_mutex_recursive.c
|
|
|
|
)
|
2024-02-07 20:30:11 +03:00
|
|
|
else()
|
|
|
|
set(HAVE_PTHREAD_MUTEX_RECURSIVE 0)
|
|
|
|
endif()
|
2021-07-21 13:12:26 +03:00
|
|
|
|
2017-03-17 20:42:50 +03:00
|
|
|
# Special case for Microsoft Visual Studio generator (MSVC):
|
|
|
|
#
|
|
|
|
# The header files <GL/glu.h> and <locale.h> are located in the SDK's
|
|
|
|
# for Visual Studio. If CMake is invoked from a desktop icon or the Windows
|
|
|
|
# menu it doesn't have the correct paths to find these header files.
|
|
|
|
# The CMake folks recommend not to search for these files at all, because
|
|
|
|
# they must always be there, but we do anyway.
|
2022-03-13 21:50:13 +03:00
|
|
|
# If we don't find them we issue a warning and continue anyway.
|
2017-03-17 20:42:50 +03:00
|
|
|
#
|
|
|
|
# Note: these cache variables can only be seen in "advanced" mode.
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(MSVC)
|
2017-03-17 20:42:50 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(NOT HAVE_GL_GLU_H)
|
|
|
|
message(STATUS "Info: Header file GL/glu.h was not found. Continuing...")
|
|
|
|
set(HAVE_GL_GLU_H 1)
|
|
|
|
endif(NOT HAVE_GL_GLU_H)
|
2017-03-17 20:42:50 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(NOT HAVE_LOCALE_H)
|
|
|
|
message(STATUS "Info: Header file locale.h was not found. Continuing...")
|
|
|
|
set(HAVE_LOCALE_H 1)
|
|
|
|
endif(NOT HAVE_LOCALE_H)
|
2017-03-17 20:42:50 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
endif(MSVC)
|
2016-08-09 17:11:42 +03:00
|
|
|
|
2015-12-31 00:13:07 +03:00
|
|
|
# Simulate the behavior of autoconf macro AC_HEADER_DIRENT, see:
|
|
|
|
# https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Headers.html
|
|
|
|
# "Check for the following header files. For the first one that is found
|
2018-02-23 22:41:52 +03:00
|
|
|
# and defines 'DIR', define the listed C preprocessor macro ..."
|
2015-12-31 00:13:07 +03:00
|
|
|
#
|
|
|
|
# Note: we don't check if it really defines 'DIR', but we stop processing
|
|
|
|
# once we found the first suitable header file.
|
|
|
|
|
2024-02-13 16:47:28 +03:00
|
|
|
fl_find_header(HAVE_DIRENT_H dirent.h)
|
2020-06-13 16:19:27 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(NOT HAVE_DIRENT_H)
|
2024-02-13 16:47:28 +03:00
|
|
|
fl_find_header(HAVE_SYS_NDIR_H sys/ndir.h)
|
2024-02-07 20:30:11 +03:00
|
|
|
if(NOT HAVE_SYS_NDIR_H)
|
2024-02-13 16:47:28 +03:00
|
|
|
fl_find_header(HAVE_SYS_DIR_H sys/dir.h)
|
2024-02-07 20:30:11 +03:00
|
|
|
if(NOT HAVE_SYS_DIR_H)
|
2024-02-13 16:47:28 +03:00
|
|
|
fl_find_header(HAVE_NDIR_H ndir.h)
|
2024-02-07 20:30:11 +03:00
|
|
|
endif(NOT HAVE_SYS_DIR_H)
|
|
|
|
endif(NOT HAVE_SYS_NDIR_H)
|
|
|
|
endif(NOT HAVE_DIRENT_H)
|
2020-06-13 16:19:27 +03:00
|
|
|
|
2018-02-23 22:41:52 +03:00
|
|
|
#----------------------------------------------------------------------
|
|
|
|
# The following code is used to find the include path for freetype
|
|
|
|
# headers to be able to #include <ft2build.h> in Xft.h.
|
|
|
|
|
2014-02-09 22:41:29 +04:00
|
|
|
# where to find freetype headers
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2024-02-13 16:47:28 +03:00
|
|
|
find_path(FREETYPE_PATH freetype.h PATH_SUFFIXES freetype2)
|
|
|
|
find_path(FREETYPE_PATH freetype/freetype.h PATH_SUFFIXES freetype2)
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2024-05-03 09:33:56 +03:00
|
|
|
if(FREETYPE_PATH AND ((NOT APPLE) OR FLTK_BACKEND_X11))
|
2024-02-07 20:30:11 +03:00
|
|
|
list(APPEND FLTK_BUILD_INCLUDE_DIRECTORIES ${FREETYPE_PATH})
|
2024-05-03 09:33:56 +03:00
|
|
|
endif(FREETYPE_PATH AND ((NOT APPLE) OR FLTK_BACKEND_X11))
|
2018-02-23 22:41:52 +03:00
|
|
|
|
2024-02-13 16:47:28 +03:00
|
|
|
mark_as_advanced(FREETYPE_PATH)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# libraries
|
2024-02-13 16:47:28 +03:00
|
|
|
find_library(LIB_dl dl)
|
2024-02-07 20:30:11 +03:00
|
|
|
if((NOT APPLE) OR FLTK_BACKEND_X11)
|
2024-02-13 16:47:28 +03:00
|
|
|
find_library(LIB_fontconfig fontconfig)
|
2024-02-07 20:30:11 +03:00
|
|
|
endif((NOT APPLE) OR FLTK_BACKEND_X11)
|
2024-02-13 16:47:28 +03:00
|
|
|
find_library(LIB_freetype freetype)
|
|
|
|
find_library(LIB_GL GL)
|
|
|
|
find_library(LIB_MesaGL MesaGL)
|
|
|
|
find_library(LIB_jpeg jpeg)
|
|
|
|
find_library(LIB_png png)
|
|
|
|
find_library(LIB_zlib z)
|
2024-04-02 16:58:55 +03:00
|
|
|
find_library(LIB_m m)
|
2024-02-13 16:47:28 +03:00
|
|
|
|
|
|
|
mark_as_advanced(LIB_dl LIB_fontconfig LIB_freetype)
|
2024-05-01 18:31:17 +03:00
|
|
|
mark_as_advanced(LIB_GL LIB_MesaGL)
|
2024-02-13 16:47:28 +03:00
|
|
|
mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)
|
2024-04-02 16:58:55 +03:00
|
|
|
mark_as_advanced(LIB_m)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# functions
|
2024-02-07 20:30:11 +03:00
|
|
|
include(CheckFunctionExists)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2024-04-05 18:06:27 +03:00
|
|
|
# Save CMAKE_REQUIRED_LIBRARIES
|
|
|
|
# Note: CMAKE_REQUIRED_LIBRARIES must be set for each search and
|
|
|
|
# reset after the search to avoid to influence subsequent searches.
|
|
|
|
# The original value is restored after all searches.
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(DEFINED CMAKE_REQUIRED_LIBRARIES)
|
|
|
|
set(SAVED_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
|
2024-04-05 18:06:27 +03:00
|
|
|
else()
|
2024-02-07 20:30:11 +03:00
|
|
|
unset(SAVED_REQUIRED_LIBRARIES)
|
2024-04-05 18:06:27 +03:00
|
|
|
endif()
|
2024-02-07 20:30:11 +03:00
|
|
|
set(CMAKE_REQUIRED_LIBRARIES)
|
|
|
|
|
|
|
|
if(HAVE_DLFCN_H)
|
|
|
|
set(HAVE_DLFCN_H 1)
|
|
|
|
endif(HAVE_DLFCN_H)
|
|
|
|
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
|
2024-08-31 17:59:03 +03:00
|
|
|
check_symbol_exists(dlsym "dlfcn.h" HAVE_DLSYM)
|
2024-02-07 20:30:11 +03:00
|
|
|
set(CMAKE_REQUIRED_LIBRARIES)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2024-08-31 17:59:03 +03:00
|
|
|
check_symbol_exists(localeconv "locale.h" HAVE_LOCALECONV)
|
2015-12-31 00:13:07 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(LIB_png)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${LIB_png})
|
2024-08-31 17:59:03 +03:00
|
|
|
check_symbol_exists(png_get_valid "png.h" HAVE_PNG_GET_VALID)
|
|
|
|
check_symbol_exists(png_set_tRNS_to_alpha "png.h" HAVE_PNG_SET_TRNS_TO_ALPHA)
|
2024-02-07 20:30:11 +03:00
|
|
|
set(CMAKE_REQUIRED_LIBRARIES)
|
|
|
|
endif(LIB_png)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2024-08-31 17:59:03 +03:00
|
|
|
check_symbol_exists(scandir "dirent.h" HAVE_SCANDIR)
|
|
|
|
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
|
|
|
# not really true but we convert strcasecmp calls to _stricmp calls in flstring.h
|
2024-02-07 20:30:11 +03:00
|
|
|
if(MSVC)
|
|
|
|
set(HAVE_STRCASECMP 1)
|
|
|
|
endif(MSVC)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2024-08-31 17:59:03 +03:00
|
|
|
check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2024-08-31 17:59:03 +03:00
|
|
|
check_symbol_exists(strlcat "string.h" HAVE_STRLCAT)
|
|
|
|
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
|
|
|
|
check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2024-08-31 17:59:03 +03:00
|
|
|
check_symbol_exists(setenv "stdlib.h" HAVE_SETENV)
|
2024-03-19 00:29:50 +03:00
|
|
|
|
2024-04-05 18:06:27 +03:00
|
|
|
# Windows doesn't require '-lm' for trunc(), other platforms do
|
|
|
|
if(LIB_m AND NOT WIN32)
|
2024-04-02 16:58:55 +03:00
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${LIB_m})
|
2024-04-05 18:06:27 +03:00
|
|
|
endif()
|
2024-08-25 18:45:42 +03:00
|
|
|
|
2024-08-31 17:59:03 +03:00
|
|
|
check_symbol_exists(trunc "math.h" HAVE_TRUNC)
|
2024-08-25 18:45:42 +03:00
|
|
|
|
2024-04-05 18:06:27 +03:00
|
|
|
set(CMAKE_REQUIRED_LIBRARIES)
|
2024-04-02 16:58:55 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
|
|
|
|
set(MSG "POSIX compatible scandir")
|
|
|
|
message(STATUS "Looking for ${MSG}")
|
2014-02-09 22:41:29 +04:00
|
|
|
try_compile(V
|
2018-01-10 23:49:03 +03:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/posixScandir.cxx
|
2014-02-09 22:41:29 +04:00
|
|
|
)
|
2024-02-07 20:30:11 +03:00
|
|
|
if(V)
|
|
|
|
message(STATUS "${MSG} - found")
|
|
|
|
set(HAVE_SCANDIR_POSIX 1 CACHE INTERNAL "")
|
2014-02-09 22:41:29 +04:00
|
|
|
else()
|
2024-02-07 20:30:11 +03:00
|
|
|
message(STATUS "${MSG} - not found")
|
|
|
|
set(HAVE_SCANDIR_POSIX HAVE_SCANDIR_POSIX-NOTFOUND)
|
|
|
|
endif(V)
|
|
|
|
endif(HAVE_SCANDIR AND NOT HAVE_SCANDIR_POSIX)
|
2024-02-13 16:47:28 +03:00
|
|
|
mark_as_advanced(HAVE_SCANDIR_POSIX)
|
2015-04-26 00:42:51 +03:00
|
|
|
|
2024-04-05 18:06:27 +03:00
|
|
|
# restore CMAKE_REQUIRED_LIBRARIES
|
2024-02-07 20:30:11 +03:00
|
|
|
if(DEFINED SAVED_REQUIRED_LIBRARIES)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${SAVED_REQUIRED_LIBRARIES})
|
|
|
|
unset(SAVED_REQUIRED_LIBRARIES)
|
2024-04-05 18:06:27 +03:00
|
|
|
else()
|
2024-02-07 20:30:11 +03:00
|
|
|
unset(CMAKE_REQUIRED_LIBRARIES)
|
2024-04-05 18:06:27 +03:00
|
|
|
endif()
|
2015-12-31 00:13:07 +03:00
|
|
|
|
2015-04-26 00:42:51 +03:00
|
|
|
#######################################################################
|
|
|
|
# packages
|
|
|
|
|
|
|
|
# Doxygen: necessary for HTML and PDF docs
|
2024-04-05 18:06:27 +03:00
|
|
|
find_package(Doxygen)
|
2015-04-26 00:42:51 +03:00
|
|
|
|
|
|
|
# LaTex: necessary for PDF docs (note: FindLATEX doesn't return LATEX_FOUND)
|
|
|
|
|
|
|
|
# Note: we only check existence of `latex' (LATEX_COMPILER), hence
|
|
|
|
# building the pdf docs may still fail because of other missing tools.
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
set(LATEX_FOUND)
|
|
|
|
if(DOXYGEN_FOUND)
|
2024-04-05 18:06:27 +03:00
|
|
|
find_package(LATEX)
|
2024-02-07 20:30:11 +03:00
|
|
|
if(LATEX_COMPILER AND NOT LATEX_FOUND)
|
|
|
|
set(LATEX_FOUND YES)
|
|
|
|
endif(LATEX_COMPILER AND NOT LATEX_FOUND)
|
|
|
|
endif(DOXYGEN_FOUND)
|
2015-04-26 00:42:51 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
# message("Doxygen found : ${DOXYGEN_FOUND}")
|
|
|
|
# message("LaTex found : ${LATEX_FOUND}")
|
|
|
|
# message("LaTex Compiler : ${LATEX_COMPILER}")
|
2016-06-14 01:32:01 +03:00
|
|
|
|
2018-02-23 22:41:52 +03:00
|
|
|
# Cleanup: unset local variables
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
unset(CMAKE_REQUIRED_QUIET)
|