aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2018-05-22 08:40:49 -0600
committerMark Lobodzinski <mark@lunarg.com>2018-05-22 08:43:13 -0600
commitebda227dc0f9324907245bc46832389068459fd7 (patch)
tree11f6b6321ed49246778221fc285fc344974d7f8a
parent3bd0e40e15672c32cf3fdda47e5bf971f80e4e8d (diff)
downloadusermoji-ebda227dc0f9324907245bc46832389068459fd7.tar.xz
cube: Change glslang location logic for INSTALL_DIR
Now respects GLSLANG_INSTALL_DIR, for instance, if Vulkan-Tools is a submodule of another repository. Also updated build doc.
-rw-r--r--BUILD.md14
-rw-r--r--cube/CMakeLists.txt28
2 files changed, 23 insertions, 19 deletions
diff --git a/BUILD.md b/BUILD.md
index 78a6d927..236e0bde 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -558,23 +558,21 @@ requiring that the LIB, INCLUDE, and PATHenv variables be set to the WDK paths b
## Custom glslang version
The Glslang repository is not a git sub-module of Vulkan-Tools, but glslang components are required to build
-the cube and vulkaninfo applications. By default, the cmake scripts will download the required
+the cube and cubepp applications. By default, the cmake scripts will download the required
components into the repo 'glslang' directory.
-If a specific version of the glslang components is desired, perform the following steps:
+If a *specific* version of the glslang components is desired, perform the following steps:
1) clone the glslang repository:
`git clone https://github.com/KhronosGroup/glslang.git`
-2) Configure the glslang source tree with CMake and build it with your IDE of choice
+2) Configure the glslang source tree with CMake and build it with your IDE of choice, following the instructions
+ in the glslang BUILD.md document including using the INSTALL_PREFIX and 'make install'. Note the install directory.
-3) Pass the location of the glslang repository using an absolute path via your cmake command like so:
+3) Pass the location of the glslang install directory using an absolute path via your cmake command like so:
- cmake -DGLSLANG_REPO_ROOT=c:\absolute_path_to\glslang
-
-4) If building on Windows with MSVC, set `DISABLE_BUILDTGT_DIR_DECORATION` to _On_.
- If building on Windows, but without MSVC set `DISABLE_BUILD_PATH_DECORATION` to _On_
+ cmake -DGLSLANG_INSTALL_DIR=c:\absolute_path_to\glslang\build\install
## Optional software packages
diff --git a/cube/CMakeLists.txt b/cube/CMakeLists.txt
index c90ab904..a6db96cc 100644
--- a/cube/CMakeLists.txt
+++ b/cube/CMakeLists.txt
@@ -8,7 +8,23 @@ set(PYTHON_CMD ${PYTHON_EXECUTABLE})
set(SCRIPTS_DIR "${PROJECT_SOURCE_DIR}/scripts")
-if(NOT DEFINED GLSLANG_REPO_ROOT)
+
+if(DEFINED GLSLANG_INSTALL_DIR)
+ message(STATUS "Using GLSLANG_INSTALL_DIR to look for glslangValidator")
+ find_program(GLSLANG_VALIDATOR names glslangValidator
+ HINTS "${GLSLANG_INSTALL_DIR}/bin"
+ )
+elseif(DEFINED GLSLANG_REPO_ROOT)
+ message(STATUS "Using glslang_repo_root to look for glslangValidator")
+ find_program(GLSLANG_VALIDATOR names glslangValidator
+ HINTS "${GLSLANG_REPO_ROOT}/build/standalone/release"
+ HINTS "${GLSLANG_REPO_ROOT}/build/standalone/debug"
+ HINTS "${GLSLANG_REPO_ROOT}/build/StandAlone"
+ HINTS "${GLSLANG_REPO_ROOT}/dbuild/StandAlone"
+ HINTS "${GLSLANG_REPO_ROOT}/build32/standalone/release"
+ HINTS "${GLSLANG_REPO_ROOT}/build32/standalone/debug"
+ )
+else()
set(GLSLANG_VALIDATOR_NAME "glslangValidator")
message(STATUS "Using cmake find_program to look for glslangValidator")
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
@@ -22,16 +38,6 @@ if(NOT DEFINED GLSLANG_REPO_ROOT)
find_program(GLSLANG_VALIDATOR NAMES ${GLSLANG_VALIDATOR_NAME}
HINTS "${PROJECT_SOURCE_DIR}/glslang/bin"
)
-else()
- message(STATUS "Using glslang_repo_root to look for glslangValidator")
- find_program(GLSLANG_VALIDATOR names glslangValidator
- HINTS "${GLSLANG_REPO_ROOT}/build/standalone/release"
- HINTS "${GLSLANG_REPO_ROOT}/build/standalone/debug"
- HINTS "${GLSLANG_REPO_ROOT}/build/StandAlone"
- HINTS "${GLSLANG_REPO_ROOT}/dbuild/StandAlone"
- HINTS "${GLSLANG_REPO_ROOT}/build32/standalone/release"
- HINTS "${GLSLANG_REPO_ROOT}/build32/standalone/debug"
- )
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")