File tree Expand file tree Collapse file tree 7 files changed +21
-10
lines changed
Expand file tree Collapse file tree 7 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ set(CMAKE_C_STANDARD 11)
1212set (CMAKE_C_STANDARD_REQUIRED ON )
1313set (CMAKE_C_EXTENSIONS ON )
1414
15- if (NOT DEFINED CMAKE_BUILD_TYPE )
15+ if (NOT DEFINED CMAKE_PRESET_NAME )
1616 message (
1717 FATAL_ERROR
1818 "This project requires configuration using a CMake preset. Please use 'cmake --preset <preset-name>' or select a preset in your IDE."
@@ -51,6 +51,12 @@ message(
5151 ${CMAKE_BUILD_TYPE}
5252)
5353
54+ message (
55+ STATUS
56+ "Active CMake Preset: "
57+ ${CMAKE_PRESET_NAME}
58+ )
59+
5460# Projects
5561add_gr_project(STM32G474xE ECU)
5662
Original file line number Diff line number Diff line change 77 "generator" : " Ninja" ,
88 "binaryDir" : " ${sourceDir}/build/${presetName}" ,
99 "toolchainFile" : " ${sourceDir}/Lib/cmake/gcc-arm-none-eabi.cmake" ,
10- "cacheVariables" : {}
10+ "cacheVariables" : {
11+ "TARGET_TYPE" : " Embedded" ,
12+ "CMAKE_PRESET_NAME" : " ${presetName}"
13+ }
1114 },
1215 {
1316 "name" : " HOOTLTest" ,
1417 "generator" : " Ninja" ,
1518 "binaryDir" : " ${sourceDir}/build/${presetName}" ,
1619 "toolchainFile" : " ${sourceDir}/Lib/cmake/HOOTL.cmake" ,
1720 "cacheVariables" : {
18- "CMAKE_BUILD_TYPE" : " Debug"
21+ "CMAKE_BUILD_TYPE" : " Debug" ,
22+ "TARGET_TYPE" : " Host" ,
23+ "CMAKE_PRESET_NAME" : " ${presetName}"
1924 }
2025 },
2126 {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ endif()
1313# what, does in fact not get the filename of somthing but rather the name of the project from the path
1414get_filename_component (GR_PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME )
1515
16- if (CMAKE_BUILD_TYPE STREQUAL "Test " )
16+ if (CMAKE_PRESET_NAME STREQUAL "HOOTLTest " )
1717 add_executable (state_machine_tick_returns)
1818 target_include_directories (
1919 state_machine_tick_returns
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ target_include_directories(
77)
88
99if (
10- CMAKE_BUILD_TYPE
10+ CMAKE_PRESET_NAME
1111 STREQUAL
1212 "Debug"
1313 OR
14- CMAKE_BUILD_TYPE
14+ CMAKE_PRESET_NAME
1515 STREQUAL
1616 "RelWithDebInfo"
1717)
2626 )
2727endif ()
2828
29- if (CMAKE_BUILD_TYPE STREQUAL "Test " )
29+ if (CMAKE_PRESET_NAME STREQUAL "HOOTLTest " )
3030 target_compile_definitions (GLOBALSHARE_LIB INTERFACE LOGOMATIC_ENABLED)
3131
3232 add_executable (logomatic_simple)
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ target_sources(
1212 ${CMAKE_CURRENT_LIST_DIR} /Src/setBits.c
1313)
1414
15- if (CMAKE_BUILD_TYPE STREQUAL "Test " )
15+ if (CMAKE_PRESET_NAME STREQUAL "HOOTLTest " )
1616 add_executable (
1717 BitManipulations_VerifyGetBit_test
1818 ${CMAKE_CURRENT_LIST_DIR} /Test /verifyGetBit.c
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ target_include_directories(
1212)
1313
1414# link test to this library
15- if (CMAKE_BUILD_TYPE STREQUAL "Test " )
15+ if (CMAKE_PRESET_NAME STREQUAL "HOOTLTest " )
1616 # Initialization
1717 add_executable (
1818 CircularBuffer_Lib_Initialization_test
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function(add_gr_project)
1313 set (Platform ${ARGV0} )
1414 set (GR_PROJECT ${ARGV1} )
1515
16- if (CMAKE_BUILD_TYPE STREQUAL "Test " )
16+ if (CMAKE_PRESET_NAME STREQUAL "HOOTLTest " )
1717 if (DEFINED GR_PROJECT_PATH)
1818 add_subdirectory ("${GR_PROJECT} /${GR_PROJECT_PATH} " )
1919 else ()
You can’t perform that action at this time.
0 commit comments