summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-01-21 13:27:17 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-01-23 18:23:40 +0100
commit2a5c2a0c3cc245567b6b0854648732099dc878b9 (patch)
tree3e3bba7d98ce8e905a89e1df597ded8e14b5a6e5
parent9f2a2f7968c0b7e036093945cdc035427b681809 (diff)
cmake: improve versioning
The version defines are now done all the time. and the version pattern does mach the one from autotools. And supports release mode now.
-rw-r--r--CMakeLists.txt10
-rw-r--r--cmake/helpers/EflMacros.cmake15
-rw-r--r--src/lib/efl/Efl_Config.h.cmake6
-rw-r--r--src/lib/efl/config.h.cmake8
4 files changed, 28 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0edc4386d1..756297dbb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,11 @@
1cmake_minimum_required(VERSION 3.7) 1cmake_minimum_required(VERSION 3.7)
2project(efl VERSION 1.19.99.1) 2
3set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/helpers")
3 4
4include(GNUInstallDirs) 5include(GNUInstallDirs)
6include(EflMacros)
7
8EFL_PROJECT(1.19.99)
5 9
6if (NOT EFL_BUILD_ID) 10if (NOT EFL_BUILD_ID)
7 set(EFL_BUILD_ID 120) 11 set(EFL_BUILD_ID 120)
@@ -21,6 +25,7 @@ add_definitions(
21 "-DPACKAGE_BIN_DIR=\"${CMAKE_INSTALL_FULL_BINDIR}\"" 25 "-DPACKAGE_BIN_DIR=\"${CMAKE_INSTALL_FULL_BINDIR}\""
22 "-DPACKAGE_LIB_DIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"" 26 "-DPACKAGE_LIB_DIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\""
23 "-DPACKAGE_BUILD_DIR=\"${CMAKE_SOURCE_DIR}\"" 27 "-DPACKAGE_BUILD_DIR=\"${CMAKE_SOURCE_DIR}\""
28 "-DPACKAGE_VERSION=\"${PROJECT_VERSION}\""
24 ) 29 )
25 30
26include_directories( 31include_directories(
@@ -28,9 +33,6 @@ include_directories(
28 ${PROJECT_BINARY_DIR}/src/lib/efl 33 ${PROJECT_BINARY_DIR}/src/lib/efl
29 ) 34 )
30 35
31set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/helpers")
32include(EflMacros)
33
34include(${CMAKE_SOURCE_DIR}/cmake/config/common.cmake) 36include(${CMAKE_SOURCE_DIR}/cmake/config/common.cmake)
35 37
36EFL_LIB(eina) 38EFL_LIB(eina)
diff --git a/cmake/helpers/EflMacros.cmake b/cmake/helpers/EflMacros.cmake
index 12577d8128..bbb0dc17d1 100644
--- a/cmake/helpers/EflMacros.cmake
+++ b/cmake/helpers/EflMacros.cmake
@@ -854,3 +854,18 @@ function(EFL_MODULE _modname)
854 endif() 854 endif()
855 endif() 855 endif()
856endfunction() 856endfunction()
857
858macro(EFL_PROJECT version)
859 if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
860 project(efl VERSION ${version})
861 else ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
862 execute_process(
863 COMMAND git rev-list --count HEAD
864 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
865 OUTPUT_VARIABLE GIT_VERSION
866 OUTPUT_STRIP_TRAILING_WHITESPACE
867 )
868 project(efl VERSION ${version}.${GIT_VERSION})
869 endif ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
870 message("VERSION ${PROJECT_VERSION}")
871endmacro() \ No newline at end of file
diff --git a/src/lib/efl/Efl_Config.h.cmake b/src/lib/efl/Efl_Config.h.cmake
index 3b356f06ca..e1c199ce80 100644
--- a/src/lib/efl/Efl_Config.h.cmake
+++ b/src/lib/efl/Efl_Config.h.cmake
@@ -15,7 +15,7 @@
15 and require an explicit request to get it. */ 15 and require an explicit request to get it. */
16#endif 16#endif
17 17
18#cmakedefine EFL_VERSION_MAJOR @EFL_VERSION_MAJOR@ 18#define EFL_VERSION_MAJOR @EFL_VERSION_MAJOR@
19#cmakedefine EFL_VERSION_MINOR @EFL_VERSION_MINOR@ 19#define EFL_VERSION_MINOR @EFL_VERSION_MINOR@
20#cmakedefine EFL_BUILD_ID "@EFL_BUILD_ID@" 20#define EFL_BUILD_ID "@EFL_BUILD_ID@"
21#endif 21#endif
diff --git a/src/lib/efl/config.h.cmake b/src/lib/efl/config.h.cmake
index 91fc12c563..3a1e6a3b4b 100644
--- a/src/lib/efl/config.h.cmake
+++ b/src/lib/efl/config.h.cmake
@@ -4,10 +4,10 @@
4#define _GNU_SOURCE 4#define _GNU_SOURCE
5#cmakedefine HAVE_SYS_MMAN_H 1 5#cmakedefine HAVE_SYS_MMAN_H 1
6 6
7#cmakedefine VMAJ @VMAJ@ 7#define VMAJ @VMAJ@
8#cmakedefine VMIN @VMIN@ 8#define VMIN @VMIN@
9#cmakedefine VMIC @VMIC@ 9#define VMIC @VMIC@
10#cmakedefine VREV @VREV@ 10#define VREV @VREV@
11 11
12#cmakedefine NVALGRIND 1 12#cmakedefine NVALGRIND 1
13#cmakedefine HAVE_CLOCK_GETTIME 1 13#cmakedefine HAVE_CLOCK_GETTIME 1