소스 검색

Merge pull request #1930 from ux3d/fix/CMakeOptionalExternalBuild

find Python and add External subdir only if BUILD_EXTERNAL option was set
John Kessenich 6 년 전
부모
커밋
8ba49b862c
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      CMakeLists.txt

+ 5 - 4
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()