From b716d2434a59b5fc88a192eea61f05779cecd96e Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Wed, 9 Sep 2020 00:48:21 +0200 Subject: [PATCH] Implement CMake version control --- .gitignore | 2 ++ CMakeLists.txt | 4 +--- src/Texture-Extractor.h | 1 + src/config.h.in | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 src/config.h.in diff --git a/.gitignore b/.gitignore index eca47f8..c16edcd 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,5 @@ Release/ .cproject .project *.launch + +src/config.h \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 458ac95..ace9e99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,10 +10,8 @@ cmake_policy(VERSION 3.1) project(rse-texture VERSION 1.0.1 DESCRIPTION "RogueSquadron Extractor - Texture" LANGUAGES C) set(CMAKE_BUILD_TYPE Release) set(RSE_TEX_NAME RSE_Texture-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY) -include(GNUInstallDirs) -#include(CheckTypeSize) -#include(CheckFunctionExists) include(CheckIncludeFile) include(CheckCSourceCompiles) diff --git a/src/Texture-Extractor.h b/src/Texture-Extractor.h index 6db89d2..a92aa5f 100644 --- a/src/Texture-Extractor.h +++ b/src/Texture-Extractor.h @@ -10,6 +10,7 @@ #include #include #endif +#include "config.h" #include "options.h" #include "HMT_Parser.h" #include "RS_images.h" diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 0000000..32f49cf --- /dev/null +++ b/src/config.h.in @@ -0,0 +1 @@ +#define VERSION "@PROJECT_VERSION@"