aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.cmake-format.py2
-rw-r--r--CMakeLists.txt18
2 files changed, 16 insertions, 4 deletions
diff --git a/.cmake-format.py b/.cmake-format.py
index 9c173ac..07d2f99 100644
--- a/.cmake-format.py
+++ b/.cmake-format.py
@@ -1,4 +1,4 @@
-# Configuration for cmake-format (v0.3.6, circa Apr 2018)
+# Configuration for cmake-format (v0.4.1, circa Jul 2018)
# https://github.com/cheshirekow/cmake_format
# How wide to allow formatted cmake files
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb95d64..5529e60 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,22 +15,34 @@
# limitations under the License.
# ~~~
+# CMake project initialization ---------------------------------------------------------------------------------------------------
+# This section contains pre-project() initialization, and ends with the project() command.
+
cmake_minimum_required(VERSION 2.8.11)
+# NONE = this project has no language toolchain requirement.
project(Vulkan-Headers NONE)
+# User-interface declarations ----------------------------------------------------------------------------------------------------
+# This section contains variables that affect development GUIs (e.g. CMake GUI and IDEs), such as option(), folders, and variables
+# with the CACHE property.
+
include(GNUInstallDirs)
-# Set a better default install location for Windows only if the user did not provide one.
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
+
+if(WIN32 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ # Windows: if install locations not set by user, set install prefix to "<build_dir>\install".
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE)
endif()
+# --------------------------------------------------------------------------------------------------------------------------------
+
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY "${CMAKE_SOURCE_DIR}/registry" DESTINATION ${CMAKE_INSTALL_DATADIR}/vulkan)
# uninstall target
if(NOT TARGET uninstall)
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE
@ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)