Merge pull request #7665

15e6275 CMake: new macro - finding all headers (extract from epee) (mj-xmr)
This commit is contained in:
luigi1111 2021-05-12 14:39:39 -05:00
commit ac87ac19b2
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
2 changed files with 14 additions and 5 deletions

View file

@ -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}")