From 72ddc940e01a290c32c7618fdab9d4fff667431e Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Thu, 22 Aug 2019 09:38:33 +0800 Subject: [PATCH] cmake: hide internal targets Use imported library, which does not create additional rules, but still allows attaching arbitraty properties instead of custom targets. This allows the targets to not appear in the target list of IDEs such as CLion. --- tools/cmake/build.cmake | 2 +- tools/cmake/component.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index 5383581f12..f8dc4a21a3 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -129,7 +129,7 @@ endfunction() # function(__build_init idf_path) # Create the build target, to which the ESP-IDF build properties, dependencies are attached to - add_custom_target(__idf_build_target) + add_library(__idf_build_target STATIC IMPORTED) set_default(python "python") diff --git a/tools/cmake/component.cmake b/tools/cmake/component.cmake index 1ec7efcfca..d807e38587 100644 --- a/tools/cmake/component.cmake +++ b/tools/cmake/component.cmake @@ -173,7 +173,7 @@ function(__component_add component_dir prefix) # 'override' components added earlier. if(NOT component_target IN_LIST component_targets) if(NOT TARGET ${component_target}) - add_custom_target(${component_target} EXCLUDE_FROM_ALL) + add_library(${component_target} STATIC IMPORTED) endif() idf_build_set_property(__COMPONENT_TARGETS ${component_target} APPEND) endif()