Skip to content

Commit df1d939

Browse files
committed
Trying to solve bugs in msvc related to version library.
1 parent 8fe06ff commit df1d939

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

source/version/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ include(SecurityFlags)
3333
string(TOUPPER ${META_PROJECT_NAME} META_PROJECT_NAME_UPPER)
3434
string(TOLOWER ${META_PROJECT_NAME} META_PROJECT_NAME_LOWER)
3535

36-
set(template_include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}")
37-
38-
set(include_path "${CMAKE_BINARY_DIR}/source/include/${META_PROJECT_NAME_LOWER}")
36+
set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}")
37+
set(include_binary_path "${CMAKE_BINARY_DIR}/source/include/${META_PROJECT_NAME_LOWER}")
3938
set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source")
4039

4140
# Generate version-header
42-
configure_file(${template_include_path}/version.h.in ${include_path}/${META_PROJECT_NAME_LOWER}_version.h)
41+
configure_file(${include_path}/version.h.in ${include_binary_path}/${META_PROJECT_NAME_LOWER}_version.h)
4342

4443
set(headers
45-
${include_path}/${META_PROJECT_NAME_LOWER}_version.h
44+
${include_binary_path}/${META_PROJECT_NAME_LOWER}_version.h
45+
${include_path}/version.h
4646
)
4747

4848
set(sources
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* CMake Versioning Utility by Parra Studios
3+
* A template for generating versioning utilities.
4+
*
5+
* Copyright (C) 2016 - 2021 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*
19+
*/
20+
21+
#ifndef VERSION_H
22+
#define VERSION_H 1
23+
24+
#include <version/version_api.h>
25+
26+
#ifdef __cplusplus
27+
extern "C" {
28+
#endif
29+
30+
VERSION_API const char *version_print_info(void);
31+
32+
#ifdef __cplusplus
33+
}
34+
#endif
35+
36+
#endif /* VERSION_H */

0 commit comments

Comments
 (0)