summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-19 17:54:12 -0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-01-23 18:23:40 +0100
commitdee24c3821ffbc14721dbfb041ac6cc010b9269b (patch)
tree5c5f76c74b665d4a3c7905d6f7519e480ebeaa0f /CMakeLists.txt
parent88283204c16c745e3aec11bff2409bd5cc903121 (diff)
CMake: rework to use some helper macros.
This tries to defines some macros to create a cleaner build system.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt51
1 files changed, 38 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 12dd0a8..f68a811 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,19 +1,44 @@
1cmake_minimum_required(VERSION 3.7) 1cmake_minimum_required(VERSION 3.7)
2project(eflgeneric) 2project(efl VERSION 1.19.99.1)
3if (NOT EFL_BUILD_ID)
4 set(EFL_BUILD_ID 120)
5endif()
3 6
4ADD_DEFINITIONS("-DHAVE_CONFIG_H") 7if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
8 message(FATAL_ERROR "In-source builds not allowed. Use: mkdir -p build && cmake -H. -Bbuild")
9endif()
5 10
6add_subdirectory(src) 11set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" CACHE PATH "Path to store built libraries")
12set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Path to store built executables")
7 13
8CHECK_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H) 14set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Absolute path to library installation directory")
15set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Absolute path to executable installation directory")
16set(HEADER_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Absolute path to install headers by the library")
9 17
10set(PROJECT_VERSION_MAJOR 1) 18add_definitions(
11set(PROJECT_VERSION_MINOR 19) 19 "-DHAVE_CONFIG_H"
12set(PROJECT_VERSION_PATCH 99) 20 "-DLIB_INSTALL_DIR=\"${LIB_INSTALL_DIR}\""
13set(PROJECT_VERSION_TWEAK 00) 21 "-DEXEC_INSTALL_DIR=\"${EXEC_INSTALL_DIR}\""
22 )
23include_directories(
24 ${PROJECT_SOURCE_DIR}/src/lib/efl
25 ${PROJECT_BINARY_DIR}/src/lib/efl
26 )
14 27
15set(VMAJ ${PROJECT_VERSION_MAJOR}) 28set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/helpers")
16set(VMIN ${PROJECT_VERSION_MINOR}) 29include(EflMacros)
17set(VMIC ${PROJECT_VERSION_PATCH}) 30
18set(VREV ${PROJECT_VERSION_TWEAK}) 31include(${CMAKE_SOURCE_DIR}/cmake/config/common.cmake)
19configure_file(config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h) 32
33EFL_LIB(eina)
34
35EFL_OPTIONS_SUMMARY()
36
37configure_file(
38 ${PROJECT_SOURCE_DIR}/src/lib/efl/config.h.cmake
39 ${PROJECT_BINARY_DIR}/src/lib/efl/config.h)
40configure_file(
41 ${PROJECT_SOURCE_DIR}/src/lib/efl/Efl_Config.h.cmake
42 ${PROJECT_BINARY_DIR}/src/lib/efl/Efl_Config.h)
43
44EFL_FINALIZE()