diff options
author | Pierre Ossman <ossman@cendio.se> | 2025-01-21 15:48:50 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2025-01-21 17:03:34 +0100 |
commit | 4dbf60a831eac6aaf19d810c04dda6adb3ed265a (patch) | |
tree | 34c75fb4da7194596021b60aff43239e39d760d1 /CMakeLists.txt | |
parent | a91699ec469846816ddb7b1b670d660d923ff022 (diff) | |
download | tigervnc-4dbf60a831eac6aaf19d810c04dda6adb3ed265a.tar.gz tigervnc-4dbf60a831eac6aaf19d810c04dda6adb3ed265a.zip |
Check that FLTK 1.3 is being used
We're not compatible with FLTK 1.4 yet, so let's try to inform users
early that this will not work.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e226f172..e6b84601 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,6 +278,7 @@ if(BUILD_VIEWER) set(FLTK_SKIP_OPENGL TRUE) set(FLTK_SKIP_FORMS TRUE) find_package(FLTK REQUIRED) + if(UNIX AND NOT APPLE) # No proper handling for extra X11 libs that FLTK might need... if(X11_Xft_FOUND) @@ -299,6 +300,19 @@ if(BUILD_VIEWER) set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xrender_LIB}) endif() endif() + + set(CMAKE_REQUIRED_FLAGS "-Wno-error") + set(CMAKE_REQUIRED_INCLUDES ${FLTK_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${FLTK_LIBRARIES}) + + check_cxx_source_compiles("#include <FL/Fl.H>\n#if FL_MAJOR_VERSION != 1 || FL_MINOR_VERSION != 3\n#error Wrong FLTK version\n#endif\nint main(int, char**) { return 0; }" OK_FLTK_VERSION) + if(NOT OK_FLTK_VERSION) + message(FATAL_ERROR "Incompatible version of FLTK") + endif() + + set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) endif() # Check for GNUTLS library |