CMake: handle OwlPS' version
This commit is contained in:
parent
7598bc9451
commit
77fcc23026
|
@ -14,6 +14,28 @@ set(GENERATED_INCLUDE "${PROJECT_BINARY_DIR}/include")
|
||||||
include_directories("${GENERATED_INCLUDE}")
|
include_directories("${GENERATED_INCLUDE}")
|
||||||
|
|
||||||
|
|
||||||
|
### OwlPS' version ###
|
||||||
|
|
||||||
|
# First, try to get it from the environment variable OWLPS_VERSION
|
||||||
|
if (NOT "$ENV{OWLPS_VERSION}" STREQUAL "")
|
||||||
|
add_definitions(-DOWLPS_VERSION="$ENV{OWLPS_VERSION}")
|
||||||
|
|
||||||
|
# Environment variable OWLPS_VERSION not set: try to get the version
|
||||||
|
# number from git describe
|
||||||
|
else()
|
||||||
|
execute_process(
|
||||||
|
COMMAND git describe
|
||||||
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE RET
|
||||||
|
OUTPUT_VARIABLE OWLPS_VERSION
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if (${RET} EQUAL 0)
|
||||||
|
add_definitions(-DOWLPS_VERSION="${OWLPS_VERSION}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
### Options ###
|
### Options ###
|
||||||
|
|
||||||
option (DEBUG
|
option (DEBUG
|
||||||
|
|
1
TODO.t2t
1
TODO.t2t
|
@ -56,7 +56,6 @@ Work to do in OwlPS
|
||||||
- Add option dump-configuration (displays the config & exits).
|
- Add option dump-configuration (displays the config & exits).
|
||||||
|
|
||||||
- CMake:
|
- CMake:
|
||||||
- handle OwlPS version
|
|
||||||
- libraries: version numbers (sonames) and symbolic links
|
- libraries: version numbers (sonames) and symbolic links
|
||||||
- compilation flags
|
- compilation flags
|
||||||
- installation targets
|
- installation targets
|
||||||
|
|
Loading…
Reference in New Issue