summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CAN-binder/etc/macros.cmake15
-rw-r--r--CAN-binder/libs/isotp-c/CMakeLists.txt3
-rw-r--r--CAN-binder/libs/uds-c/CMakeLists.txt3
3 files changed, 6 insertions, 15 deletions
diff --git a/CAN-binder/etc/macros.cmake b/CAN-binder/etc/macros.cmake
index 9d34aa7..ef6d5da 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()
diff --git a/CAN-binder/libs/isotp-c/CMakeLists.txt b/CAN-binder/libs/isotp-c/CMakeLists.txt
index a494212..fbb5161 100644
--- a/CAN-binder/libs/isotp-c/CMakeLists.txt
+++ b/CAN-binder/libs/isotp-c/CMakeLists.txt
@@ -32,12 +32,11 @@ PROJECT_TARGET_ADD(isotp-c)
)
# Define target includes
- get_target_property(Bitfield_inc bitfield-c INCLUDE_DIRECTORIES)
TARGET_INCLUDE_DIRECTORIES(${TARGET_NAME}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${Bitfield_inc}
)
# Library dependencies (include updates automatically)
TARGET_LINK_LIBRARIES(${TARGET_NAME}
+ bitfield-c
${link_libraries})
diff --git a/CAN-binder/libs/uds-c/CMakeLists.txt b/CAN-binder/libs/uds-c/CMakeLists.txt
index 34ae4ea..8f78fd6 100644
--- a/CAN-binder/libs/uds-c/CMakeLists.txt
+++ b/CAN-binder/libs/uds-c/CMakeLists.txt
@@ -31,12 +31,11 @@ PROJECT_TARGET_ADD(uds-c)
)
# Define target includes
- get_target_property(IsoTP_inc isotp-c INCLUDE_DIRECTORIES)
TARGET_INCLUDE_DIRECTORIES(${TARGET_NAME}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${IsoTP_inc}
)
# Library dependencies (include updates automatically)
TARGET_LINK_LIBRARIES(${TARGET_NAME}
+ isotp-c
${link_libraries})