File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change 1
- cmake_minimum_required (VERSION 2.8 )
2
- project (Foo )
3
-
4
- add_library (foo foo.cpp )
5
- add_executable (boo foo.cpp )
6
-
7
- install (TARGETS foo DESTINATION lib )
8
- install (TARGETS boo DESTINATION bin )
1
+ cmake_minimum_required (VERSION 3.0 )
9
2
10
3
string (COMPARE NOTEQUAL "$ENV{TRAVIS_TAG} " "" travis_deploy )
11
4
string (COMPARE EQUAL "$ENV{APPVEYOR_REPO_TAG} " "true" appveyor_deploy )
@@ -18,13 +11,17 @@ else()
18
11
set (version "v0.0.0" )
19
12
endif ()
20
13
21
- string (REGEX REPLACE "^v([0-9]+)\\ .[0-9]+\\ .[0-9]+$" "\\ 1" x "${version} " )
22
- string (REGEX REPLACE "^v[0-9]+\\ .([0-9]+)\\ .[0-9]+$" "\\ 1" y "${version} " )
23
- string (REGEX REPLACE "^v[0-9]+\\ .[0-9]+\\ .([0-9]+)$" "\\ 1" z "${version} " )
14
+ string (REGEX REPLACE "^v" "" version "${version} " )
15
+
16
+ project (Foo VERSION ${version} )
17
+
18
+ add_library (foo foo.cpp )
19
+ add_executable (boo foo.cpp )
20
+
21
+ install (TARGETS foo DESTINATION lib )
22
+ install (TARGETS boo DESTINATION bin )
24
23
25
- set (CPACK_PACKAGE_VERSION_MAJOR ${x} )
26
- set (CPACK_PACKAGE_VERSION_MINOR ${y} )
27
- set (CPACK_PACKAGE_VERSION_PATCH ${z} )
24
+ set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION} )
28
25
29
26
if (travis_deploy OR appveyor_deploy )
30
27
string (COMPARE EQUAL "$ENV{CONFIG} " "Debug" debug_build )
You can’t perform that action at this time.
0 commit comments