diff --git a/CMakeLists.txt b/CMakeLists.txt index 23d414cad..007d2c231 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,9 @@ set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio) set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src) set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake) -include(Bitmaps) add_subdirectory(${RADIO_SRC_DIRECTORY}) add_subdirectory(${COMPANION_SRC_DIRECTORY}) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 0e03f6246..51d63ce09 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -1,8 +1,5 @@ include(Macros) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/companion) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/companion) - if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR}) set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}") diff --git a/companion/src/firmwares/opentx/simulator/CMakeLists.txt b/companion/src/firmwares/opentx/simulator/CMakeLists.txt index 989aec998..3922a0009 100644 --- a/companion/src/firmwares/opentx/simulator/CMakeLists.txt +++ b/companion/src/firmwares/opentx/simulator/CMakeLists.txt @@ -67,7 +67,7 @@ add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES}) add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES}) add_library(opentx-horus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES}) -set(dependencies_9x 9x_bitmaps firmware_translations stamp) +set(dependencies_9x 9x_bitmaps firmware_translations) add_dependencies(opentx-9x${SUFFIX}-simulator ${dependencies_9x}) add_dependencies(opentx-9xr${SUFFIX}-simulator ${dependencies_9x}) add_dependencies(opentx-9x128${SUFFIX}-simulator ${dependencies_9x}) @@ -77,7 +77,7 @@ add_dependencies(opentx-mega2560${SUFFIX}-simulator ${dependencies_9x}) add_dependencies(opentx-sky9x${SUFFIX}-simulator ${dependencies_9x}) add_dependencies(opentx-9xrpro${SUFFIX}-simulator ${dependencies_9x}) add_dependencies(opentx-ar9x${SUFFIX}-simulator ${dependencies_9x}) -set(dependencies_taranis taranis_bitmaps firmware_translations stamp) +set(dependencies_taranis taranis_bitmaps firmware_translations) add_dependencies(opentx-taranis${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis) add_dependencies(opentx-taranisplus${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis) add_dependencies(opentx-taranisx9e${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis_x9e) diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 59971ec7d..1426c8b50 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -1,3 +1,6 @@ +include(CMakeForceCompiler) +include(Bitmaps) + option(PCB "Radio type") option(HELI "Heli menu" ON) option(FLIGHT_MODES "Flight Modes" ON) @@ -14,9 +17,8 @@ option(FAI "Competition mode (no telemetry)" OFF) option(AUTOSOURCE "Automatic source detection in menus" ON) option(AUTOSWITCH "Automatic switch detection in menus" ON) -set(OPT s) - enable_language(ASM) +set(OPT s) set(THIRDPARTY_DIR thirdparty) set(LUA_DIR ${THIRDPARTY_DIR}/Lua/src) @@ -657,8 +659,6 @@ endif() set(SRC ${SRC} ${FIRMWARE_SRC}) -include(CMakeForceCompiler) - set(WARNING_FLAGS "-Wall -Wno-strict-aliasing -Wformat -Wreturn-type -Wunused -Wuninitialized -Wunknown-pragmas -Wno-switch -Wtype-limits") # trick to remove the -rdynamic issue @@ -697,6 +697,7 @@ if(ARCH STREQUAL ARM) add_custom_target(firmware.bin COMMAND arm-none-eabi-objcopy -O binary firmware.elf firmware.bin DEPENDS firmware.elf + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) else() cmake_force_c_compiler(avr-gcc GNU) diff --git a/radio/src/targets/taranis/bootloader/CMakeLists.txt b/radio/src/targets/taranis/bootloader/CMakeLists.txt index b448ffb2a..1253c3afa 100644 --- a/radio/src/targets/taranis/bootloader/CMakeLists.txt +++ b/radio/src/targets/taranis/bootloader/CMakeLists.txt @@ -1,5 +1,7 @@ # TODO if the files order is different (these 2 SRC sections exchanged), the bootloader hangs for 20s in USB init. Why? +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + if(PCBREV STREQUAL REV9E) set(BOOTLOADER_SRC ${BOOTLOADER_SRC}