diff options
author | Mike Weiblen <[email protected]> | 2018-07-04 15:23:41 -0600 |
---|---|---|
committer | Mike Weiblen <[email protected]> | 2018-09-07 13:51:11 -0600 |
commit | 6b47ce4d930fbb141ce8fc6955a63b6247dacee4 (patch) | |
tree | 18c0ee39680efa91110ea8bd22994f9a8fa9615b | |
parent | 5f3d50b590b4135896ff2e89dec53180b35aab9e (diff) | |
download | Vulkan-Headers-6b47ce4d930fbb141ce8fc6955a63b6247dacee4.tar.gz Vulkan-Headers-6b47ce4d930fbb141ce8fc6955a63b6247dacee4.zip |
build: CMakeLists.txt cleanup
A cleanup of the CMake file in this repo,
for consistency with similar effort in other Vulkan repos.
clarify setting Windows install prefix if needed
project() : NONE = this project has no language toolchain requirement.
update .cmake-format.py 0.4.1
reformat using cmake-format 0.4.1
Change-Id: Ic64b335676eb6b8bd8ffd1b0d8c5468a4239287c
-rw-r--r-- | .cmake-format.py | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 18 |
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) |