Changeset View
Changeset View
Standalone View
Standalone View
tests/ECMGenerateExportHeaderTest/format_version/CMakeLists.txt
- This file was added.
1 | cmake_minimum_required(VERSION 3.0.0) | ||||
---|---|---|---|---|---|
2 | | ||||
3 | project(format_version) | ||||
4 | | ||||
5 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules) | ||||
6 | include(ECMGenerateExportHeader) | ||||
7 | | ||||
8 | include(../../test_helpers.cmake) | ||||
9 | | ||||
10 | set(_current_version "4.5.6") | ||||
11 | | ||||
12 | # check 0 | ||||
13 | ecm_export_header_format_version(0 | ||||
14 | CURRENT_VERSION ${_current_version} | ||||
15 | STRING_VAR _versionstring | ||||
16 | HEXNUMBER_VAR _hexnumber | ||||
17 | ) | ||||
18 | | ||||
19 | assert_var_str_value(_versionstring "0") | ||||
20 | assert_var_str_value(_hexnumber "0") | ||||
21 | | ||||
22 | # check other | ||||
23 | ecm_export_header_format_version(1.2.3 | ||||
24 | CURRENT_VERSION ${_current_version} | ||||
25 | STRING_VAR _versionstring | ||||
26 | HEXNUMBER_VAR _hexnumber | ||||
27 | ) | ||||
28 | | ||||
29 | assert_var_str_value(_versionstring "1.2.3") | ||||
30 | assert_var_str_value(_hexnumber "0x10203") | ||||
31 | | ||||
32 | # check CURRENT | ||||
33 | ecm_export_header_format_version(CURRENT | ||||
34 | CURRENT_VERSION ${_current_version} | ||||
35 | STRING_VAR _versionstring | ||||
36 | HEXNUMBER_VAR _hexnumber | ||||
37 | ) | ||||
38 | | ||||
39 | assert_var_str_value(_versionstring "4.5.6") | ||||
40 | assert_var_str_value(_hexnumber "0x40506") | ||||
41 | | ||||
42 | add_executable(dummy main.cpp) |