To uninstall the files from the system directories, you can execute:
- sudo make uninstall-Vulkan-Tools
+ sudo make uninstall
### Linux Tests
- Building the cube and vulkaninfo applications require linking to the Vulkan Loader Library (libvulkan.1.dylib)
- The following option should be used on the cmake command line to specify a vulkan loader library:
- LOADER_REPO_ROOT=/absolute_path_to/Vulkan-Loader making sure to specify an absolute path, like so:
- cmake -DLOADER_REPO_ROOT=/absolute_path_to/Vulkan-Loader ....
+ VULKAN_LOADER_INSTALL_DIR=/absolute_path_to/Vulkan-Loader_install_dir making sure to specify an absolute path.
### MacOS build
mkdir build
cd build
- cmake -DCMAKE_BUILD_TYPE=Debug -DLOADER_REPO_ROOT=/absolute_path_to/Vulkan-Loader -DMOLTENVK_REPO_ROOT=/absolute_path_to/MoltenVK ..
+ cmake -DCMAKE_BUILD_TYPE=Debug -DVULKAN_LOADER_INSTALL_DIR=/absolute_path_to/Vulkan-Loader_install_dir -DMOLTENVK_REPO_ROOT=/absolute_path_to/MoltenVK ..
make
To speed up the build on a multi-core machine, use the `-j` option for `make`
mkdir build-xcode
cd build-xcode
- cmake -DLOADER_REPO_ROOT=/absolute_path_to/Vulkan-Loader -DMOLTENVK_REPO_ROOT=/absolute_path_to/MoltenVK -GXcode ..
+ cmake -DVULKAN_LOADER_INSTALL_DIR=/absolute_path_to/Vulkan-Loader_install_dir -DMOLTENVK_REPO_ROOT=/absolute_path_to/MoltenVK -GXcode ..
open VULKAN.xcodeproj
Within Xcode, you can select Debug or Release builds in the project's Build Settings.
# This must come before the project command.
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version")
-project (Vulkan-Tools)
-# set (CMAKE_VERBOSE_MAKEFILE 1)
+project(Vulkan-Tools)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+option(BUILD_CUBE "Build cube" ON)
+option(BUILD_VULKANINFO "Build vulkaninfo" ON)
+option(BUILD_ICD "Build icd" ON)
+# Installing the Mock ICD to system directories is probably not desired since
+# this ICD is not a very complete implementation.
+# Require the user to ask that it be installed if they really want it.
+option(INSTALL_ICD "Install icd" OFF)
+
+# Enable IDE GUI folders
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+# "Helper" targets that don't have interesting source code should set their FOLDER property to this
+set(TOOLS_TARGET_FOLDER "Helper Targets")
+
# Find Vulkan Headers and Loader
# Search order:
# User-supplied CMAKE_PREFIX_PATH containing paths to the header and/or loader install dirs
# Fallback to FindVulkan operation using SDK install or system installed components.
set(VULKAN_HEADERS_INSTALL_DIR "HEADERS-NOTFOUND" CACHE PATH "Absolute path to a Vulkan-Headers install directory")
set(VULKAN_LOADER_INSTALL_DIR "LOADER-NOTFOUND" CACHE PATH "Absolute path to a Vulkan-Loader install directory")
-set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH};${VULKAN_HEADERS_INSTALL_DIR};${VULKAN_LOADER_INSTALL_DIR};$ENV{VULKAN_HEADERS_INSTALL_DIR};$ENV{VULKAN_LOADER_INSTALL_DIR})
+set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH};${VULKAN_HEADERS_INSTALL_DIR};${VULKAN_LOADER_INSTALL_DIR};
+ $ENV{VULKAN_HEADERS_INSTALL_DIR};$ENV{VULKAN_LOADER_INSTALL_DIR})
message(STATUS "Using find_package to locate Vulkan")
find_package(Vulkan)
# "Vulkan::Vulkan" on macOS causes the framework to be linked to the app instead of an individual library
message(STATUS "Vulkan Include = ${Vulkan_INCLUDE_DIR}")
message(STATUS "Vulkan Lib = ${Vulkan_LIBRARY}")
+# Install-related settings
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)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE )
endif()
+# uninstall target
+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)
+set_target_properties(uninstall PROPERTIES FOLDER ${TOOLS_TARGET_FOLDER})
+
if(APPLE)
# CMake versions 3 or later need CMAKE_MACOSX_RPATH defined.
# This avoids the CMP0042 policy message.
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
endif()
-# Enable cmake folders
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-set(TOOLS_TARGET_FOLDER "Helper Targets")
-
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -fno-strict-aliasing -fno-builtin-memcmp")
endif()
endif()
-if(NOT WIN32)
- set (BUILDTGT_DIR build)
- set (BINDATA_DIR Bin)
- set (LIBSOURCE_DIR Lib)
-else()
- # For Windows, since 32-bit and 64-bit items can co-exist, we build each in its own build directory.
- # 32-bit target data goes in build32, and 64-bit target data goes into build. So, include/link the
- # appropriate data at build time.
- if (DISABLE_BUILDTGT_DIR_DECORATION)
- set (BUILDTGT_DIR "")
- set (BINDATA_DIR "")
- set (LIBSOURCE_DIR "")
- elseif (CMAKE_CL_64)
- set (BUILDTGT_DIR build)
- set (BINDATA_DIR Bin)
- set (LIBSOURCE_DIR Lib)
- else()
- set (BUILDTGT_DIR build32)
- set (BINDATA_DIR Bin32)
- set (LIBSOURCE_DIR Lib32)
- endif()
- if(DISABLE_BUILD_PATH_DECORATION)
- set (DEBUG_DECORATION "")
- set (RELEASE_DECORATION "")
- else()
- set (DEBUG_DECORATION "Debug")
- set (RELEASE_DECORATION "Release")
- endif()
-
-endif()
-
-option(BUILD_CUBE "Build cube" ON)
-option(BUILD_VULKANINFO "Build vulkaninfo" ON)
-option(BUILD_ICD "Build icd" ON)
-# Installing the Mock ICD to system directories is probably not desired since
-# this ICD is not a very complete implementation.
-# Require the user to ask that it be installed if they really want it.
-option(INSTALL_ICD "Install icd" OFF)
-
-# uninstall target
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
-
-add_custom_target(uninstall-Vulkan-Tools
- COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
-set_target_properties(uninstall-Vulkan-Tools PROPERTIES FOLDER ${TOOLS_TARGET_FOLDER})
-
if(APPLE)
include(mac_common.cmake)
endif()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-# LOADER_REPO_ROOT is going away soon
-# Predefine loader root as a cmake cache variable for cmake-gui
-set(LOADER_REPO_ROOT "LOADER-NOTFOUND" CACHE PATH "Absolute path to the root of the loader repository")
-
-if(LOADER_REPO_ROOT)
- message(STATUS "Using user-supplied path to locate Vulkan")
- if(WIN32)
- set (LOADER_SEARCH_PATHS
- "${LOADER_REPO_ROOT}/${BUILDTGT_DIR}/loader/${DEBUG_DECORATION}"
- "${LOADER_REPO_ROOT}/${BUILDTGT_DIR}/loader/${RELEASE_DECORATION}"
- "${LOADER_REPO_ROOT}/lib"
- "${LOADER_REPO_ROOT}/lib32"
- )
- else()
- set (LOADER_SEARCH_PATHS
- "${LOADER_REPO_ROOT}/${BUILDTGT_DIR}/loader"
- "${LOADER_REPO_ROOT}/x86_64/lib"
- "${LOADER_REPO_ROOT}/source/lib"
- )
- endif()
-
- find_library(LIBVK NAMES vulkan vulkan-1
- HINTS ${LOADER_SEARCH_PATHS}
- )
- message(STATUS "Found Vulkan: ${LIBVK}")
-endif()
-
if(WIN32)
# Use static MSVCRT libraries
foreach(configuration in CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES")
endif()
-# MacOS setup
-#if(APPLE)
-# include(macOS/common.cmake)
-#endif()
-
include_directories(
${CUBE_INCLUDE_DIRS}
)