ebcff65f83699759e67aedc2086c9c814c927d94
[framework/web/wrt-plugins-common.git] / src / 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 # Includes CMake configuration file (*.cmake), preserving appropriate paths.
16 macro(include_config_file INCLUDED_CONFIG_FILE_PATH)
17   get_filename_component(CURRENT_CONFIG_FILE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
18   include(${CURRENT_CONFIG_FILE_PATH}/${INCLUDED_CONFIG_FILE_PATH}/${CONFIG_FILE_NAME} OPTIONAL)
19 endmacro()
20
21 # Gets actual path for CMake configuration file (*.cmake).
22 # By default, if no argument is passed, current path will be set to variable
23 # named CURRENT_PATH.
24 # @param [Optional] Name of the variable to set with current path.
25 macro(get_current_path)
26   set(VARIABLE "CURRENT_PATH")
27   if (${ARGC} GREATER 0)
28     set(VARIABLE ${ARGV0})
29   endif ()
30   get_filename_component(${VARIABLE} ${CMAKE_CURRENT_LIST_FILE} PATH)
31 endmacro()
32
33 set(HOST_ARCH $ENV{DEB_HOST_ARCH})
34 if("${HOST_ARCH}" MATCHES "armel")
35     set(HOST_ARCH "armel")
36 endif()
37
38 #include directories
39 include_directories(${CMAKE_CURRENT_SOURCE_DIR}
40                     ${CMAKE_CURRENT_SOURCE_DIR}/modules/API)
41
42 #target names
43 set(TARGET_COMMONS "wrt-plugins-commons")
44 set(TARGET_COMMONS_JAVASCRIPT "wrt-plugins-commons-javascript")
45
46 add_subdirectory(Commons)
47 add_subdirectory(CommonsJavaScript)
48 add_subdirectory(modules)