diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-08-18 16:33:18 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-12-13 14:57:57 +0100 |
commit | 64ebe5f323878158785bbe76c09c8ac4e83623a3 (patch) | |
tree | 9f7d2016876f8b9c36170a6f85d0c912c51a307c /CMakeLists.txt | |
parent | 95f2b59cf3babc9efa3ab7df6033e1a04e41b5b8 (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>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
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 |