option(BUILD_DEMOS "Build demos" ON)
option(BUILD_ICD "Build icd" ON)
-option(CUSTOM_GLSLANG_BIN_ROOT "Use the user defined GLSLANG_BINARY_ROOT" OFF)
-option(CUSTOM_SPIRV_TOOLS_BIN_ROOT "Use the user defined SPIRV_TOOLS*BINARY_ROOT paths" OFF)
-
-#Choose natural default paths for glslang and SPIRV-Tools binaries to support custom definition by the user on the CMake command line or in the GUI
-set(GLSLANG_BINARY_ROOT "${CMAKE_BINARY_DIR}/../glslang" CACHE STRING "User defined path to the glslang binaries for this project")
-set(SPIRV_TOOLS_BINARY_ROOT "${CMAKE_BINARY_DIR}/../SPIRV-Tools" CACHE STRING "User defined path to the SPIRV-Tools binaries for this project")
-set(SPIRV_TOOLS_OPT_BINARY_ROOT "${CMAKE_BINARY_DIR}/../SPIRV-Tools/opt" CACHE STRING "User defined path to the SPIRV-Tools-opt binaries for this project")
-
-# Define a variable for a default root location to the gslang, SPIRV-Tools and other external sources and cache it to allow the user to customize it as needed
-set(EXTERNAL_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/external" CACHE STRING "Root path to external sources such as glslang and SPIRV-Tools")
-
-
-if (WIN32)
- if(CUSTOM_GLSLANG_BIN_ROOT)
- set(GSLANG_FINAL_BINARY_PATH ${GLSLANG_BINARY_ROOT}/${BUILDTGT_DIR})
- else()
- set(GSLANG_FINAL_BINARY_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}")
- endif()
-
- if(DISABLE_BUILD_PATH_DECORATION)
- set (DEBUG_DECORATION "")
- set (RELEASE_DECORATION "")
- else()
- set (DEBUG_DECORATION "Debug")
- set (RELEASE_DECORATION "Release")
- endif()
-
- # Take some steps to set up a variable pointing to the final glslang binaries given the variety of input options
- set (GLSLANG_SEARCH_PATH "${GSLANG_FINAL_BINARY_PATH}/glslang/${RELEASE_DECORATION}"
- "${GSLANG_FINAL_BINARY_PATH}/glslang/OSDependent/Windows/${RELEASE_DECORATION}"
- "${GSLANG_FINAL_BINARY_PATH}/hlsl/${RELEASE_DECORATION}"
- "${GSLANG_FINAL_BINARY_PATH}/OGLCompilersDLL/${RELEASE_DECORATION}"
- "${GSLANG_FINAL_BINARY_PATH}/SPIRV/${RELEASE_DECORATION}" )
-
- set (GLSLANG_DEBUG_SEARCH_PATH "${GSLANG_FINAL_BINARY_PATH}/glslang/${DEBUG_DECORATION}"
- "${GSLANG_FINAL_BINARY_PATH}/glslang/OSDependent/Windows/${DEBUG_DECORATION}"
- "${GSLANG_FINAL_BINARY_PATH}/hlsl/${DEBUG_DECORATION}"
- "${GSLANG_FINAL_BINARY_PATH}/OGLCompilersDLL/${DEBUG_DECORATION}"
- "${GSLANG_FINAL_BINARY_PATH}/SPIRV/${DEBUG_DECORATION}")
-
- if(CUSTOM_SPIRV_TOOLS_BIN_ROOT)
- set (SPIRV_TOOLS_SEARCH_PATH "${SPIRV_TOOLS_BINARY_ROOT}/${BUILDTGT_DIR}/source/${RELEASE_DECORATION}")
- set (SPIRV_TOOLS_DEBUG_SEARCH_PATH "${SPIRV_TOOLS_BINARY_ROOT}/${BUILDTGT_DIR}/source/${DEBUG_DECORATION}")
- set (SPIRV_TOOLS_OPT_SEARCH_PATH "${SPIRV_TOOLS_OPT_BINARY_ROOT}/${BUILDTGT_DIR}/source/opt/${RELEASE_DECORATION}")
- set (SPIRV_TOOLS_OPT_DEBUG_SEARCH_PATH "${SPIRV_TOOLS_OPT_BINARY_ROOT}/${BUILDTGT_DIR}/source/opt/${DEBUG_DECORATION}")
- else()
- set (SPIRV_TOOLS_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/${RELEASE_DECORATION}")
- set (SPIRV_TOOLS_DEBUG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/${DEBUG_DECORATION}")
- set (SPIRV_TOOLS_OPT_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/opt/${RELEASE_DECORATION}")
- set (SPIRV_TOOLS_OPT_DEBUG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/opt/${DEBUG_DECORATION}")
- endif()
-else()
- # not WIN32
- if(CUSTOM_GLSLANG_BIN_ROOT)
- set (GLSLANG_SEARCH_PATH "${GLSLANG_BINARY_ROOT}/install/lib"
- "${GLSLANG_BINARY_ROOT}/glslang"
- "${GLSLANG_BINARY_ROOT}/glslang/OSDependent/Unix"
- "${GLSLANG_BINARY_ROOT}/OGLCompilersDLL"
- "${GLSLANG_BINARY_ROOT}/SPIRV"
- "${GLSLANG_BINARY_ROOT}/hlsl"
- "${GLSLANG_BINARY_ROOT}/StandAlone")
- else()
- set (GLSLANG_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/install/lib" "${CMAKE_SOURCE_DIR}/../x86_64/lib/glslang" )
- endif()
-
- if(CUSTOM_SPIRV_TOOLS_BIN_ROOT)
- set (SPIRV_TOOLS_SEARCH_PATH "${SPIRV_TOOLS_BINARY_ROOT}/source" )
- set (SPIRV_TOOLS_OPT_SEARCH_PATH "${SPIRV_TOOLS_OPT_BINARY_ROOT}/source/opt" )
- else()
- set (SPIRV_TOOLS_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source" "${CMAKE_SOURCE_DIR}/../x86_64/lib/spirv-tools" )
- set (SPIRV_TOOLS_OPT_SEARCH_PATH "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/External/spirv-tools/source/opt" "${CMAKE_SOURCE_DIR}/../x86_64/lib/spirv-tools" )
- endif()
-endif()
find_program(GLSLANG_VALIDATOR NAMES glslangValidator
HINTS "${EXTERNAL_SOURCE_ROOT}/glslang/${BUILDTGT_DIR}/install/bin"
"${GLSLANG_BINARY_ROOT}/StandAlone"
"${PROJECT_SOURCE_DIR}/external/${BINDATA_DIR}")
-find_path(GLSLANG_SPIRV_INCLUDE_DIR SPIRV/spirv.hpp HINTS "${EXTERNAL_SOURCE_ROOT}/glslang"
- "${CMAKE_SOURCE_DIR}/../glslang"
- DOC "Path to SPIRV/spirv.hpp")
-
-find_path(SPIRV_TOOLS_INCLUDE_DIR spirv-tools/libspirv.h HINTS "${EXTERNAL_SOURCE_ROOT}/glslang/External/spirv-tools/include"
- "${CMAKE_SOURCE_DIR}/../glslang/External/spirv-tools/include"
- DOC "Path to spirv-tools/libspirv.h")
-
-find_library(GLSLANG_LIB NAMES glslang
- HINTS ${GLSLANG_SEARCH_PATH} )
-
-find_library(OGLCompiler_LIB NAMES OGLCompiler
- HINTS ${GLSLANG_SEARCH_PATH} )
-
-find_library(OSDependent_LIB NAMES OSDependent
- HINTS ${GLSLANG_SEARCH_PATH} )
-
-find_library(HLSL_LIB NAMES HLSL
- HINTS ${GLSLANG_SEARCH_PATH} )
-
-find_library(SPIRV_LIB NAMES SPIRV
- HINTS ${GLSLANG_SEARCH_PATH} )
-
-find_library(SPIRV_REMAPPER_LIB NAMES SPVRemapper
- HINTS ${GLSLANG_SEARCH_PATH} )
-
-find_library(SPIRV_TOOLS_LIB NAMES SPIRV-Tools
- HINTS ${SPIRV_TOOLS_SEARCH_PATH} )
-
-find_library(SPIRV_TOOLS_OPT_LIB NAMES SPIRV-Tools-opt
- HINTS ${SPIRV_TOOLS_OPT_SEARCH_PATH} )
-
find_library(Vulkan_LIBRARY NAMES vulkan-1 vulkan
HINTS ${VK_SDK_PATH} )
-if (WIN32)
- add_library(glslang STATIC IMPORTED)
- add_library(OGLCompiler STATIC IMPORTED)
- add_library(OSDependent STATIC IMPORTED)
- add_library(HLSL STATIC IMPORTED)
- add_library(SPIRV STATIC IMPORTED)
- add_library(SPVRemapper STATIC IMPORTED)
-# add_library(Loader STATIC IMPORTED)
- add_library(SPIRV-Tools-opt STATIC IMPORTED)
- add_library(SPIRV-Tools STATIC IMPORTED)
-
- find_library(GLSLANG_DLIB NAMES glslangd
- HINTS ${GLSLANG_DEBUG_SEARCH_PATH} )
- find_library(OGLCompiler_DLIB NAMES OGLCompilerd
- HINTS ${GLSLANG_DEBUG_SEARCH_PATH} )
- find_library(OSDependent_DLIB NAMES OSDependentd
- HINTS ${GLSLANG_DEBUG_SEARCH_PATH} )
- find_library(HLSL_DLIB NAMES HLSLd
- HINTS ${GLSLANG_DEBUG_SEARCH_PATH} )
- find_library(SPIRV_DLIB NAMES SPIRVd
- HINTS ${GLSLANG_DEBUG_SEARCH_PATH} )
- find_library(SPIRV_REMAPPER_DLIB NAMES SPVRemapperd
- HINTS ${GLSLANG_DEBUG_SEARCH_PATH} )
- find_library(SPIRV_TOOLS_DLIB NAMES SPIRV-Toolsd
- HINTS ${SPIRV_TOOLS_DEBUG_SEARCH_PATH} )
- find_library(SPIRV_TOOLS_OPT_DLIB NAMES SPIRV-Tools-optd
- HINTS ${SPIRV_TOOLS_OPT_DEBUG_SEARCH_PATH} )
-
- set_target_properties(glslang PROPERTIES
- IMPORTED_LOCATION "${GLSLANG_LIB}"
- IMPORTED_LOCATION_DEBUG "${GLSLANG_DLIB}")
- set_target_properties(OGLCompiler PROPERTIES
- IMPORTED_LOCATION "${OGLCompiler_LIB}"
- IMPORTED_LOCATION_DEBUG "${OGLCompiler_DLIB}")
- set_target_properties(OSDependent PROPERTIES
- IMPORTED_LOCATION "${OSDependent_LIB}"
- IMPORTED_LOCATION_DEBUG "${OSDependent_DLIB}")
- set_target_properties(HLSL PROPERTIES
- IMPORTED_LOCATION "${HLSL_LIB}"
- IMPORTED_LOCATION_DEBUG "${HLSL_DLIB}")
- set_target_properties(SPIRV PROPERTIES
- IMPORTED_LOCATION "${SPIRV_LIB}"
- IMPORTED_LOCATION_DEBUG "${SPIRV_DLIB}")
- set_target_properties(SPVRemapper PROPERTIES
- IMPORTED_LOCATION "${SPIRV_REMAPPER_LIB}"
- IMPORTED_LOCATION_DEBUG "${SPIRV_REMAPPER_DLIB}")
- set_target_properties(SPIRV-Tools PROPERTIES
- IMPORTED_LOCATION "${SPIRV_TOOLS_LIB}"
- IMPORTED_LOCATION_DEBUG "${SPIRV_TOOLS_DLIB}")
- set_target_properties(SPIRV-Tools-opt PROPERTIES
- IMPORTED_LOCATION "${SPIRV_TOOLS_OPT_LIB}"
- IMPORTED_LOCATION_DEBUG "${SPIRV_TOOLS_OPT_DLIB}")
-
- set (SPIRV_TOOLS_LIBRARIES SPIRV-Tools-opt SPIRV-Tools)
- set (GLSLANG_LIBRARIES glslang OGLCompiler OSDependent HLSL SPIRV SPVRemapper ${SPIRV_TOOLS_LIBRARIES})
-else ()
- # not WIN32
- set (SPIRV_TOOLS_LIBRARIES ${SPIRV_TOOLS_OPT_LIB} ${SPIRV_TOOLS_LIB})
- set (GLSLANG_LIBRARIES ${GLSLANG_LIB} ${OGLCompiler_LIB} ${OSDependent_LIB} ${HLSL_LIB} ${SPIRV_LIB} ${SPIRV_REMAPPER_LIB} ${SPIRV_TOOLS_LIBRARIES})
-endif()
set (PYTHON_CMD ${PYTHON_EXECUTABLE})
+# Move to icd dir
# Define macro used for building vkxml generated files
macro(run_vk_xml_generate dependency output)
add_custom_command(OUTPUT ${output}
)
endmacro()
-if(NOT WIN32)
- include(GNUInstallDirs)
-
- add_definitions(-DFALLBACK_CONFIG_DIRS="${FALLBACK_CONFIG_DIRS}")
- add_definitions(-DFALLBACK_DATA_DIRS="${FALLBACK_DATA_DIRS}")
- add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
-
- # Make sure /etc is searched by the loader
- if(NOT (CMAKE_INSTALL_FULL_SYSCONFDIR STREQUAL "/etc"))
- add_definitions(-DEXTRASYSCONFDIR="/etc")
- endif()
-endif()
-
if(UNIX)
if(INSTALL_LVL_FILES)
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
-# uninstall target
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
+ # 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)
+ add_custom_target(uninstall
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
add_definitions(-DAPI_NAME="${API_NAME}")
if(BUILD_DEMOS)
add_subdirectory(demos)
endif()
-
if(BUILD_ICD)
add_subdirectory(icd)
endif()