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 /CMakeLists.txt | |
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 15 insertions, 3 deletions
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) |