Skip to content

Commit

Permalink
Check that FLTK 1.3 is being used
Browse files Browse the repository at this point in the history
We're not compatible with FLTK 1.4 yet, so let's try to inform users
early that this will not work.
  • Loading branch information
CendioOssman committed Jan 21, 2025
1 parent a91699e commit 4dbf60a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 4dbf60a

Please sign in to comment.