aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2021-07-14 14:03:43 +0100
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2021-07-15 10:05:40 +0100
commit9d2b692afd7eb7dd03958d7111068fa7cce30e55 (patch)
treeefd2ea01f60a485452394c07aa651388981358f2 /CMakeLists.txt
parentdfc9421dcf0fc97ad99638df501b95cb162e95b2 (diff)
downloadtigervnc-9d2b692afd7eb7dd03958d7111068fa7cce30e55.tar.gz
tigervnc-9d2b692afd7eb7dd03958d7111068fa7cce30e55.zip
Allow building with -DBUILD_VIEWER=OFF
Without this change I get CMake errors due to use of ${FLTK_INCLUDE_DIR} and references to the non-existent vncviewer target.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt57
1 files changed, 30 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1cd1f696..62b87a2e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -229,31 +229,33 @@ if(BUILD_JAVA)
add_subdirectory(java)
endif()
-# Check for FLTK
-set(FLTK_SKIP_FLUID TRUE)
-set(FLTK_SKIP_OPENGL TRUE)
-set(FLTK_SKIP_FORMS TRUE)
-find_package(FLTK)
-
-if(UNIX AND NOT APPLE)
- # No proper handling for extra X11 libs that FLTK might need...
- if(X11_Xft_FOUND)
- # Xft headers include references to fontconfig, so we need
- # to link to that as well
- find_library(FONTCONFIG_LIB fontconfig)
- set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xft_LIB} ${FONTCONFIG_LIB})
- endif()
- if(X11_Xinerama_FOUND)
- set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xinerama_LIB})
- endif()
- if(X11_Xfixes_FOUND)
- set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xfixes_LIB})
- endif()
- if(X11_Xcursor_FOUND)
- set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xcursor_LIB})
- endif()
- if(X11_Xrender_FOUND)
- set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xrender_LIB})
+option(BUILD_VIEWER "Build TigerVNC viewer" ON)
+if(BUILD_VIEWER)
+ # Check for FLTK
+ set(FLTK_SKIP_FLUID TRUE)
+ 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)
+ # Xft headers include references to fontconfig, so we need
+ # to link to that as well
+ find_library(FONTCONFIG_LIB fontconfig)
+ set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xft_LIB} ${FONTCONFIG_LIB})
+ endif()
+ if(X11_Xinerama_FOUND)
+ set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xinerama_LIB})
+ endif()
+ if(X11_Xfixes_FOUND)
+ set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xfixes_LIB})
+ endif()
+ if(X11_Xcursor_FOUND)
+ set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xcursor_LIB})
+ endif()
+ if(X11_Xrender_FOUND)
+ set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xrender_LIB})
+ endif()
endif()
endif()
@@ -303,7 +305,6 @@ if(ENABLE_NLS)
add_subdirectory(po)
endif()
-option(BUILD_VIEWER "Build TigerVNC viewer" ON)
if(BUILD_VIEWER)
add_subdirectory(vncviewer)
add_subdirectory(media)
@@ -312,7 +313,9 @@ endif()
add_subdirectory(tests)
-add_subdirectory(release)
+if(BUILD_VIEWER)
+ add_subdirectory(release)
+endif()
# uninstall
configure_file("${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"