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)
downloadefl-dee24c3821ffbc14721dbfb041ac6cc010b9269b.tar.gz
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 12dd0a87dd..f68a8117cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,19 +1,44 @@
cmake_minimum_required(VERSION 3.7)
-project(eflgeneric)
+project(efl VERSION 1.19.99.1)
+if (NOT EFL_BUILD_ID)
+ set(EFL_BUILD_ID 120)
+endif()
-ADD_DEFINITIONS("-DHAVE_CONFIG_H")
+if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+ message(FATAL_ERROR "In-source builds not allowed. Use: mkdir -p build && cmake -H. -Bbuild")
+endif()
-add_subdirectory(src)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" CACHE PATH "Path to store built libraries")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Path to store built executables")
-CHECK_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H)
+set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Absolute path to library installation directory")
+set(EXEC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Absolute path to executable installation directory")
+set(HEADER_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Absolute path to install headers by the library")
-set(PROJECT_VERSION_MAJOR 1)
-set(PROJECT_VERSION_MINOR 19)
-set(PROJECT_VERSION_PATCH 99)
-set(PROJECT_VERSION_TWEAK 00)
+add_definitions(
+ "-DHAVE_CONFIG_H"
+ "-DLIB_INSTALL_DIR=\"${LIB_INSTALL_DIR}\""
+ "-DEXEC_INSTALL_DIR=\"${EXEC_INSTALL_DIR}\""
+ )
+include_directories(
+ ${PROJECT_SOURCE_DIR}/src/lib/efl
+ ${PROJECT_BINARY_DIR}/src/lib/efl
+ )
-set(VMAJ ${PROJECT_VERSION_MAJOR})
-set(VMIN ${PROJECT_VERSION_MINOR})
-set(VMIC ${PROJECT_VERSION_PATCH})
-set(VREV ${PROJECT_VERSION_TWEAK})
-configure_file(config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/helpers")
+include(EflMacros)
+
+include(${CMAKE_SOURCE_DIR}/cmake/config/common.cmake)
+
+EFL_LIB(eina)
+
+EFL_OPTIONS_SUMMARY()
+
+configure_file(
+ ${PROJECT_SOURCE_DIR}/src/lib/efl/config.h.cmake
+ ${PROJECT_BINARY_DIR}/src/lib/efl/config.h)
+configure_file(
+ ${PROJECT_SOURCE_DIR}/src/lib/efl/Efl_Config.h.cmake
+ ${PROJECT_BINARY_DIR}/src/lib/efl/Efl_Config.h)
+
+EFL_FINALIZE()