From 58240fa2e1ac4234cf67374349ce606f1b6df643 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Sun, 7 Jan 2024 16:15:57 +0100 Subject: Use configure_file instead of setting compile defs This should avoid unnecessary recompiles of the whole project when the git hash changes and the project is reconfigured. --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ac0bc1d..68c3d28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,11 +119,8 @@ else() endif() endif() -if (GIT_DESCRIBE_TEXT) - target_compile_definitions(ActorViewer PRIVATE GIT_DESCRIBE_TEXT=${GIT_DESCRIBE_TEXT}) -else() - target_compile_definitions(ActorViewer PRIVATE GIT_COMMIT_HASH=${GIT_COMMIT_HASH}) -endif() +configure_file(gen/git_version.h.in gen/git_version.h) +target_include_directories(ActorViewer PRIVATE gen) target_link_libraries(ActorViewer PRIVATE Qt${QT_VERSION_MAJOR}::Widgets mastodonpp) -- cgit v1.2.3-54-g00ecf