add: VERSION in CMakeLists
This commit is contained in:
parent
0d52ec1338
commit
0a3323cdad
1 changed files with 10 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue