diff options
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | contrib/epee/src/CMakeLists.txt | 7 |
2 files changed, 14 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e858b3aaf..511c62a4e 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}") diff --git a/contrib/epee/src/CMakeLists.txt b/contrib/epee/src/CMakeLists.txt index 368f49c95..0f0a6ecad 100644 --- a/contrib/epee/src/CMakeLists.txt +++ b/contrib/epee/src/CMakeLists.txt @@ -28,11 +28,8 @@ set(EPEE_INCLUDE_DIR_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../include") -# Adding headers to the file list, to be able to search for them in IDEs. -file(GLOB EPEE_HEADERS_PUBLIC - "${EPEE_INCLUDE_DIR_BASE}/*.h*" # h* will include hpps as well. - "${EPEE_INCLUDE_DIR_BASE}/**/*.h*" # Any number of subdirs will be included. -) +# Add headers to the file list, to be able to search for them and autosave in IDEs. +monero_find_all_headers(EPEE_HEADERS_PUBLIC "${EPEE_INCLUDE_DIR_BASE}") add_library(epee STATIC byte_slice.cpp byte_stream.cpp hex.cpp abstract_http_client.cpp http_auth.cpp mlog.cpp net_helper.cpp net_utils_base.cpp string_tools.cpp wipeable_string.cpp levin_base.cpp memwipe.c connection_basic.cpp network_throttle.cpp network_throttle-detail.cpp mlocker.cpp buffer.cpp net_ssl.cpp |