-
Notifications
You must be signed in to change notification settings - Fork 7
/
version.cmake
22 lines (16 loc) · 1.11 KB
/
version.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
set(ROBOCIN_PROJECT_NAME "project-unification")
if (NOT DEFINED ROBOCIN_PROJECT_NAME)
message(FATAL_ERROR "ROBOCIN_PROJECT_NAME is not defined.")
endif ()
set(ROBOCIN_PROJECT_VERSION_MAJOR 0)
set(ROBOCIN_PROJECT_VERSION_MINOR 0)
set(ROBOCIN_PROJECT_VERSION_PATCH 0)
set(ROBOCIN_PROJECT_VERSION "${ROBOCIN_PROJECT_VERSION_MAJOR}.${ROBOCIN_PROJECT_VERSION_MINOR}.${ROBOCIN_PROJECT_VERSION_PATCH}")
function(ROBOCIN_LINK_PROJECT_DEFINITIONS TARGET_NAME PROJECT_ROOT)
target_compile_definitions(${TARGET_NAME} PRIVATE ROBOCIN_PROJECT_NAME="${ROBOCIN_PROJECT_NAME}")
target_compile_definitions(${TARGET_NAME} PRIVATE ROBOCIN_PROJECT_PATH="${PROJECT_ROOT}")
target_compile_definitions(${TARGET_NAME} PRIVATE ROBOCIN_PROJECT_VERSION_MAJOR=${ROBOCIN_PROJECT_VERSION_MAJOR})
target_compile_definitions(${TARGET_NAME} PRIVATE ROBOCIN_PROJECT_VERSION_MINOR=${ROBOCIN_PROJECT_VERSION_MINOR})
target_compile_definitions(${TARGET_NAME} PRIVATE ROBOCIN_PROJECT_VERSION_PATCH=${ROBOCIN_PROJECT_VERSION_PATCH})
target_compile_definitions(${TARGET_NAME} PRIVATE ROBOCIN_PROJECT_VERSION="${ROBOCIN_PROJECT_VERSION}")
endfunction()