aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-12-28 09:39:08 +0100
committerPierre Ossman <ossman@cendio.se>2023-12-28 09:39:08 +0100
commitcd90e28dab3200e48e62a19a9a2187c5d511e01e (patch)
treebbf8c9c6eef879329e1ec4f92470a06138351f4b /vncviewer
parenteffd854bfd19654fa67ff3d39514a91a246b8ae6 (diff)
downloadtigervnc-cd90e28dab3200e48e62a19a9a2187c5d511e01e.tar.gz
tigervnc-cd90e28dab3200e48e62a19a9a2187c5d511e01e.zip
Prevent incorrect cmake usage
It's a reoccurring issue that users try to build individual components by pointing cmake at a specific subdirectory, e.g. 'cmake vncviewer'. CMake, unfortunately, has insufficient protection against this so we'll need to add a manual check. This commit only adds it to the most likely places for misuse so we don't have to pollute every CMakeLists.txt.
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/vncviewer/CMakeLists.txt b/vncviewer/CMakeLists.txt
index 3191176b..1f9c6d39 100644
--- a/vncviewer/CMakeLists.txt
+++ b/vncviewer/CMakeLists.txt
@@ -1,3 +1,7 @@
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ message(FATAL_ERROR "cmake must be invoked with the top level directory")
+endif()
+
add_executable(vncviewer
fltk/Fl_Monitor_Arrangement.cxx
fltk/Fl_Navigation.cxx