Tizen 2.0 Release
[framework/web/wrt-commons.git] / build / core / CMakeLists.txt
1 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15 # @file        CMakeLists.txt
16 # @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
17 # @version     1.0
18 # @brief
19 #
20
21 # Check required modules
22 INCLUDE(FindPkgConfig)
23 PKG_CHECK_MODULES(SYS_EFL
24   ecore
25   appcore-efl
26   openssl
27   dlog
28   vconf
29   libpcrecpp
30   icu-uc
31   REQUIRED)
32
33 # Add core include directories
34 INCLUDE_DIRECTORIES(
35     ${DPL_LOG_INCLUDE_DIR}
36     ${DPL_CORE_INCLUDE_DIR}
37     ${DPL_3RDPARTY_INCLUDE_DIR}
38 )
39
40 INCLUDE_DIRECTORIES(SYSTEM ${SYS_EFL_INCLUDE_DIRS})
41
42 LINK_DIRECTORIES(${SYS_EFL_LIBRARY_DIRS})
43
44 # Base EFL based DPL library
45 SET(DPL_EFL_LIBRARY "${PROJECT_NAME}-efl")
46
47 # Build shared library
48 ADD_LIBRARY(${TARGET_DPL_EFL} SHARED
49     ${DPL_CORE_SOURCES}
50     ${DPL_LOG_SOURCES}
51 )
52
53 TARGET_LINK_LIBRARIES(${TARGET_DPL_EFL} ${SYS_EFL_LIBRARIES} "-lrt")
54
55 # Link with 3rd party libraries
56 LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/3rdparty)
57
58 TARGET_LINK_LIBRARIES(${TARGET_DPL_EFL} lib3rdparty)
59
60 # Target library properties
61 SET_TARGET_PROPERTIES(${TARGET_DPL_EFL} PROPERTIES
62     SOVERSION ${API_VERSION} 
63  VERSION ${VERSION}
64     CLEAN_DIRECT_OUTPUT 1
65     OUTPUT_NAME ${DPL_EFL_LIBRARY})
66
67 # Install libraries
68 INSTALL(TARGETS ${TARGET_DPL_EFL}
69         DESTINATION lib)
70
71 # Install detail headers
72 INSTALL(FILES ${DPL_CORE_EFL_DETAIL_HEADERS}
73         DESTINATION include/dpl-efl/dpl)
74
75 # Install core headers
76 INSTALL(FILES ${DPL_CORE_HEADERS}
77         DESTINATION include/dpl-efl/dpl)
78
79 # Install log headers
80 INSTALL(FILES ${DPL_LOG_HEADERS}
81         DESTINATION include/dpl-efl/dpl/log)
82
83 # Install 3rdparty headers
84 INSTALL(FILES ${DPL_3RDPARTY_HEADERS}
85         DESTINATION include/dpl-efl/dpl/3rdparty/fastdelegate)
86
87 # Install pkgconfig script
88 configure_and_install_pkg(dpl-efl.pc)