summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 8fb13c9ca6c9d527fe7d876d1672974ef7cfa502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.7)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/helpers")

include(GNUInstallDirs)
include(EflMacros)

EFL_PROJECT(1.19.99)

if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
  message(FATAL_ERROR "In-source builds not allowed. Use: mkdir -p build && cmake -H. -Bbuild")
endif()

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")

add_definitions(
  "-DHAVE_CONFIG_H"
  "-DLIB_INSTALL_DIR=\"${LIB_INSTALL_DIR}\""
  "-DEXEC_INSTALL_DIR=\"${EXEC_INSTALL_DIR}\""
  "-DPACKAGE_BIN_DIR=\"${CMAKE_INSTALL_FULL_BINDIR}\""
  "-DPACKAGE_LIB_DIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\""
  "-DPACKAGE_BUILD_DIR=\"${CMAKE_SOURCE_DIR}\""
  "-DPACKAGE_VERSION=\"${PROJECT_VERSION}\""
  )

include_directories(
  ${PROJECT_SOURCE_DIR}/src/lib/efl
  ${PROJECT_BINARY_DIR}/src/lib/efl
  )

include(${CMAKE_SOURCE_DIR}/cmake/config/common.cmake)

EFL_LIB(eina)
EFL_LIB(eolian)
EFL_LIB(eo)
EFL_LIB(efl)

EFL_OPTIONS_SUMMARY()

# TODO: when autotools is gone, rename this file in repository
# and remove this copy (using generate to skip @-subst)
file(GENERATE
  OUTPUT ${PROJECT_BINARY_DIR}/src/lib/efl/config.h
  INPUT ${PROJECT_SOURCE_DIR}/src/lib/efl/config.h.cmake)
EFL_HEADER_CHECKS_FINALIZE(${PROJECT_BINARY_DIR}/src/lib/efl/config_gen.h)

configure_file(
  ${PROJECT_SOURCE_DIR}/src/lib/efl/Efl_Config.h.cmake
  ${PROJECT_BINARY_DIR}/src/lib/efl/Efl_Config.h)
EFL_FINALIZE()