aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-08-18 16:33:18 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-08-18 16:38:32 +0200
commit633bb4b92164b69825aafcb55d77715345ea2539 (patch)
tree2fc9dfb5ba16895744149e123e8a549842f8d73c
parent31a1f884f0953b3f3819f983b91d7be5fb59fef3 (diff)
Change how to define compile options
Move specific compilation options to the target it is related keep global compilation option in config.cmake then variable can be correctly evaluated and use with the correct values (CMAKE_INSTALL_PREFIX isn't the same before common.cmake inclusion and after.) Change-Id: Ia3c3fe6bc6fcdcb79858f233b108b9ee1e071131 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--CMakeLists.txt16
1 files changed, 15 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1b430b..c128184 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,10 +16,24 @@
# limitations under the License.
###########################################################################
-# Include LUA only when requested
+ADD_COMPILE_OPTIONS(-DCONTROL_ONLOAD_DEFAULT="onload-default")
+
+ADD_COMPILE_OPTIONS(-DCONTROL_DOSCRIPT_PRE="doscript")
+ADD_COMPILE_OPTIONS(-DCONTROL_CONFIG_PRE="onload")
+ADD_COMPILE_OPTIONS(-DCONTROL_CONFIG_POST="control")
+ADD_COMPILE_OPTIONS(-DCONTROL_CONFIG_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/config.d:${CMAKE_INSTALL_PREFIX}/controller/config.d")
+ADD_COMPILE_OPTIONS(-DCTL_PLUGIN_MAGIC=2468013579)
+ADD_COMPILE_OPTIONS(-DCONTROL_PLUGIN_PATH="${CMAKE_BINARY_DIR}:${CMAKE_INSTALL_PREFIX}/controller/plugin:/usr/lib/afb/controller/ctlplug")
+
+# Include LUA only when requested
if(CONTROL_SUPPORT_LUA)
message(STATUS "Notice: LUA Controler Support Selected")
set(CTL_LUA_SOURCE ctl-lua.c)
+ ADD_COMPILE_OPTIONS(-DCONTROL_SUPPORT_LUA)
+ ADD_COMPILE_OPTIONS(-DCONTROL_LUA_EVENT="luaevt")
+ ADD_COMPILE_OPTIONS(-DCONTROL_LUA_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/lua.d:${CMAKE_INSTALL_PREFIX}/controller/ctl-lua.d")
+else(CONTROL_SUPPORT_LUA)
+ message(STATUS "Warning: LUA Without Support ")
endif(CONTROL_SUPPORT_LUA)
# Add target to project dependency list