Skip to content

Commit ddf607a

Browse files
committed
Fix version in config header when used as subproject
1 parent 5158ecb commit ddf607a

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

cmake/VCSVersion.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ if(Git_FOUND)
88
OUTPUT_VARIABLE _git_ref
99
ERROR_QUIET
1010
OUTPUT_STRIP_TRAILING_WHITESPACE
11+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
1112
)
1213

1314
if(NOT _git_ref STREQUAL "")

src/api/version.h.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#pragma once
22

3-
#define PROJECTM_VERSION_MAJOR @CMAKE_PROJECT_VERSION_MAJOR@
4-
#define PROJECTM_VERSION_MINOR @CMAKE_PROJECT_VERSION_MINOR@
5-
#define PROJECTM_VERSION_PATCH @CMAKE_PROJECT_VERSION_PATCH@
3+
#define PROJECTM_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
4+
#define PROJECTM_VERSION_MINOR @PROJECT_VERSION_MINOR@
5+
#define PROJECTM_VERSION_PATCH @PROJECT_VERSION_PATCH@
66

77
/* Full version number as a string literal */
8-
#define PROJECTM_VERSION_STRING "@CMAKE_PROJECT_VERSION@"
8+
#define PROJECTM_VERSION_STRING "@PROJECT_VERSION@"
99

1010
/* VCS version number, e.g. Git commit hash */
1111
#define PROJECTM_VERSION_VCS "@PROJECTM_VCS_VERSION@"

0 commit comments

Comments
 (0)