CMake: normalize FOLDER property for third_party targets Rather than set the FOLDER property from within certain third-party CMakeLists.txt, do so from the root, and make them all go to a "third_party" folder. Bug: b/145758253 Change-Id: I7b9f69a8f16be8ef6e0d153fc28ac4f6c3d64e5e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48368 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com> Tested-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c68435..a966fc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -577,12 +577,15 @@ # LLVM ########################################################### add_subdirectory(${THIRD_PARTY_DIR}/llvm-${SWIFTSHADER_LLVM_VERSION} EXCLUDE_FROM_ALL) +set_target_properties(llvm PROPERTIES FOLDER "third_party") ########################################################### # Subzero ########################################################### add_subdirectory(${THIRD_PARTY_DIR}/llvm-subzero EXCLUDE_FROM_ALL) add_subdirectory(${THIRD_PARTY_DIR}/subzero EXCLUDE_FROM_ALL) +set_target_properties(llvm-subzero PROPERTIES FOLDER "third_party") +set_target_properties(subzero PROPERTIES FOLDER "third_party") ########################################################### # marl @@ -590,6 +593,7 @@ if(BUILD_MARL) set(MARL_THIRD_PARTY_DIR ${THIRD_PARTY_DIR}) add_subdirectory(${THIRD_PARTY_DIR}/marl) + set_target_properties(marl PROPERTIES FOLDER "third_party") endif() if(MARL_THREAD_SAFETY_ANALYSIS_SUPPORTED) @@ -609,6 +613,7 @@ ########################################################### if(SWIFTSHADER_ENABLE_ASTC) add_subdirectory(${THIRD_PARTY_DIR}/astc-encoder) + set_target_properties(astc-encoder PROPERTIES FOLDER "third_party") endif() ########################################################### @@ -621,6 +626,10 @@ # gtest finds python, which picks python 2 first, if present. # We need to undo this so that SPIR-V can later find python3. unset(PYTHON_EXECUTABLE CACHE) + set_target_properties(gmock PROPERTIES FOLDER "third_party") + set_target_properties(gmock_main PROPERTIES FOLDER "third_party") + set_target_properties(gtest PROPERTIES FOLDER "third_party") + set_target_properties(gtest_main PROPERTIES FOLDER "third_party") endif() ########################################################### @@ -901,6 +910,8 @@ if (NOT TARGET benchmark::benchmark) set(BENCHMARK_ENABLE_TESTING FALSE CACHE BOOL FALSE FORCE) add_subdirectory(${THIRD_PARTY_DIR}/benchmark) + set_target_properties(benchmark PROPERTIES FOLDER "third_party") + set_target_properties(benchmark_main PROPERTIES FOLDER "third_party") endif() if (NOT TARGET glslang)
diff --git a/third_party/astc-encoder/CMakeLists.txt b/third_party/astc-encoder/CMakeLists.txt index e8a5646..06d23c5 100644 --- a/third_party/astc-encoder/CMakeLists.txt +++ b/third_party/astc-encoder/CMakeLists.txt
@@ -39,7 +39,6 @@ set_target_properties(astc-encoder PROPERTIES POSITION_INDEPENDENT_CODE 1 - FOLDER "Core" ) target_include_directories(astc-encoder
diff --git a/third_party/llvm-10.0/CMakeLists.txt b/third_party/llvm-10.0/CMakeLists.txt index c5e1a86..e0a4416 100644 --- a/third_party/llvm-10.0/CMakeLists.txt +++ b/third_party/llvm-10.0/CMakeLists.txt
@@ -1199,7 +1199,6 @@ set_target_properties(llvm PROPERTIES POSITION_INDEPENDENT_CODE 1 - FOLDER "LLVM" ) target_include_directories(llvm
diff --git a/third_party/llvm-subzero/CMakeLists.txt b/third_party/llvm-subzero/CMakeLists.txt index eb08fc4..03b63b7 100644 --- a/third_party/llvm-subzero/CMakeLists.txt +++ b/third_party/llvm-subzero/CMakeLists.txt
@@ -229,7 +229,6 @@ set_target_properties(llvm-subzero PROPERTIES POSITION_INDEPENDENT_CODE 1 - FOLDER "Subzero" ) target_include_directories(llvm-subzero
diff --git a/third_party/subzero/CMakeLists.txt b/third_party/subzero/CMakeLists.txt index 031a6d3..ab337a7 100644 --- a/third_party/subzero/CMakeLists.txt +++ b/third_party/subzero/CMakeLists.txt
@@ -93,7 +93,6 @@ set_target_properties(subzero PROPERTIES POSITION_INDEPENDENT_CODE 1 - FOLDER "Subzero" ) target_include_directories(subzero