From e9395c042e6a13411366b5dd5f3b5f851de0f695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Sat, 25 Mar 2017 10:53:10 +0000 Subject: [PATCH] Fix #241 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Simões --- targets/CMSIS-OS/ChibiOS/Include/CMakeLists.txt | 9 +++++++-- targets/CMSIS-OS/ChibiOS/common/CMakeLists.txt | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/targets/CMSIS-OS/ChibiOS/Include/CMakeLists.txt b/targets/CMSIS-OS/ChibiOS/Include/CMakeLists.txt index 487f9ddf07..011c8fada4 100644 --- a/targets/CMSIS-OS/ChibiOS/Include/CMakeLists.txt +++ b/targets/CMSIS-OS/ChibiOS/Include/CMakeLists.txt @@ -10,5 +10,10 @@ list(APPEND TARGET_CHIBIOS_COMMON_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}") set(TARGET_CHIBIOS_COMMON_INCLUDE_DIRS ${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS} CACHE INTERNAL "make global") # add header with target platform definitions -configure_file("${CMAKE_SOURCE_DIR}/CMake/ChibiOS_target_os.h.in" - "${CMAKE_BINARY_DIR}/targets/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}/target_os.h" @ONLY) +if(CHIBIOS_COMMUNITY_TARGET) + configure_file("${CMAKE_SOURCE_DIR}/CMake/ChibiOS_target_os.h.in" + "${CMAKE_BINARY_DIR}/targets-community/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}/target_os.h" @ONLY) +else() + configure_file("${CMAKE_SOURCE_DIR}/CMake/ChibiOS_target_os.h.in" + "${CMAKE_BINARY_DIR}/targets/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}/target_os.h" @ONLY) +endif() diff --git a/targets/CMSIS-OS/ChibiOS/common/CMakeLists.txt b/targets/CMSIS-OS/ChibiOS/common/CMakeLists.txt index 05096b1ad6..74791bea99 100644 --- a/targets/CMSIS-OS/ChibiOS/common/CMakeLists.txt +++ b/targets/CMSIS-OS/ChibiOS/common/CMakeLists.txt @@ -10,5 +10,10 @@ list(APPEND TARGET_CHIBIOS_COMMON_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/WireProto set(TARGET_CHIBIOS_COMMON_SOURCES ${TARGET_CHIBIOS_COMMON_SOURCES} CACHE INTERNAL "make global") # add header with target platform definitions -configure_file("${CMAKE_SOURCE_DIR}/CMake/ChibiOS_target_os.h.in" - "${CMAKE_BINARY_DIR}/targets/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}/target_os.h" @ONLY) +if(CHIBIOS_COMMUNITY_TARGET) + configure_file("${CMAKE_SOURCE_DIR}/CMake/ChibiOS_target_os.h.in" + "${CMAKE_BINARY_DIR}/targets-community/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}/target_os.h" @ONLY) +else() + configure_file("${CMAKE_SOURCE_DIR}/CMake/ChibiOS_target_os.h.in" + "${CMAKE_BINARY_DIR}/targets/CMSIS-OS/ChibiOS/${CHIBIOS_BOARD}/target_os.h" @ONLY) +endif()