From 0a3323cdad36bb9f46917fe67f6afef0a047702a Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Wed, 17 Jun 2020 01:02:53 +0200 Subject: [PATCH] add: VERSION in CMakeLists --- CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58bb939..60e25c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,16 @@ cmake_minimum_required (VERSION 3.7) -project(core) +project(core + VERSION 0.1.0 + LANGUAGES c) add_executable(core src/main.c) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wpedantic -Werror -Wall -Wextra -luuid -lsqlite3 -ffile-prefix-map=${CMAKE_SOURCE_DIR}/src/=") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wpedantic -Werror -Wall -Wextra -luuid -lsqlite3 -ffile-prefix-map=${CMAKE_SOURCE_DIR}/src/=") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -fprofile-arcs -ftest-coverage") add_definitions("-DMG_ENABLE_EXTRA_ERRORS_DESC") +add_definitions("-DEMGAUWA_CORE_VERSION=${CMAKE_PROJECT_VERSION}") aux_source_directory(src/ SRC_DIR) aux_source_directory(src/models MODELS_SRC) @@ -17,18 +20,20 @@ aux_source_directory(src/endpoints ENDPOINTS_SRC) configure_file("core.ini" "core.ini" COPYONLY) -add_dependencies(core migrations) - target_sources(core PRIVATE ${SRC_DIR} ${HANDLERS_SRC} ${HELPERS_SRC} ${MODELS_SRC} ${ENDPOINTS_SRC}) target_include_directories(core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) target_include_directories(core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/vendor) - add_custom_target(migrations COMMAND ./compile_migrations.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) +add_custom_target(migrations ALL + COMMAND ./compile_migrations.sh + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + add_custom_target(run COMMAND ./core start DEPENDS core