From 61adbdb64606c6adbb31c5fee958cc269761386f Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 24 Mar 2017 15:53:51 -0700 Subject: simplify CMake by using BspRootDirPath Introduce BspRootDirPath to cleanup paths. Also suppress generation of install files since we do cross compilation of firmwares by default. Signed-off-by: Stefan Agner --- .../ecspi_interrupt/master/armgcc/CMakeLists.txt | 76 +++++++++++----------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/examples/imx7_colibri_m4/driver_examples/ecspi/ecspi_interrupt/master/armgcc/CMakeLists.txt b/examples/imx7_colibri_m4/driver_examples/ecspi/ecspi_interrupt/master/armgcc/CMakeLists.txt index d556b13..4249705 100644 --- a/examples/imx7_colibri_m4/driver_examples/ecspi/ecspi_interrupt/master/armgcc/CMakeLists.txt +++ b/examples/imx7_colibri_m4/driver_examples/ecspi/ecspi_interrupt/master/armgcc/CMakeLists.txt @@ -1,5 +1,3 @@ -INCLUDE(CMakeForceCompiler) - # CROSS COMPILER SETTING SET(CMAKE_SYSTEM_NAME Generic) CMAKE_MINIMUM_REQUIRED (VERSION 2.6) @@ -17,15 +15,17 @@ SET(CMAKE_STATIC_LIBRARY_SUFFIX) SET(CMAKE_EXECUTABLE_LIBRARY_PREFIX) SET(CMAKE_EXECUTABLE_LIBRARY_SUFFIX) +SET(CMAKE_SKIP_INSTALL_RULES TRUE) # CURRENT DIRECTORY SET(ProjDirPath ${CMAKE_CURRENT_SOURCE_DIR}) +SET(BspRootDirPath ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../..) # DEBUG LINK FILE -set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -T${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/linker/gcc/MCIMX7D_M4_tcm.ld -static") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -T${BspRootDirPath}/platform/devices/MCIMX7D/linker/gcc/MCIMX7D_M4_tcm.ld -static") # RELEASE LINK FILE -set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -T${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/linker/gcc/MCIMX7D_M4_tcm.ld -static") +set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -T${BspRootDirPath}/platform/devices/MCIMX7D/linker/gcc/MCIMX7D_M4_tcm.ld -static") # DEBUG ASM FLAGS SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -g -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs -std=gnu99") @@ -59,44 +59,44 @@ SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DCPU_MCIMX7D_M4") # INCLUDE_DIRECTORIES IF(CMAKE_BUILD_TYPE MATCHES Debug) INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../..) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/CMSIS/Include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/devices) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/startup) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/drivers/inc) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/utilities/inc) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/CMSIS/Include) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices/MCIMX7D/include) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices/MCIMX7D/startup) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/drivers/inc) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/utilities/inc) INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../..) ELSEIF(CMAKE_BUILD_TYPE MATCHES Release) INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../..) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/CMSIS/Include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/devices) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/include) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/startup) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/drivers/inc) - INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../../../../platform/utilities/inc) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/CMSIS/Include) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices/MCIMX7D/include) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/devices/MCIMX7D/startup) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/drivers/inc) + INCLUDE_DIRECTORIES(${BspRootDirPath}/platform/utilities/inc) INCLUDE_DIRECTORIES(${ProjDirPath}/../../../../..) ENDIF() # ADD_EXECUTABLE ADD_EXECUTABLE(ecspi_interrupt_master_example - "${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S" - "${ProjDirPath}/../../../../../../../platform/utilities/src/debug_console_imx.c" - "${ProjDirPath}/../../../../../../../platform/utilities/inc/debug_console_imx.h" - "${ProjDirPath}/../../../../../../../platform/utilities/src/print_scan.c" - "${ProjDirPath}/../../../../../../../platform/utilities/src/print_scan.h" - "${ProjDirPath}/../../../../../../../platform/drivers/inc/ccm_analog_imx7d.h" - "${ProjDirPath}/../../../../../../../platform/drivers/inc/ccm_imx7d.h" - "${ProjDirPath}/../../../../../../../platform/drivers/inc/lmem.h" - "${ProjDirPath}/../../../../../../../platform/drivers/inc/rdc.h" - "${ProjDirPath}/../../../../../../../platform/drivers/inc/rdc_defs_imx7d.h" - "${ProjDirPath}/../../../../../../../platform/drivers/inc/wdog_imx.h" - "${ProjDirPath}/../../../../../../../platform/drivers/src/ccm_analog_imx7d.c" - "${ProjDirPath}/../../../../../../../platform/drivers/src/ccm_imx7d.c" - "${ProjDirPath}/../../../../../../../platform/drivers/src/lmem.c" - "${ProjDirPath}/../../../../../../../platform/drivers/src/rdc.c" - "${ProjDirPath}/../../../../../../../platform/drivers/src/wdog_imx.c" - "${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.c" - "${ProjDirPath}/../../../../../../../platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.h" + "${BspRootDirPath}/platform/devices/MCIMX7D/startup/gcc/startup_MCIMX7D_M4.S" + "${BspRootDirPath}/platform/utilities/src/debug_console_imx.c" + "${BspRootDirPath}/platform/utilities/inc/debug_console_imx.h" + "${BspRootDirPath}/platform/utilities/src/print_scan.c" + "${BspRootDirPath}/platform/utilities/src/print_scan.h" + "${BspRootDirPath}/platform/drivers/inc/ccm_analog_imx7d.h" + "${BspRootDirPath}/platform/drivers/inc/ccm_imx7d.h" + "${BspRootDirPath}/platform/drivers/inc/lmem.h" + "${BspRootDirPath}/platform/drivers/inc/rdc.h" + "${BspRootDirPath}/platform/drivers/inc/rdc_defs_imx7d.h" + "${BspRootDirPath}/platform/drivers/inc/wdog_imx.h" + "${BspRootDirPath}/platform/drivers/src/ccm_analog_imx7d.c" + "${BspRootDirPath}/platform/drivers/src/ccm_imx7d.c" + "${BspRootDirPath}/platform/drivers/src/lmem.c" + "${BspRootDirPath}/platform/drivers/src/rdc.c" + "${BspRootDirPath}/platform/drivers/src/wdog_imx.c" + "${BspRootDirPath}/platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.c" + "${BspRootDirPath}/platform/devices/MCIMX7D/startup/system_MCIMX7D_M4.h" "${ProjDirPath}/../../../../../pin_mux.c" "${ProjDirPath}/../../../../../pin_mux.h" "${ProjDirPath}/../../../../../board.c" @@ -105,10 +105,10 @@ ADD_EXECUTABLE(ecspi_interrupt_master_example "${ProjDirPath}/../../../../../clock_freq.h" "${ProjDirPath}/../hardware_init.c" "${ProjDirPath}/../main.c" - "${ProjDirPath}/../../../../../../../platform/drivers/src/ecspi.c" - "${ProjDirPath}/../../../../../../../platform/drivers/inc/ecspi.h" - "${ProjDirPath}/../../../../../../../platform/drivers/src/uart_imx.c" - "${ProjDirPath}/../../../../../../../platform/drivers/inc/uart_imx.h" + "${BspRootDirPath}/platform/drivers/src/ecspi.c" + "${BspRootDirPath}/platform/drivers/inc/ecspi.h" + "${BspRootDirPath}/platform/drivers/src/uart_imx.c" + "${BspRootDirPath}/platform/drivers/inc/uart_imx.h" ) SET_TARGET_PROPERTIES(ecspi_interrupt_master_example PROPERTIES OUTPUT_NAME "ecspi_interrupt_master_example.elf") -- cgit v1.2.3