diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2022-10-15 21:15:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 20:15:59 +0200 |
commit | 794685e6f97bc8e16523634409eddc5cabe9949a (patch) | |
tree | 39613eb567ae4656c6e603ac18b2ba217ab2bfcc | |
parent | bda468cf42988546cd84ab5a6f8e556cff29480a (diff) | |
download | ccache-794685e6f97bc8e16523634409eddc5cabe9949a.tar.gz |
build: Add headers to CMake project files (#1178)
Useful for listing them in the IDE project tree, for IDEs that use
CMake file api (like Qt Creator).
-rw-r--r-- | src/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/storage/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/storage/local/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/storage/remote/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/third_party/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/third_party/blake3/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/util/CMakeLists.txt | 3 | ||||
-rw-r--r-- | unittest/CMakeLists.txt | 3 |
9 files changed, 27 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6a7cb3f7..7ae93c38 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,6 +36,9 @@ if(WIN32) list(APPEND source_files Win32Util.cpp) endif() +file(GLOB headers *.hpp) +list(APPEND source_files ${headers}) + add_library(ccache_framework STATIC ${source_files}) if(WIN32) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6932336f..1fa9f707 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -14,4 +14,7 @@ set( types.cpp ) +file(GLOB headers *.hpp) +list(APPEND sources ${headers}) + target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/storage/CMakeLists.txt b/src/storage/CMakeLists.txt index e5476cc3..907d16fd 100644 --- a/src/storage/CMakeLists.txt +++ b/src/storage/CMakeLists.txt @@ -6,4 +6,7 @@ set( Storage.cpp ) +file(GLOB headers *.hpp) +list(APPEND sources ${headers}) + target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/storage/local/CMakeLists.txt b/src/storage/local/CMakeLists.txt index 88703781..7b0d4f05 100644 --- a/src/storage/local/CMakeLists.txt +++ b/src/storage/local/CMakeLists.txt @@ -9,4 +9,7 @@ set( util.cpp ) +file(GLOB headers *.hpp) +list(APPEND sources ${headers}) + target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/storage/remote/CMakeLists.txt b/src/storage/remote/CMakeLists.txt index 8d14eca1..96dbebb0 100644 --- a/src/storage/remote/CMakeLists.txt +++ b/src/storage/remote/CMakeLists.txt @@ -9,4 +9,7 @@ if(REDIS_STORAGE_BACKEND) list(APPEND sources RedisStorage.cpp) endif() +file(GLOB headers *.hpp) +list(APPEND sources ${headers}) + target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt index fe43d594..0d6ffb3e 100644 --- a/src/third_party/CMakeLists.txt +++ b/src/third_party/CMakeLists.txt @@ -14,6 +14,9 @@ if(ENABLE_TRACING) target_sources(third_party PRIVATE minitrace.c) endif() +file(GLOB headers *.h fmt/*.h nonstd/*.hpp win32/*.h) +target_sources(third_party PRIVATE ${headers}) + set(xxhdispatchtest [=[ #include "xxh_x86dispatch.c" diff --git a/src/third_party/blake3/CMakeLists.txt b/src/third_party/blake3/CMakeLists.txt index 14583773..a30342d5 100644 --- a/src/third_party/blake3/CMakeLists.txt +++ b/src/third_party/blake3/CMakeLists.txt @@ -115,3 +115,6 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8) target_compile_definitions(blake3 PRIVATE BLAKE3_USE_NEON) endif() endif() + +file(GLOB headers *.h) +target_sources(blake3 PRIVATE ${headers}) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index f3133e71..560f79f9 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -11,4 +11,7 @@ set( zstd.cpp ) +file(GLOB headers *.hpp) +list(APPEND sources ${headers}) + target_sources(ccache_framework PRIVATE ${sources}) diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index fc54fe01..e0ec8b32 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -42,6 +42,9 @@ if(WIN32) list(APPEND source_files test_bsdmkstemp.cpp test_Win32Util.cpp) endif() +file(GLOB headers *.hpp) +list(APPEND source_files ${headers}) + add_executable(unittest ${source_files}) if(MSVC) |