From 03be018a473297b4b8b69d79e20d7c5d13548f97 Mon Sep 17 00:00:00 2001 From: Fabian Wahlster Date: Tue, 15 Oct 2019 11:00:23 +0200 Subject: [PATCH] find Python and add External subdir only if BUILD_EXTERNAL option was set (on by default) and /External dir exists --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6536ad1f..da25533e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ include(GNUInstallDirs) include(CMakeDependentOption) option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +option(BUILD_EXTERNAL "Build external dependencies in /External" ON) set(LIB_TYPE STATIC) @@ -148,13 +149,13 @@ endfunction(glslang_set_link_args) # CMake needs to find the right version of python, right from the beginning, # otherwise, it will find the wrong version and fail later -if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External) +if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External) find_package(PythonInterp 3 REQUIRED) + + # We depend on these for later projects, so they should come first. + add_subdirectory(External) endif() -# We depend on these for later projects, so they should come first. -add_subdirectory(External) - if(NOT TARGET SPIRV-Tools-opt) set(ENABLE_OPT OFF) endif()