aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/etc
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-17 17:54:48 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-19 11:36:43 +0200
commit20a1610830d9e972b19216606dccd9019708ec56 (patch)
tree2e44be09cf40daab9c088d31d0605f2d8ed328ee /CAN-binder/etc
parent7b64216f9d8784f28b79ea7545392036f190fb6c (diff)
Update latest CMakeLists files from app-templates.
Better handling of dependencies using TARGET_LINK_DIRECTORIES directive Change-Id: Iffead28aa2e2696cdc9103301d013deee2e6b1ab Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/etc')
-rw-r--r--CAN-binder/etc/macros.cmake15
1 files changed, 4 insertions, 11 deletions
diff --git a/CAN-binder/etc/macros.cmake b/CAN-binder/etc/macros.cmake
index 9d34aa7e..ef6d5dac 100644
--- a/CAN-binder/etc/macros.cmake
+++ b/CAN-binder/etc/macros.cmake
@@ -28,16 +28,8 @@
# 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)
# Check GCC minimal version version
@@ -258,11 +250,12 @@ endif()
# Print developer helper message when build is done
# -------------------------------------------------------
macro(project_closing_msg)
- if(CLOSING_MESSAGE AND GLOBAL_TARGET_LIST)
+ get_property(PROJECT_TARGETS GLOBAL PROPERTY PROJECT_TARGETS)
+ 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()