CMakeVersion : Introducing default version
[profile/ivi/layer-management.git] / cmake / modules / CMakeVersions.txt
1 ############################################################################
2
3 # Copyright 2010, 2011 BMW Car IT GmbH  
4
5
6 # Licensed under the Apache License, Version 2.0 (the "License"); 
7 # you may not use this file except in compliance with the License. 
8 # You may obtain a copy of the License at 
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0 
11 #
12 # Unless required by applicable law or agreed to in writing, software 
13 # distributed under the License is distributed on an "AS IS" BASIS, 
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
15 # See the License for the specific language governing permissions and 
16 # limitations under the License.
17 #
18 ############################################################################
19
20 set( ${PROJECT_NAME}_MAJOR_VERSION 0 )
21 set( ${PROJECT_NAME}_MINOR_VERSION 9 )
22 set( ${PROJECT_NAME}_PATCH_LEVEL 6 )
23
24 set(VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
25
26 if(NOT DEFINED ILM_VERSION)
27
28 execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 
29                 RESULT_VARIABLE RESULT_VAR
30                 OUTPUT_VARIABLE ILM_VERSION 
31                 OUTPUT_STRIP_TRAILING_WHITESPACE
32                 ERROR_QUIET)
33
34 if(NOT "${RESULT_VAR}" STREQUAL 0)
35
36 message(STATUS "Unable launch automatic version build! Using default version!")
37 set(ILM_VERSION ${VERSION})
38
39 else(NOT "${RESULT_VAR}" STREQUAL 0)
40
41 string(REPLACE "-" "_" ILM_VERSION ${ILM_VERSION})
42
43 endif(NOT "${RESULT_VAR}" STREQUAL 0)
44
45 endif(NOT DEFINED ILM_VERSION)
46                                 
47 set(LICENSE "APACHE 2.0")
48
49 set(GENIVI_PROJECT_VERSION ${VERSION})
50 message(STATUS
51         "Build for Version ${VERSION} build ${ILM_VERSION}"
52         )
53
54 ##################### RPM CONFIG ########################
55 set(GENIVI_RPM_RELEASE "${ILM_VERSION}")
56 set(SPEC_DIR ".")
57 #########################################################