aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authormj-xmr <mjxmr@protonmail.com>2021-04-16 08:50:52 +0200
committermj-xmr <mjxmr@protonmail.com>2021-04-16 09:28:43 +0200
commit15e627569b16c143b3fc6e517c71b3a00f23e6d0 (patch)
tree3368ef6de0504d79ecf210e3558cfbb52a376c63 /CMakeLists.txt
parentMerge pull request #7650 (diff)
downloadmonero-15e627569b16c143b3fc6e517c71b3a00f23e6d0.tar.xz
CMake: new macro - finding all headers (extract from epee)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 953707657..a39e2ed44 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -164,6 +164,18 @@ function (monero_add_minimal_executable name)
monero_set_target_no_relink( ${name} )
endfunction()
+# Finds all headers in a directory and its subdirs, to be able to search for them and autosave in IDEs.
+#
+# Parameters:
+# - headers_found: Output variable, which will hold the found headers
+# - module_root_dir: The search path for the headers. Typically it will be the module's root dir.
+macro (monero_find_all_headers headers_found module_root_dir)
+ file(GLOB ${headers_found}
+ "${module_root_dir}/*.h*" # h* will include hpps as well.
+ "${module_root_dir}/**/*.h*" # Any number of subdirs will be included.
+)
+endmacro()
+
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}")