From 89811c1d02acd56478c67390587ec22ad29377dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Thu, 18 Oct 2018 12:04:07 +0200 Subject: [PATCH] Added new source files. --- CMakeLists.txt | 3 +++ src/global.h | 23 +++++++++++++++++++++++ src/main.c | 27 +++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 src/global.h create mode 100644 src/main.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 9773b7b..9f80a4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 2.6) project(Indivisible) set(TARGET_NAME indivisible) +set(TARGET_VERSION "v2.0") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "release") @@ -50,6 +51,8 @@ else() add_definitions("-DDEBUG") endif() +add_definitions("-DVERSION=\"${TARGET_VERSION}\"") + add_executable(${TARGET_NAME} ${SRCS}) target_link_libraries(${TARGET_NAME} diff --git a/src/global.h b/src/global.h new file mode 100644 index 0000000..f810f65 --- /dev/null +++ b/src/global.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 Ortega Froysa, Nicolás + * Author: Ortega Froysa, Nicolás + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#ifndef VERSION +# define VERSION "version" +#endif diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..ed05a94 --- /dev/null +++ b/src/main.c @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2018 Ortega Froysa, Nicolás + * Author: Ortega Froysa, Nicolás + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include + +#include "global.h" + +int main(int argc, char *argv[]) { + printf("Indivisible %s\n", VERSION); + + return 0; +}