diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2018-12-20 19:12:50 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2018-12-20 19:12:50 +0100 |
| commit | 88129db051f0af336e15f4d02748c74c59cd3c06 (patch) | |
| tree | 7310a56b9c43f9e2d3cf082056a37c94166753a4 /CMake/options.cmake | |
| parent | a46695b7fc0c318c20779456c8e994f75899003a (diff) | |
Improve CMake's Cairo detection and issue error message...
... if Cairo was requested (OPTION_CAIRO or OPTION_CAIROEXT) but
Cairo was not found. CMake generation is terminated with a fatal error.
The user has two choices: install Cairo libs and headers or disable
OPTION_CAIRO and OPTION_CAIROEXT.
Diffstat (limited to 'CMake/options.cmake')
| -rw-r--r-- | CMake/options.cmake | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/CMake/options.cmake b/CMake/options.cmake index e94e0e937..438ff8374 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -157,27 +157,33 @@ include(FindPkgConfig) option(OPTION_CAIRO "use lib Cairo" OFF) option(OPTION_CAIROEXT - "use FLTK code instrumentation for cairo extended use" OFF + "use FLTK code instrumentation for Cairo extended use" OFF ) -if(OPTION_CAIRO OR OPTION_CAIROEXT AND LIB_CAIRO) +if ((OPTION_CAIRO OR OPTION_CAIROEXT) AND LIB_CAIRO) pkg_search_module(PKG_CAIRO cairo) -endif(OPTION_CAIRO OR OPTION_CAIROEXT AND LIB_CAIRO) +endif ((OPTION_CAIRO OR OPTION_CAIROEXT) AND LIB_CAIRO) -if(PKG_CAIRO_FOUND) - set(FLTK_HAVE_CAIRO 1) +if (PKG_CAIRO_FOUND) + set (FLTK_HAVE_CAIRO 1) add_subdirectory(cairo) list(APPEND FLTK_LDLIBS -lcairo -lpixman-1) include_directories(${PKG_CAIRO_INCLUDE_DIRS}) string(REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}") -endif(PKG_CAIRO_FOUND) +endif (PKG_CAIRO_FOUND) -if(LIB_CAIRO AND OPTION_CAIROEXT AND PKG_CAIRO_FOUND) +if (LIB_CAIRO AND OPTION_CAIROEXT AND PKG_CAIRO_FOUND) set(FLTK_USE_CAIRO 1) set(FLTK_CAIRO_FOUND TRUE) else() set(FLTK_CAIRO_FOUND FALSE) -endif(LIB_CAIRO AND OPTION_CAIROEXT AND PKG_CAIRO_FOUND) +endif (LIB_CAIRO AND OPTION_CAIROEXT AND PKG_CAIRO_FOUND) + +if ((OPTION_CAIRO OR OPTION_CAIROEXT) AND NOT PKG_CAIRO_FOUND) + message(STATUS "*** Cairo was requested but not found - please install Cairo ...") + message(STATUS "*** or disable options OPTION_CAIRO and OPTION_CAIRO_EXT") + message(FATAL_ERROR "*** Terminating: missing Cairo libs or headers") +endif ((OPTION_CAIRO OR OPTION_CAIROEXT) AND NOT PKG_CAIRO_FOUND) ####################################################################### option(OPTION_USE_NANOSVG "support SVG images" ON) |
