diff --git a/targets/TARGET_Maxim/CMakeLists.txt b/targets/TARGET_Maxim/CMakeLists.txt index 62a98905d1..600313bd29 100644 --- a/targets/TARGET_Maxim/CMakeLists.txt +++ b/targets/TARGET_Maxim/CMakeLists.txt @@ -1,20 +1,18 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("MAX32620C" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_MAX32620C) -elseif("MAX32625" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_MAX32625) -elseif("MAX32630" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_MAX32630) -endif() -target_include_directories(mbed-core +add_subdirectory(TARGET_MAX32620C EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_MAX32625 EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_MAX32630 EXCLUDE_FROM_ALL) + + +target_include_directories(mbed-maxim INTERFACE . ) -target_sources(mbed-core +target_sources(mbed-maxim INTERFACE USBPhy_Maxim.cpp ) diff --git a/targets/TARGET_Maxim/TARGET_MAX32620C/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32620C/CMakeLists.txt index 5af9c92b7d..979b41ecb0 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32620C/CMakeLists.txt +++ b/targets/TARGET_Maxim/TARGET_MAX32620C/CMakeLists.txt @@ -1,17 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("MAX32620FTHR" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - TARGET_MAX32620FTHR - ) -elseif("SDT32620B" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - TARGET_SDT32620B - ) -endif() +add_subdirectory(TARGET_MAX32620FTHR EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_SDT32620B EXCLUDE_FROM_ALL) if(${MBED_TOOLCHAIN} STREQUAL "ARM") set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MAX32620.sct) @@ -21,16 +12,18 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_max32620.S) endif() -set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) +add_library(mbed-maxim-max32620c INTERFACE) -target_include_directories(mbed-core +target_include_directories(mbed-maxim-max32620c INTERFACE . device mxc ) -target_sources(mbed-core +mbed_set_linker_script(mbed-maxim-max32620c ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + +target_sources(mbed-maxim-max32620c INTERFACE PeripheralPins.c analogin_api.c @@ -81,3 +74,8 @@ target_sources(mbed-core ${STARTUP_FILE} ) + +target_link_libraries(mbed-maxim-max32620c + INTERFACE + mbed-maxim +) diff --git a/targets/TARGET_Maxim/TARGET_MAX32620C/TARGET_MAX32620FTHR/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32620C/TARGET_MAX32620FTHR/CMakeLists.txt new file mode 100644 index 0000000000..bd859d478e --- /dev/null +++ b/targets/TARGET_Maxim/TARGET_MAX32620C/TARGET_MAX32620FTHR/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-max32620fthr INTERFACE) + +target_include_directories(mbed-max32620fthr + INTERFACE + . +) + +target_link_libraries(mbed-max32620fthr INTERFACE mbed-maxim-max32620c) diff --git a/targets/TARGET_Maxim/TARGET_MAX32620C/TARGET_SDT32620B/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32620C/TARGET_SDT32620B/CMakeLists.txt new file mode 100644 index 0000000000..32835a050b --- /dev/null +++ b/targets/TARGET_Maxim/TARGET_MAX32620C/TARGET_SDT32620B/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-sdt32620b INTERFACE) + +target_include_directories(mbed-max32625 + INTERFACE + . +) + +target_link_libraries(mbed-sdt32620b INTERFACE mbed-maxim-max32620c) diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32625/CMakeLists.txt index e875e8e9f7..50e976278f 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32625/CMakeLists.txt +++ b/targets/TARGET_Maxim/TARGET_MAX32625/CMakeLists.txt @@ -1,56 +1,25 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("MAX32625MBED" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - TARGET_MAX32625MBED - ) -elseif("MAX32625PICO" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - TARGET_MAX32625PICO - ) - - target_sources(mbed-core - INTERFACE - TARGET_MAX32625PICO/low_level_init.c - ) -elseif("SDT32625B" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - TARGET_SDT32625B - ) -endif() +add_subdirectory(TARGET_MAX32625MBED EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_MAX32625PICO EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_SDT32625B EXCLUDE_FROM_ALL) +add_subdirectory(device EXCLUDE_FROM_ALL) if(${MBED_TOOLCHAIN} STREQUAL "ARM") - if("MAX32625_BOOT" IN_LIST MBED_TARGET_LABELS) - set(LINKER_FILE device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct) - elseif("MAX32625_NO_BOOT" IN_LIST MBED_TARGET_LABELS) - set(LINKER_FILE device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_NO_BOOT/MAX32625.sct) - endif() - set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MAX32625.S) elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - if("MAX32625_BOOT" IN_LIST MBED_TARGET_LABELS) - set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_BOOT/max32625.ld) - elseif("MAX32625_NO_BOOT" IN_LIST MBED_TARGET_LABELS) - set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_NO_BOOT/max32625.ld) - endif() - set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_max32625.S) endif() -set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) - -target_include_directories(mbed-core +target_include_directories(mbed-max32625 INTERFACE . device mxc ) -target_sources(mbed-core +target_sources(mbed-max32625 INTERFACE PeripheralPins.c analogin_api.c diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625MBED/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625MBED/CMakeLists.txt new file mode 100644 index 0000000000..e996bdf02c --- /dev/null +++ b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625MBED/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-max3265mbed INTERFACE) + +target_include_directories(mbed-max3265mbed + INTERFACE + . +) + +target_link_libraries(mbed-max3265mbed INTERFACE mbed-max32625 mbed-max32625-no-boot) diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/CMakeLists.txt new file mode 100644 index 0000000000..2caee0a28c --- /dev/null +++ b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-max32625pico INTERFACE) + +target_include_directories(mbed-max32625pico + INTERFACE + . +) + +target_sources(mbed-max32625pico + INTERFACE + low_level_init.c +) + +target_link_libraries(mbed-max32625pico INTERFACE mbed-max32625 mbed-max32625-boot) diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_SDT32625B/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_SDT32625B/CMakeLists.txt new file mode 100644 index 0000000000..36b7a94165 --- /dev/null +++ b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_SDT32625B/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-sdt32625bp INTERFACE) + +target_include_directories(mbed-sdt32625bp + INTERFACE + . +) + +target_link_libraries(mbed-sdt32625bp INTERFACE mbed-max32625 mbed-max32625-no-boot) diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32625/device/CMakeLists.txt new file mode 100644 index 0000000000..097868b70d --- /dev/null +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-max32625-boot INTERFACE) + +if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_BOOT TOOLCHAIN_GCC_ARM/TARGET_MAX32625_BOOT/max32625.ld) +elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_BOOT TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct) +endif() + +mbed_set_linker_script(mbed-max32625-boot ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + +add_library(mbed-max32625-no-boot INTERFACE) + +if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_NO_BOOT device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625_NO_BOOT/max32625.ld) +elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_NO_BOOT device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_NO_BOOT/MAX32625.sct) +endif() + +mbed_set_linker_script(mbed-max32625-no-boot ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + diff --git a/targets/TARGET_Maxim/TARGET_MAX32630/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32630/CMakeLists.txt index eac204f8b4..46c1c5bd92 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32630/CMakeLists.txt +++ b/targets/TARGET_Maxim/TARGET_MAX32630/CMakeLists.txt @@ -1,17 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("MAX32630FTHR" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - TARGET_MAX32630FTHR - ) - - target_sources(mbed-core - INTERFACE - TARGET_MAX32630FTHR/low_level_init.c - ) -endif() +add_subdirectory(TARGET_MAX32630FTHR EXCLUDE_FROM_ALL) if(${MBED_TOOLCHAIN} STREQUAL "ARM") set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MAX3263x.sct) @@ -27,18 +17,16 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") set(LIB_EXACT_LE TOOLCHAIN_GCC_ARM/libexactLE.a) endif() -set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) +add_library(mbed-maxim-max32630 INTERFACE) -target_link_libraries(mbed-core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_EXACT_LE}) - -target_include_directories(mbed-core +target_include_directories(mbed-maxim-max32630 INTERFACE . device mxc ) -target_sources(mbed-core +target_sources(mbed-maxim-max32630 INTERFACE PeripheralPins.c analogin_api.c @@ -86,3 +74,9 @@ target_sources(mbed-core ${STARTUP_FILE} ) + +target_link_libraries(mbed-maxim-max32630 + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_EXACT_LE} + mbed-maxim +) diff --git a/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR/CMakeLists.txt b/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR/CMakeLists.txt new file mode 100644 index 0000000000..f0eebe3cb8 --- /dev/null +++ b/targets/TARGET_Maxim/TARGET_MAX32630/TARGET_MAX32630FTHR/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-max32630fthr INTERFACE) + +target_include_directories(mbed-max32630fthr + INTERFACE + TARGET_MAX32630FTHR +) + +target_sources(mbed-core + INTERFACE + TARGET_MAX32630FTHR/low_level_init.c +) + +target_link_libraries(mbed-max32630fthr INTERFACE mbed-max32630)