summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 02a46e545b73122178a710446b0fc406fa3f72b5 (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
cmake_minimum_required(VERSION 2.6)
project(edoors)
set(EDOORS_VERSION_MAJOR 0)
set(EDOORS_VERSION_MINOR 0)
set(EDOORS_VERSION_MICRO 1)
set(EDOORS_VERSION ${EDOORS_VERSION_MAJOR}.${EDOORS_VERSION_MINOR}.${EDOORS_VERSION_MICRO})

set(PACKAGE ${CMAKE_PROJECT_NAME})
set(PACKAGE_VERSION ${EDOORS_VERSION_MAJOR}.${EDOORS_VERSION_MINOR}.${EDOORS_VERSION_MICRO})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

# debug
IF(WANT_DEBUG)
    SET(CMAKE_BUILD_TYPE Debug)
    SET(EDOORS_HAVE_DEBUG TRUE)
ELSE()
    SET(CMAKE_BUILD_TYPE Release)
    SET(EDOORS_HAVE_DEBUG FALSE)
ENDIF()

# c flags
SET(CMAKE_C_FLAGS "-O2")
SET(CMAKE_C_FLAGS_RELEASE "")
SET(CMAKE_C_FLAGS_DEBUG "-g -Winline")

# requirements
include(FindCompilerAttribute)
find_package(Eina REQUIRED)
include(EFLCheck)

# definitions
ADD_DEFINITIONS(-DPACKAGE_BIN_DIR="${CMAKE_INSTALL_PREFIX}/bin"
   -DPACKAGE_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}"
   -DPACKAGE_LIB_DIR="${CMAKE_INSTALL_PREFIX}/src")

# CONFIG
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
configure_file (
   "${PROJECT_SOURCE_DIR}/cmakeconfig.h.in"
   "${PROJECT_BINARY_DIR}/src/include/edoors_config.h"
   )
include_directories ("${PROJECT_BINARY_DIR}/src/include")

# subdirectories
add_subdirectory(src)
add_subdirectory(tests)
add_subdirectory(doc)