X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=conf%2Funit%2FCMakeLists.txt;h=f3aed5d028a2f2c289ecf8656691d7c4a92ce480;hb=a123bb31906ef03ff813559aee426282416d729d;hp=e48c338a9a234ab7dc50901345ddf81745e058c0;hpb=63c180a63657bc7dd55bab423ea0c2751c87310b;p=src%2Fapp-framework-main.git diff --git a/conf/unit/CMakeLists.txt b/conf/unit/CMakeLists.txt index e48c338..f3aed5d 100644 --- a/conf/unit/CMakeLists.txt +++ b/conf/unit/CMakeLists.txt @@ -1,5 +1,5 @@ ########################################################################### -# Copyright (C) 2015-2018 IoT.bzh +# Copyright (C) 2015-2020 IoT.bzh # # author: José Bollo # @@ -18,14 +18,32 @@ cmake_minimum_required(VERSION 2.8) +find_program(M4EXEC m4) +mark_as_advanced(M4EXEC) + +file(GLOB in_afm_unit_list + LIST_DIRECTORIES false + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + CONFIGURE_DEPENDS + afm-unit *.inc +) +foreach(f IN LISTS in_afm_unit_list) + configure_file(${f} ${f}) + set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/afm-unit.conf APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${f}) +endforeach(f) if(AGL_DEVEL) - configure_file(afm-unit-debug.conf.in afm-unit.conf) -else() - configure_file(afm-unit.conf.in afm-unit.conf) + set(optm4 -DAGL_DEVEL) endif() +add_custom_command( + OUTPUT afm-unit.conf + COMMAND ${M4EXEC} ${optm4} -I. afm-unit > afm-unit.conf + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) +add_custom_target(unitconf ALL DEPENDS afm-unit.conf) if(NOT USE_SDK) install(DIRECTORY DESTINATION ${afm_confdir}/unit.env.d) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/afm-unit.conf DESTINATION ${afm_confdir}) + install(DIRECTORY DESTINATION ${afm_confdir}/widget.env.d) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/afm-unit.conf DESTINATION ${afm_confdir}) endif()