Merge "Fix JavaScript error after Rendering API clean-up" into devel/master
[platform/core/uifw/dali-toolkit.git] / node-addon / build / tizen / CMakeLists.txt
1 # Guide to build for GBS
2 # Build dali-toolkit with gbs, the dali-addon will be built automatically
3 #
4 # To build for Desktop
5 # option 1 (easy):  in node-addon folder type
6 #
7 # $ node-gyp build
8 #
9 # option 2: use cmake
10 # This relies on Node source being downloaded ( don't forget the dot)
11 #
12 # cmake -DDesktopNodePath:String=/home/Downloads/node-v0.12.4 .
13
14
15 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
16 PROJECT(dali_addon)
17 set(configuration "Default")
18 enable_language(ASM)
19 set(builddir "${CMAKE_BINARY_DIR}")
20 set(obj "${builddir}/obj")
21
22 set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)
23 set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
24
25 option(GBSBuild "GBSBuild" 0)
26 option(DesktopNodePath "DesktopNodePath" "")
27
28 IF( ${GBSBuild} )
29   set( NODE_HEADERS "/usr/include/node" )
30   set( V8_HEADERS "/usr/include/node" )
31   MESSAGE("Performing a GBS build, ensure Node JS devel RPM is installed")
32   MESSAGE("node.h and v8.h should exist in ${NODE_HEADERS}")
33 ELSE()
34   MESSAGE("Performing Desktop build node path =${DesktopNodePath}")
35   IF( NOT DesktopNodePath )
36     MESSAGE(FATAL_ERROR "\n Node JS Source code path empty, please specify,e.g. \n cmake -DDesktopNodePath:String=~/Downloads/node-v0.12.4/  .")
37   ENDIF( NOT DesktopNodePath )
38   set( NODE_HEADERS "${DesktopNodePath}/src" )
39   set( V8_HEADERS   "${DesktopNodePath}/deps/v8/include" )
40   MESSAGE( "-- Node include header location = ${NODE_HEADERS} ")
41   MESSAGE( "-- V8 include header location = ${V8_HEADERS} ")
42 ENDIF( ${GBSBuild})
43
44 set(TARGET "dali_addon")
45 set(TOOLSET "target")
46 set(PLUGING_SRC_DIR "../../../plugins/dali-script-v8/src")
47 set(NODE_ADDON_SRC "../..")
48 add_library(dali_addon SHARED
49   ${NODE_ADDON_SRC}/dali-addon.cpp
50   ${NODE_ADDON_SRC}/javascript-application-options.cpp
51   ${PLUGING_SRC_DIR}/utils/v8-utils.cpp
52   ${PLUGING_SRC_DIR}/dali-wrapper.cpp
53   ${PLUGING_SRC_DIR}/shared/base-wrapped-object.cpp
54   ${PLUGING_SRC_DIR}/shared/object-template-helper.cpp
55   ${PLUGING_SRC_DIR}/actors/actor-wrapper.cpp
56   ${PLUGING_SRC_DIR}/actors/actor-api.cpp
57   ${PLUGING_SRC_DIR}/actors/layer-api.cpp
58   ${PLUGING_SRC_DIR}/actors/camera-actor-api.cpp
59   ${PLUGING_SRC_DIR}/controls/control-wrapper.cpp
60   ${PLUGING_SRC_DIR}/controls/item-factory-wrapper.cpp
61   ${PLUGING_SRC_DIR}/controls/item-view-api.cpp
62   ${PLUGING_SRC_DIR}/controls/scroll-view-api.cpp
63   ${PLUGING_SRC_DIR}/constants/constants-wrapper.cpp
64   ${PLUGING_SRC_DIR}/animation/animation-api.cpp
65   ${PLUGING_SRC_DIR}/animation/animation-wrapper.cpp
66   ${PLUGING_SRC_DIR}/animation/constrainer-api.cpp
67   ${PLUGING_SRC_DIR}/animation/linear-constrainer-wrapper.cpp
68   ${PLUGING_SRC_DIR}/animation/path-api.cpp
69   ${PLUGING_SRC_DIR}/animation/path-constrainer-wrapper.cpp
70   ${PLUGING_SRC_DIR}/animation/path-wrapper.cpp
71   ${PLUGING_SRC_DIR}/stage/stage-wrapper.cpp
72   ${PLUGING_SRC_DIR}/events/event-object-generator.cpp
73   ${PLUGING_SRC_DIR}/events/pan-gesture-detector-api.cpp
74   ${PLUGING_SRC_DIR}/events/pan-gesture-detector-wrapper.cpp
75   ${PLUGING_SRC_DIR}/stage/stage-api.cpp
76   ${PLUGING_SRC_DIR}/image/image-wrapper.cpp
77   ${PLUGING_SRC_DIR}/image/image-api.cpp
78   ${PLUGING_SRC_DIR}/image/buffer-image-api.cpp
79   ${PLUGING_SRC_DIR}/image/frame-buffer-image-api.cpp
80   ${PLUGING_SRC_DIR}/image/resource-image-api.cpp
81   ${PLUGING_SRC_DIR}/object/handle-wrapper.cpp
82   ${PLUGING_SRC_DIR}/object/property-buffer-api.cpp
83   ${PLUGING_SRC_DIR}/object/property-buffer-wrapper.cpp
84   ${PLUGING_SRC_DIR}/object/property-value-wrapper.cpp
85   ${PLUGING_SRC_DIR}/signals/signal-manager.cpp
86   ${PLUGING_SRC_DIR}/render-tasks/render-task-list-api.cpp
87   ${PLUGING_SRC_DIR}/render-tasks/render-task-list-wrapper.cpp
88   ${PLUGING_SRC_DIR}/render-tasks/render-task-api.cpp
89   ${PLUGING_SRC_DIR}/render-tasks/render-task-wrapper.cpp
90   ${PLUGING_SRC_DIR}/rendering/geometry-api.cpp
91   ${PLUGING_SRC_DIR}/rendering/geometry-wrapper.cpp
92   ${PLUGING_SRC_DIR}/rendering/texture-set-api.cpp
93   ${PLUGING_SRC_DIR}/rendering/texture-set-wrapper.cpp
94   ${PLUGING_SRC_DIR}/rendering/renderer-api.cpp
95   ${PLUGING_SRC_DIR}/rendering/renderer-wrapper.cpp
96   ${PLUGING_SRC_DIR}/rendering/sampler-api.cpp
97   ${PLUGING_SRC_DIR}/rendering/sampler-wrapper.cpp
98   ${PLUGING_SRC_DIR}/rendering/shader-api.cpp
99   ${PLUGING_SRC_DIR}/rendering/shader-wrapper.cpp
100   ${PLUGING_SRC_DIR}/toolkit/builder/builder-api.cpp
101   ${PLUGING_SRC_DIR}/toolkit/builder/builder-wrapper.cpp
102   ${PLUGING_SRC_DIR}/toolkit/focus-manager/keyboard-focus-manager-api.cpp
103   ${PLUGING_SRC_DIR}/toolkit/focus-manager/keyboard-focus-manager-wrapper.cpp
104   ${PLUGING_SRC_DIR}/signals/dali-any-javascript-converter.cpp
105   ${PLUGING_SRC_DIR}/garbage-collector/garbage-collector.cpp
106   ${PLUGING_SRC_DIR}/module-loader/module.cpp
107   ${PLUGING_SRC_DIR}/module-loader/module-loader.cpp
108 )
109 set_target_properties(dali_addon PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${builddir}/lib.${TOOLSET}")
110 set_target_properties(dali_addon PROPERTIES PREFIX "")
111 set_target_properties(dali_addon PROPERTIES LIBRARY_OUTPUT_NAME "dali")
112 set_target_properties(dali_addon PROPERTIES SUFFIX ".node")
113 set_source_files_properties(${builddir}/lib.${TOOLSET}/dali.node PROPERTIES GENERATED "TRUE")
114 set_target_properties(dali_addon PROPERTIES EXCLUDE_FROM_ALL "FALSE")
115
116
117 SET(PKG_LIST dali-core
118              dali-adaptor-uv
119              dali-toolkit)
120
121 INCLUDE(FindPkgConfig)
122 pkg_check_modules(REQUIRED_PKGS REQUIRED ${PKG_LIST})
123
124 # This is just pulling out dali / dali-toolkit header locations from pkg-config
125 FOREACH(flag ${REQUIRED_PKGS_CFLAGS})
126         SET(REQUIRED_CFLAGS "${REQUIRED_CFLAGS} ${flag}")
127 ENDFOREACH(flag)
128
129 # Set the include paths to include dali, dali-core, node, v8 and headers for dali-addon
130 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${REQUIRED_CFLAGS} -I${PLUGING_SRC_DIR}/utils -I${PLUGING_SRC_DIR}  -I${NODE_HEADERS} -I ${V8_HEADERS}")
131
132 set_target_properties(dali_addon PROPERTIES COMPILE_FLAGS "-fPIC -frtti -fexceptions")
133
134 # This sets up the linker flags for dali-core/ adaptor and toolkit
135 # we don't need any flags for node / v8 as we're running inside node and v8 is statically linked to it
136 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_PKGS_LDFLAGS})
137
138 # ${CMAKE_INSTALL_PREFIX}
139 #################################### install #####################################
140 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX} )
141
142 unset(TOOLSET)
143 unset(TARGET)