summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-09-08 20:16:34 -0300
committerGravatar Yuri Kunde Schlesner2015-09-08 20:16:34 -0300
commit6cec3301032bb70abb99cb9aa77bf432ab714281 (patch)
tree2e505fb240cf11f0043cd40adbd07d48210b3332
parentMerge pull request #1020 from yuriks/qt-binaries (diff)
downloadyuzu-6cec3301032bb70abb99cb9aa77bf432ab714281.tar.gz
yuzu-6cec3301032bb70abb99cb9aa77bf432ab714281.tar.xz
yuzu-6cec3301032bb70abb99cb9aa77bf432ab714281.zip
CMake: Make all cache options appear even in case of errors
The `option` commands have been moved to the top of the file, so that the relevant options are registered in the CMake cache even if one of the required libraries is not found. This solves an ergonomic problem when using bundled libraries where you have to first download GLFW before being able to select the option to also download Qt.
-rw-r--r--CMakeLists.txt12
1 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0bf2df504..fa6463b01 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,13 @@ endfunction()
35 35
36project(citra) 36project(citra)
37 37
38option(ENABLE_GLFW "Enable the GLFW frontend" ON)
39option(CITRA_USE_BUNDLED_GLFW "Download bundled GLFW binaries" OFF)
40
41option(ENABLE_QT "Enable the Qt frontend" ON)
42option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF)
43option(CITRA_FORCE_QT4 "Use Qt4 even if Qt5 is available." OFF)
44
38if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit) 45if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit)
39 message(STATUS "Copying pre-commit hook") 46 message(STATUS "Copying pre-commit hook")
40 file(COPY hooks/pre-commit 47 file(COPY hooks/pre-commit
@@ -129,8 +136,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules")
129find_package(OpenGL REQUIRED) 136find_package(OpenGL REQUIRED)
130include_directories(${OPENGL_INCLUDE_DIR}) 137include_directories(${OPENGL_INCLUDE_DIR})
131 138
132option(ENABLE_GLFW "Enable the GLFW frontend" ON)
133option(CITRA_USE_BUNDLED_GLFW "Download bundled GLFW binaries" OFF)
134if (ENABLE_GLFW) 139if (ENABLE_GLFW)
135 if (CITRA_USE_BUNDLED_GLFW) 140 if (CITRA_USE_BUNDLED_GLFW)
136 # Detect toolchain and platform 141 # Detect toolchain and platform
@@ -176,9 +181,6 @@ ELSE()
176 set(PLATFORM_LIBRARIES rt) 181 set(PLATFORM_LIBRARIES rt)
177ENDIF (APPLE) 182ENDIF (APPLE)
178 183
179option(ENABLE_QT "Enable the Qt frontend" ON)
180option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF)
181option(CITRA_FORCE_QT4 "Use Qt4 even if Qt5 is available." OFF)
182if (ENABLE_QT) 184if (ENABLE_QT)
183 if (CITRA_USE_BUNDLED_QT) 185 if (CITRA_USE_BUNDLED_QT)
184 if (MSVC14 AND ARCHITECTURE_x86_64) 186 if (MSVC14 AND ARCHITECTURE_x86_64)