mirror of
https://github.com/ScrelliCopter/tmx2gba.git
synced 2025-02-21 03:29:25 +11:00
get version info from project file
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
cmake_minimum_required(VERSION "3.15" FATAL_ERROR)
|
cmake_minimum_required(VERSION "3.15" FATAL_ERROR)
|
||||||
project(tmx2gba VERSION "0.3")
|
project(tmx2gba
|
||||||
|
VERSION "0.7"
|
||||||
|
DESCRIPTION "Simple CLI utility for converting Tiled (.tmx) maps to GBA-friendly charmaps."
|
||||||
|
HOMEPAGE_URL "https://github.com/ScrelliCopter/tmx2gba")
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
option(TMX2GBA_DKP_INSTALL "Install into DEVKITPRO prefix" OFF)
|
option(TMX2GBA_DKP_INSTALL "Install into DEVKITPRO prefix" OFF)
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ add_executable(tmx2gba
|
|||||||
swriter.hpp swriter.cpp
|
swriter.hpp swriter.cpp
|
||||||
tmx2gba.cpp)
|
tmx2gba.cpp)
|
||||||
|
|
||||||
|
configure_file(config.h.in config.h @ONLY)
|
||||||
|
target_sources(tmx2gba PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
target_include_directories(tmx2gba PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
set_target_properties(tmx2gba PROPERTIES CXX_STANDARD 20)
|
set_target_properties(tmx2gba PROPERTIES CXX_STANDARD 20)
|
||||||
|
|
||||||
# Enable strong warnings
|
# Enable strong warnings
|
||||||
|
|||||||
6
src/config.h.in
Normal file
6
src/config.h.in
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#define TMX2GBA_VERSION "@PROJECT_VERSION@"
|
||||||
|
|
||||||
|
#endif//CONFIG_H
|
||||||
@@ -5,13 +5,12 @@
|
|||||||
#include "convert.hpp"
|
#include "convert.hpp"
|
||||||
#include "headerwriter.hpp"
|
#include "headerwriter.hpp"
|
||||||
#include "swriter.hpp"
|
#include "swriter.hpp"
|
||||||
|
#include "config.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
static const char* versionStr = "tmx2gba version 0.3, (c) 2015-2022 a dinosaur";
|
|
||||||
|
|
||||||
struct Arguments
|
struct Arguments
|
||||||
{
|
{
|
||||||
std::string inPath, outPath;
|
std::string inPath, outPath;
|
||||||
@@ -148,7 +147,7 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
if (p.showVersion)
|
if (p.showVersion)
|
||||||
{
|
{
|
||||||
std::cout << versionStr << std::endl;
|
std::cout << "tmx2gba version " << TMX2GBA_VERSION << ", (c) 2015-2024 a dinosaur" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user