From 1a7f3415ad8b2e6871884ab3325f56021c08cdb9 Mon Sep 17 00:00:00 2001 From: illyum Date: Sun, 15 Sep 2024 02:37:09 -0600 Subject: [PATCH] chore(cmake) propagate version --- CMakeLists.txt | 8 ++++++++ engine/config.hpp.in | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 engine/config.hpp.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 10375fd..850a202 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,14 @@ ELSE () SET_TARGET_PROPERTIES(ICEngine PROPERTIES OUTPUT_NAME "ICEngine") ENDIF () +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/engine/config.hpp.in" + "${CMAKE_CURRENT_BINARY_DIR}/engine/config.hpp" +) + +target_include_directories(ICEngine PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) + + IF (BUILD_EXAMPLES) INCLUDE_DIRECTORIES(examples/server) INCLUDE_DIRECTORIES(examples/client) diff --git a/engine/config.hpp.in b/engine/config.hpp.in new file mode 100644 index 0000000..248578b --- /dev/null +++ b/engine/config.hpp.in @@ -0,0 +1,6 @@ +// +// Created by illyum on 9/15/2024. +// + +#pragma once +#define PROJECT_VERSION "@PROJECT_VERSION@" \ No newline at end of file