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()