|
@@ -10,11 +10,11 @@ foreach(FAMILY ${STM32_SUPPORTED_FAMILIES_LONG_NAME})
|
|
|
endforeach()
|
|
endforeach()
|
|
|
list(REMOVE_DUPLICATES STM32_SUPPORTED_FAMILIES_SHORT_NAME)
|
|
list(REMOVE_DUPLICATES STM32_SUPPORTED_FAMILIES_SHORT_NAME)
|
|
|
|
|
|
|
|
-if(NOT STM32_TOOLCHAIN_PATH AND NOT CMAKE_C_COMPILER)
|
|
|
|
|
- set(STM32_TOOLCHAIN_PATH "/usr")
|
|
|
|
|
- message(STATUS "No STM32_TOOLCHAIN_PATH specified, using default: " ${STM32_TOOLCHAIN_PATH})
|
|
|
|
|
-else()
|
|
|
|
|
- if(NOT STM32_TOOLCHAIN_PATH)
|
|
|
|
|
|
|
+if(NOT STM32_TOOLCHAIN_PATH)
|
|
|
|
|
+ if(NOT CMAKE_C_COMPILER)
|
|
|
|
|
+ set(STM32_TOOLCHAIN_PATH "/usr")
|
|
|
|
|
+ message(STATUS "No STM32_TOOLCHAIN_PATH specified, using default: " ${STM32_TOOLCHAIN_PATH})
|
|
|
|
|
+ else()
|
|
|
# keep only directory of compiler
|
|
# keep only directory of compiler
|
|
|
get_filename_component(STM32_TOOLCHAIN_PATH ${CMAKE_C_COMPILER} DIRECTORY)
|
|
get_filename_component(STM32_TOOLCHAIN_PATH ${CMAKE_C_COMPILER} DIRECTORY)
|
|
|
# remove the last /bin directory
|
|
# remove the last /bin directory
|