Pārlūkot izejas kodu

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.
pull/1714/head
Pierre Ossman pirms 4 mēnešiem
vecāks
revīzija
cd90e28dab
4 mainītis faili ar 16 papildinājumiem un 0 dzēšanām
  1. 4
    0
      tests/CMakeLists.txt
  2. 4
    0
      unix/CMakeLists.txt
  3. 4
    0
      vncviewer/CMakeLists.txt
  4. 4
    0
      win/CMakeLists.txt

+ 4
- 0
tests/CMakeLists.txt Parādīt failu

@@ -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()

# Benchmarking tools
add_subdirectory(perf)


+ 4
- 0
unix/CMakeLists.txt Parādīt failu

@@ -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_subdirectory(tx)
add_subdirectory(common)
add_subdirectory(vncconfig)

+ 4
- 0
vncviewer/CMakeLists.txt Parādīt failu

@@ -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

+ 4
- 0
win/CMakeLists.txt Parādīt failu

@@ -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()

include_directories(${CMAKE_SOURCE_DIR}/common ${CMAKE_SOURCE_DIR}/win)

configure_file(resdefs.h.in ${CMAKE_CURRENT_BINARY_DIR}/resdefs.h)

Notiek ielāde…
Atcelt
Saglabāt