summaryrefslogtreecommitdiffstats
path: root/reference
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-17 16:54:17 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:20 +0200
commitcc1b9cf62b860a07b72746801435384beac0006f (patch)
tree03233b9509c17aa3690aa02ffccb37d806683ee1 /reference
parentbe34a0d145bb3b86cc91d3181465e32547688bc6 (diff)
GLOBAL property instead of cache var to handle project targets
Didn't find the property GlobalTargetList even in cmake 3.8. So using the existing variable. Change-Id: I2851d54d11daf2462321e234c577fde911d078ee Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'reference')
-rw-r--r--reference/etc/macros.cmake14
1 files changed, 3 insertions, 11 deletions
diff --git a/reference/etc/macros.cmake b/reference/etc/macros.cmake
index e2ed2f0..2d04d34 100644
--- a/reference/etc/macros.cmake
+++ b/reference/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,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()