diff options
-rw-r--r-- | templates/html5/etc/macros.cmake | 18 | ||||
-rw-r--r-- | templates/hybrid-html5/etc/macros.cmake | 18 | ||||
-rw-r--r-- | templates/native/etc/macros.cmake | 18 | ||||
-rw-r--r-- | templates/service/etc/macros.cmake | 18 |
4 files changed, 20 insertions, 52 deletions
diff --git a/templates/html5/etc/macros.cmake b/templates/html5/etc/macros.cmake index 9d34aa7..98ea3b5 100644 --- a/templates/html5/etc/macros.cmake +++ b/templates/html5/etc/macros.cmake @@ -28,17 +28,9 @@ # Generic useful macro # ----------------------- macro(PROJECT_TARGET_ADD TARGET_NAME) - set(PROJECT_TARGETS ${PROJECT_TARGETS} ${TARGET_NAME} CACHE INTERNAL PROJECT_TARGETS) + set_property(GLOBAL APPEND PROPERTY PROJECT_TARGETS ${TARGET_NAME}) set(TARGET_NAME ${TARGET_NAME}) - - # Cmake does not maintain targets list before 3.7 - # ------------------------------------------------- - if(${CMAKE_VERSION} VERSION_LESS 3.7) - set(GLOBAL_TARGET_LIST ${PROJECT_TARGETS} CACHE INTERNAL "Hold project targets") - else() - get_property(GLOBAL_TARGET_LIST GLOBAL PROPERTY GlobalTargetList) - endif() -endmacro(PROJECT_TARGET_ADD) +endmacro() # Check GCC minimal version version if (gcc_minimal_version) @@ -129,7 +121,7 @@ macro(project_package_build) DEPENDS ${PROJECT_TARGETS} COMMAND wgtpkg-pack -f -o ${PROJECT_NAME}.wgt ${WIDGET_DIR} ) - + add_custom_target(widget DEPENDS ${PROJECT_NAME}.wgt) add_dependencies(widget MAIN_POPULATE) set(ADDITIONAL_MAKE_CLEAN_FILES, "${PROJECT_NAME}.wgt") @@ -258,11 +250,11 @@ endif() # Print developer helper message when build is done # ------------------------------------------------------- macro(project_closing_msg) - if(CLOSING_MESSAGE AND GLOBAL_TARGET_LIST) + if(CLOSING_MESSAGE AND PROJECT_TARGETS) add_custom_target(${PROJECT_NAME}_build_done ALL COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "++ ${CLOSING_MESSAGE}" ) add_dependencies(${PROJECT_NAME}_build_done - ${DEPENDENCIES_TARGET} ${GLOBAL_TARGET_LIST}) + ${DEPENDENCIES_TARGET} ${PROJECT_TARGETS}) endif() endmacro() diff --git a/templates/hybrid-html5/etc/macros.cmake b/templates/hybrid-html5/etc/macros.cmake index 9d34aa7..98ea3b5 100644 --- a/templates/hybrid-html5/etc/macros.cmake +++ b/templates/hybrid-html5/etc/macros.cmake @@ -28,17 +28,9 @@ # Generic useful macro # ----------------------- macro(PROJECT_TARGET_ADD TARGET_NAME) - set(PROJECT_TARGETS ${PROJECT_TARGETS} ${TARGET_NAME} CACHE INTERNAL PROJECT_TARGETS) + set_property(GLOBAL APPEND PROPERTY PROJECT_TARGETS ${TARGET_NAME}) set(TARGET_NAME ${TARGET_NAME}) - - # Cmake does not maintain targets list before 3.7 - # ------------------------------------------------- - if(${CMAKE_VERSION} VERSION_LESS 3.7) - set(GLOBAL_TARGET_LIST ${PROJECT_TARGETS} CACHE INTERNAL "Hold project targets") - else() - get_property(GLOBAL_TARGET_LIST GLOBAL PROPERTY GlobalTargetList) - endif() -endmacro(PROJECT_TARGET_ADD) +endmacro() # Check GCC minimal version version if (gcc_minimal_version) @@ -129,7 +121,7 @@ macro(project_package_build) DEPENDS ${PROJECT_TARGETS} COMMAND wgtpkg-pack -f -o ${PROJECT_NAME}.wgt ${WIDGET_DIR} ) - + add_custom_target(widget DEPENDS ${PROJECT_NAME}.wgt) add_dependencies(widget MAIN_POPULATE) set(ADDITIONAL_MAKE_CLEAN_FILES, "${PROJECT_NAME}.wgt") @@ -258,11 +250,11 @@ endif() # Print developer helper message when build is done # ------------------------------------------------------- macro(project_closing_msg) - if(CLOSING_MESSAGE AND GLOBAL_TARGET_LIST) + if(CLOSING_MESSAGE AND PROJECT_TARGETS) add_custom_target(${PROJECT_NAME}_build_done ALL COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "++ ${CLOSING_MESSAGE}" ) add_dependencies(${PROJECT_NAME}_build_done - ${DEPENDENCIES_TARGET} ${GLOBAL_TARGET_LIST}) + ${DEPENDENCIES_TARGET} ${PROJECT_TARGETS}) endif() endmacro() diff --git a/templates/native/etc/macros.cmake b/templates/native/etc/macros.cmake index 9d34aa7..98ea3b5 100644 --- a/templates/native/etc/macros.cmake +++ b/templates/native/etc/macros.cmake @@ -28,17 +28,9 @@ # Generic useful macro # ----------------------- macro(PROJECT_TARGET_ADD TARGET_NAME) - set(PROJECT_TARGETS ${PROJECT_TARGETS} ${TARGET_NAME} CACHE INTERNAL PROJECT_TARGETS) + set_property(GLOBAL APPEND PROPERTY PROJECT_TARGETS ${TARGET_NAME}) set(TARGET_NAME ${TARGET_NAME}) - - # Cmake does not maintain targets list before 3.7 - # ------------------------------------------------- - if(${CMAKE_VERSION} VERSION_LESS 3.7) - set(GLOBAL_TARGET_LIST ${PROJECT_TARGETS} CACHE INTERNAL "Hold project targets") - else() - get_property(GLOBAL_TARGET_LIST GLOBAL PROPERTY GlobalTargetList) - endif() -endmacro(PROJECT_TARGET_ADD) +endmacro() # Check GCC minimal version version if (gcc_minimal_version) @@ -129,7 +121,7 @@ macro(project_package_build) DEPENDS ${PROJECT_TARGETS} COMMAND wgtpkg-pack -f -o ${PROJECT_NAME}.wgt ${WIDGET_DIR} ) - + add_custom_target(widget DEPENDS ${PROJECT_NAME}.wgt) add_dependencies(widget MAIN_POPULATE) set(ADDITIONAL_MAKE_CLEAN_FILES, "${PROJECT_NAME}.wgt") @@ -258,11 +250,11 @@ endif() # Print developer helper message when build is done # ------------------------------------------------------- macro(project_closing_msg) - if(CLOSING_MESSAGE AND GLOBAL_TARGET_LIST) + if(CLOSING_MESSAGE AND PROJECT_TARGETS) add_custom_target(${PROJECT_NAME}_build_done ALL COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "++ ${CLOSING_MESSAGE}" ) add_dependencies(${PROJECT_NAME}_build_done - ${DEPENDENCIES_TARGET} ${GLOBAL_TARGET_LIST}) + ${DEPENDENCIES_TARGET} ${PROJECT_TARGETS}) endif() endmacro() diff --git a/templates/service/etc/macros.cmake b/templates/service/etc/macros.cmake index 9d34aa7..98ea3b5 100644 --- a/templates/service/etc/macros.cmake +++ b/templates/service/etc/macros.cmake @@ -28,17 +28,9 @@ # Generic useful macro # ----------------------- macro(PROJECT_TARGET_ADD TARGET_NAME) - set(PROJECT_TARGETS ${PROJECT_TARGETS} ${TARGET_NAME} CACHE INTERNAL PROJECT_TARGETS) + set_property(GLOBAL APPEND PROPERTY PROJECT_TARGETS ${TARGET_NAME}) set(TARGET_NAME ${TARGET_NAME}) - - # Cmake does not maintain targets list before 3.7 - # ------------------------------------------------- - if(${CMAKE_VERSION} VERSION_LESS 3.7) - set(GLOBAL_TARGET_LIST ${PROJECT_TARGETS} CACHE INTERNAL "Hold project targets") - else() - get_property(GLOBAL_TARGET_LIST GLOBAL PROPERTY GlobalTargetList) - endif() -endmacro(PROJECT_TARGET_ADD) +endmacro() # Check GCC minimal version version if (gcc_minimal_version) @@ -129,7 +121,7 @@ macro(project_package_build) DEPENDS ${PROJECT_TARGETS} COMMAND wgtpkg-pack -f -o ${PROJECT_NAME}.wgt ${WIDGET_DIR} ) - + add_custom_target(widget DEPENDS ${PROJECT_NAME}.wgt) add_dependencies(widget MAIN_POPULATE) set(ADDITIONAL_MAKE_CLEAN_FILES, "${PROJECT_NAME}.wgt") @@ -258,11 +250,11 @@ endif() # Print developer helper message when build is done # ------------------------------------------------------- macro(project_closing_msg) - if(CLOSING_MESSAGE AND GLOBAL_TARGET_LIST) + if(CLOSING_MESSAGE AND PROJECT_TARGETS) add_custom_target(${PROJECT_NAME}_build_done ALL COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "++ ${CLOSING_MESSAGE}" ) add_dependencies(${PROJECT_NAME}_build_done - ${DEPENDENCIES_TARGET} ${GLOBAL_TARGET_LIST}) + ${DEPENDENCIES_TARGET} ${PROJECT_TARGETS}) endif() endmacro() |