diff --git a/CMakeLists.txt b/CMakeLists.txt index 2849be9ad..9fd7341f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,9 @@ include (CPack) project(FlightGear) -file(READ version FLIGHTGEAR_VERSION) +# read 'version' file into a variable (stripping any newlines or spaces) +file(READ version versionFile) +string(STRIP ${versionFile} FLIGHTGEAR_VERSION) #packaging SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") @@ -178,6 +180,10 @@ include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS} ${PLIB_INCLUDE_DIR} ) include_directories(${PROJECT_SOURCE_DIR}/src) + +# following is needed, because config.h is include 'bare', whereas +# version.h is included as - this should be cleaned up +include_directories(${PROJECT_BINARY_DIR}/src) include_directories(${PROJECT_BINARY_DIR}/src/Include) add_definitions(-DHAVE_CONFIG_H) diff --git a/src/Include/config_cmake.h.in b/src/Include/config_cmake.h.in index db6a63f93..de02ad902 100644 --- a/src/Include/config_cmake.h.in +++ b/src/Include/config_cmake.h.in @@ -19,7 +19,7 @@ #cmakedefine HAVE_SYS_TIME_H #cmakedefine HAVE_CULLSETTINGS_CLEAR_MASK -#define VERSION "@FLIGHTGEAR_VERSION" +#define VERSION "@FLIGHTGEAR_VERSION@" #define HAVE_VERSION_H 1 // version.h is assumed for CMake builds diff --git a/src/Include/version.h.cmake-in b/src/Include/version.h.cmake-in index a63634b72..140e14009 100644 --- a/src/Include/version.h.cmake-in +++ b/src/Include/version.h.cmake-in @@ -1,8 +1,10 @@ -#cmakedefine FLIGHTGEAR_VERSION +#define FLIGHTGEAR_VERSION "@FLIGHTGEAR_VERSION@" + +#define HUDSON_BUILD_NUMBER @HUDSON_BUILD_NUMBER@ +#define HUDSON_BUILD_ID "@HUDSON_BUILD_ID@" +#define REVISION "@REVISION@" + -#cmakedefine HUDSON_BUILD_NUMBER -#cmakedefine HUDSON_BUILD_ID -#cmakedefine REVISION