Add Tizen 2.0 packaging
[profile/ivi/eobj.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 project(eo)
3 set(VMAJ 0)
4 set(VMIN 1)
5 set(VMIC 0)
6 set(PACKAGE_VERSION ${VMAJ}.${VMIN}.${VMIC})
7
8 set(PACKAGE ${CMAKE_PROJECT_NAME})
9 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
10
11 include_directories ("${PROJECT_BINARY_DIR}")
12
13 find_package(Eina REQUIRED)
14 find_package(Evas REQUIRED)
15 find_package(Elementary REQUIRED)
16
17 # likely put this into an FindCompilerAttribute.cmake:
18 INCLUDE(CheckCSourceCompiles)
19 SET(HAVE___ATTRIBUTE__)
20 CHECK_C_SOURCE_COMPILES(
21    "void  foo (int bar __attribute__((unused)) ) { }
22    static void baz (void) __attribute__((unused));
23    static void baz (void) { }
24    int main(){}
25    " HAVE___ATTRIBUTE__
26    )
27
28 ADD_DEFINITIONS(-DPACKAGE_BIN_DIR="${CMAKE_INSTALL_PREFIX}/bin"
29    -DPACKAGE_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}"
30    -DPACKAGE_LIB_DIR="${CMAKE_INSTALL_PREFIX}/lib")
31
32 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
33
34 configure_file (
35    "${PROJECT_SOURCE_DIR}/cmakeconfig.h.in"
36    "${PROJECT_BINARY_DIR}/config.h"
37    )
38
39 include(EFLCheck)
40
41 add_subdirectory(src/lib)
42
43 add_subdirectory(src/tests EXCLUDE_FROM_ALL)
44 add_subdirectory(src/benchmarks EXCLUDE_FROM_ALL)
45 add_subdirectory(src/examples)
46
47 add_subdirectory(doc)
48
49 # PKGCONFIG file.
50 CONFIGURE_FILE(
51    "${PROJECT_SOURCE_DIR}/eo.pc.in"
52    "${PROJECT_BINARY_DIR}/eo.pc"
53    @ONLY
54    )
55
56 INSTALL(FILES "${PROJECT_BINARY_DIR}/eo.pc"
57       DESTINATION "lib/pkgconfig")