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)
92
103string (COMPARE NOTEQUAL "$ENV{TRAVIS_TAG} " "" travis_deploy)
114string (COMPARE EQUAL "$ENV{APPVEYOR_REPO_TAG} " "true" appveyor_deploy)
@@ -18,13 +11,17 @@ else()
1811 set (version "v0.0.0" )
1912endif ()
2013
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)
2423
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} )
2825
2926if (travis_deploy OR appveyor_deploy)
3027 string (COMPARE EQUAL "$ENV{CONFIG} " "Debug" debug_build)
You can’t perform that action at this time.
0 commit comments