Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
18 changes: 18 additions & 0 deletions CMakeModules/add_submodule.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
if(NOT DEFINED MACRO_SUBMODULE_LOADED)
set( ADDED_MODULES "" CACHE INTERNAL "" )
set( MACRO_SUBMODULE_LOADED TRUE )
endif()


macro(add_submodule module_name)
get_property( added_modules CACHE ADDED_MODULES PROPERTY VALUE )
list( FIND added_modules "${module_name}" module_index )
if ( module_index EQUAL -1 )
message(STATUS "Adding module : ${module_name}")
add_subdirectory( ${CMAKE_SOURCE_DIR}/../lib/${module_name} ${CMAKE_BINARY_DIR}/${module_name} )
get_property( added_modules CACHE ADDED_MODULES PROPERTY VALUE )
list( APPEND added_modules "${module_name}" )
set( ADDED_MODULES "${added_modules}" CACHE INTERNAL "" )
get_property( added_modules_new CACHE ADDED_MODULES PROPERTY VALUE )
endif()
endmacro()
43 changes: 24 additions & 19 deletions controller_pc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
cmake_minimum_required( VERSION 2.8.11 )
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../CMakeModules" )
include( add_submodule )

enable_language( C CXX ASM )
project( controller_pc )

SET( board "pc" CACHE BOOL "board" )
SET( board "generic" CACHE BOOL "board" )

set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g3 -std=c11 -D_GNU_SOURCE -D_BSD_SOURCE -Wfatal-errors" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g3 -std=c++11 -DGE_LINUX -DGE_EGL -fpermissive -Wno-pmf-conversions -Wfatal-errors" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -g3 -std=c11 -D_GNU_SOURCE -D_BSD_SOURCE -Wfatal-errors" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -g3 -std=c++17 -DGE_LINUX -DGE_EGL -fpermissive -Wno-pmf-conversions -Wfatal-errors" )
set( CMAKE_AUTOMOC ON )
set( CMAKE_AUTORCC ON )
set( OpenGL_GL_PREFERENCE LEGACY )
Expand All @@ -20,6 +23,11 @@ find_package( MP4V2 )
find_package( Shine )

add_definitions( -DSTD=std )
add_definitions( -DLUA_CLASS= -DLUA_EXPORT= )
add_definitions( -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DSYSTEM_NAME_${CMAKE_SYSTEM_NAME} )
add_definitions( -DBOARD="${board}" -DBOARD_${board} -DVARIANT="${variant}" -DVARIANT_${variant} )
add_definitions( -DVERSION_STRING="bcflight_${board}_${VERSION_MAJOR}.${VERSION_MINOR}_${GIT_HASH}" )
add_definitions( -DTARGET_CPU_BITS=${TARGET_CPU_BITS} )

if ( WIN32 OR MINGW )
if ( NOT DEFINED ${QSCINTILLA_LIBRARY} OR ${QSCINTILLA_LIBRARY} MATCHES OFF )
Expand All @@ -35,16 +43,20 @@ else()
endif()


include_directories( ${CMAKE_SOURCE_DIR}/../libcontroller )
include_directories( ${CMAKE_SOURCE_DIR}/../libcontroller/links )
include_directories( ${CMAKE_SOURCE_DIR}/../librawwifi )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/boards/common )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/boards/${board} )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/controller )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/links )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/rawwifi )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/debug )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/luacore/src )
include_directories( ${CMAKE_SOURCE_DIR}/../external/LuaJIT-2.0.4/src )
include_directories( ${CMAKE_SOURCE_DIR}/../external/openh264-master/codec/api/svc )
include_directories( ${Qt5PrintSupport_INCLUDE_DIRS} ${QSCINTILLA_INCLUDE_DIR} ${QSCINTILLA_INCLUDE_DIR}/Qsci )
include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/ui ${CMAKE_BINARY_DIR} )

add_subdirectory( ${CMAKE_SOURCE_DIR}/../libcontroller libcontroller )
add_subdirectory( ${CMAKE_SOURCE_DIR}/../libdebug libdebug )
add_submodule( controller )
add_submodule( debug )
if ( ${RAWWIFI_ON} MATCHES 1 )
set( OTHER_LIBS ${OTHER_LIBS} rawwifi )
if ( WIN32 OR MINGW )
Expand All @@ -56,14 +68,8 @@ if ( RAWWIFI_ON MATCHES 0 )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_RAWWIFI" )
endif()

set( OTHER_LIBS ${OTHER_LIBS} -lfftw3f )
set( OTHER_LIBS ${OTHER_LIBS} -lfftw3f )

set( LUA_32 "" )
if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set( LUA_32 "-m32" )
endif()
# add_custom_target( libluajit_static COMMAND bash ${CMAKE_SOURCE_DIR}/../external/build_luajit.sh ${CMAKE_BINARY_DIR} ${CMAKE_C_COMPILER} ${CMAKE_ASM_COMPILER} ${CROSS}strip ${LUA_32} )
add_custom_target( libluajit_static COMMAND bash ${CMAKE_SOURCE_DIR}/../external/build_luajit.sh ${CMAKE_BINARY_DIR} ${CMAKE_C_COMPILER} ${CMAKE_ASM_COMPILER} ${CROSS}strip ${LUA_HOST_CC_OPTIONS} )
add_custom_target( libopenh264_static COMMAND bash ${CMAKE_SOURCE_DIR}/../external/build_openh264.sh ${CMAKE_BINARY_DIR} ${CMAKE_C_COMPILER} )

qt5_wrap_ui( controller_pc_UI
Expand Down Expand Up @@ -91,10 +97,9 @@ add_executable( controller_pc
)

add_dependencies( controller_pc libopenh264_static )
add_dependencies( controller_pc libluajit_static )
add_dependencies( controller_pc controller )
add_dependencies( controller_pc libdebug )
add_dependencies( controller_pc debuglib )

target_link_libraries( controller_pc -L./ controller libdebug -lluajit_static -ldecoder_static -lopenh264_static ${SHINE_LIBRARIES} ${MP4V2_LIBRARIES} ${QSCINTILLA_LIBRARY} Qt5::Widgets Qt5::OpenGL Qt5::PrintSupport Qt5::Multimedia ${OPENGL_LIBRARIES} -lpthread ${OTHER_LIBS} )
target_link_libraries( controller_pc -L./ controller debuglib boards -ldecoder_static -lopenh264_static ${SHINE_LIBRARIES} ${MP4V2_LIBRARIES} ${QSCINTILLA_LIBRARY} Qt5::Widgets Qt5::OpenGL Qt5::PrintSupport Qt5::Multimedia ${OPENGL_LIBRARIES} -lpthread ${OTHER_LIBS} )

install( TARGETS controller_pc RUNTIME DESTINATION bin )
6 changes: 3 additions & 3 deletions controller_pc/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ MainWindow::MainWindow()
std::function<Socket::PortType(const QString&)> socket_type = [](const QString& type){ if ( type == "UDPLite" ) return Socket::UDPLite; else if ( type == "UDP" ) return Socket::UDP; else return Socket::TCP; };
mControllerLink = new Socket( mConfig->value( "tcpip/address", "192.168.32.1" ).toString().toStdString(), mConfig->value( "tcpip/controller/port", 2020 ).toInt(), socket_type( mConfig->value( "tcpip/controller/type", "TCP" ).toString() ) );
mStreamLink = new Socket( mConfig->value( "tcpip/address", "192.168.32.1" ).toString().toStdString(), mConfig->value( "tcpip/video/port", 2021 ).toInt(), socket_type( mConfig->value( "tcpip/video/type", "UDPLite" ).toString() ) );
mAudioLink = new Socket( mConfig->value( "tcpip/address", "192.168.32.1" ).toString().toStdString(), mConfig->value( "tcpip/audio/port", 2022 ).toInt(), socket_type( mConfig->value( "tcpip/audio/type", "TCP" ).toString() ) );
// mAudioLink = new Socket( mConfig->value( "tcpip/address", "192.168.32.1" ).toString().toStdString(), mConfig->value( "tcpip/audio/port", 2022 ).toInt(), socket_type( mConfig->value( "tcpip/audio/type", "TCP" ).toString() ) );
}
uint8_t test[2048];
// mControllerLink->Read( test, 2048, 0 );
Expand Down Expand Up @@ -190,7 +190,7 @@ MainWindow::MainWindow()

ui->video->setMainWindow( this );
ui->video->setLink( mStreamLink );
ui->video->setAudioLink( mAudioLink );
// ui->video->setAudioLink( mAudioLink );
}


Expand Down Expand Up @@ -305,7 +305,7 @@ void MainWindow::updateData()
}

if ( mController->ping() < 10000 ) {
ui->latency->setText( QString::number( mController->ping() ) + " ms" );
ui->latency->setText( QString::number( mController->ping() / 1000 ) + " ms" );
}
ui->voltage->setText( QString::number( mController->batteryVoltage(), 'f', 2 ) + " V" );
ui->current->setText( QString::number( mController->currentDraw(), 'f', 2 ) + " A" );
Expand Down
3 changes: 2 additions & 1 deletion controller_pc/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "ControllerPC.h"
#include "ui_mainWindow.h"
#include "Socket.h"
#include "Debug.h"


#if ( defined(WIN32) && !defined(glActiveTexture) )
Expand Down Expand Up @@ -352,7 +353,7 @@ bool Stream::run()
}

if ( ( mSocketTellIPCounter = ( ( mSocketTellIPCounter + 1 ) % 16 ) ) == 1 ) {
// Dummy write to tell own IP address in case of Socket
// Dummy write to tell own IP address in case of UDP Socket
if ( dynamic_cast<Socket*>( mLink ) ) {
uint32_t uid = htonl( 0x12345678 );
mLink->Write( &uid, sizeof(uid), 0, -1 );
Expand Down
2 changes: 1 addition & 1 deletion controller_pc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <stdio.h>
#include <RawWifi.h>
#include <Socket.h>
#include <../libdebug/Debug.h>
#include <Debug.h>
#include "ControllerPC.h"

#include "MainWindow.h"
Expand Down
2 changes: 1 addition & 1 deletion controller_pc/ui/mainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ color: rgb(255, 255, 255);</string>
<customwidget>
<class>QsciScintilla</class>
<extends>QWidget</extends>
<header>qsciscintilla.h</header>
<header>Qsci/qsciscintilla.h</header>
<container>1</container>
</customwidget>
</customwidgets>
Expand Down
192 changes: 122 additions & 70 deletions controller_rc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,100 +1,152 @@
cmake_minimum_required( VERSION 2.6 )
cmake_minimum_required( VERSION 3.5 )
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../CMakeModules" )
include( add_submodule )

set( CMAKE_CXX_STANDARD 17 )
set( UIC uic )
set( RCC rcc )
set( MOC moc )

# Command line options
SET( board "rpi" CACHE BOOL "board" )
SET( rawwifi "0" CACHE BOOL "rawwifi" )
option( board "board" )
option( rawwifi "rawwifi" )

if ( NOT ${board} MATCHES OFF AND NOT ${board} MATCHES "generic" )
set( CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/../Toolchain-${board}.cmake )
endif()

enable_language( C CXX ASM )
project( controller_rc )

add_definitions( -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DSYSTEM_NAME_${CMAKE_SYSTEM_NAME} )
add_definitions( -DBOARD="${board}" -DBOARD_${board} -DVARIANT="${variant}" -DVARIANT_${variant} )
add_definitions( -DVERSION_STRING="bcflight_${board}_${VERSION_MAJOR}.${VERSION_MINOR}_${GIT_HASH}" )
add_definitions( -DTARGET_CPU_BITS=${TARGET_CPU_BITS} )
add_submodule( boards )

# Set compiler options
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -ggdb3 -O0 -D_DEFAULT_SOURCE" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ggdb3 -O0 -std=c++11 -DGE_LINUX -DGE_EGL -fpermissive -Wno-pmf-conversions" )

# Check chosen board
macro( DIRLIST result curdir removes )
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
foreach(child ${children})
if ( NOT "${child}" MATCHES ".md" )
string(REPLACE ".cpp" "" child ${child})
string(REPLACE ".h" "" child ${child})
list(APPEND dirlist ${child})
endif()
endforeach()
if ( NOT ${removes} MATCHES OFF )
list(REMOVE_ITEM dirlist ${removes})
endif()
list(REMOVE_DUPLICATES dirlist)
set(${result} ${dirlist})
endmacro()
DIRLIST( BOARDS ${CMAKE_SOURCE_DIR}/boards "" )

list( FIND BOARDS ${board} board_found )
if ( ${board_found} LESS 0 )
message( FATAL_ERROR "Board ${board} not supported.\nAvailable boards are :\n${BOARDS}" )
endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ggdb3 -O0 -std=c++17 -DGE_LINUX -DGE_EGL -fpermissive -Wno-pmf-conversions -Wno-psabi" )

include( boards/${board}/board.cmake )
include_directories( boards/${board} )
include_directories( ${CMAKE_SOURCE_DIR} )
include_directories( ${CMAKE_BINARY_DIR} )
add_definitions( -DBOARD="${board}" -DBOARD_${board} )
if ( ${USE_MINISTD} MATCHES TRUE )
add_definitions( -DSTD=ministd )
else()
add_definitions( -DSTD=std )
endif()

include_directories( ${CMAKE_SOURCE_DIR}/../libdebug )
include_directories( ${CMAKE_SOURCE_DIR}/../libcontroller )
include_directories( ${CMAKE_SOURCE_DIR}/../libcontroller/links )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/debug )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/controller )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/links )
if ( ${rawwifi} MATCHES "1" OR ${rawwifi} MATCHES "yes" OR ${rawwifi} MATCHES "true" )
include_directories( ${CMAKE_SOURCE_DIR}/../librawwifi )
set( RAWWIFI_LIBS rawwifi -lpcap )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/rawwifi )
# set( RAWWIFI_LIBS rawwifi -lpcap )
add_definitions( -DBUILD_rawwifi )
endif()

include_directories( ${CMAKE_BINARY_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/boards/${board} )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/luacore/src )
include_directories( ${CMAKE_SOURCE_DIR}/../external/LuaJIT-2.0.4/src )
add_subdirectory( ${CMAKE_SOURCE_DIR}/../libcontroller libcontroller )
add_subdirectory( ${CMAKE_SOURCE_DIR}/../libdebug libdebug )

add_custom_target( libluajit_static COMMAND bash ${CMAKE_SOURCE_DIR}/../external/build_luajit.sh ${CMAKE_BINARY_DIR} ${CMAKE_C_COMPILER} ${CMAKE_ASM_COMPILER} ${CROSS}strip "-m32" )
add_custom_target( ui_headers COMMAND
${UIC} ${CMAKE_SOURCE_DIR}/ui/main.ui > ${CMAKE_BINARY_DIR}/ui_main.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/window.ui > ${CMAKE_BINARY_DIR}/ui_window.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/calibrate.ui > ${CMAKE_BINARY_DIR}/ui_calibrate.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/camera.ui > ${CMAKE_BINARY_DIR}/ui_camera.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/network.ui > ${CMAKE_BINARY_DIR}/ui_network.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/settings.ui > ${CMAKE_BINARY_DIR}/ui_settings.h
include_directories( ${CMAKE_SOURCE_DIR}/../lib/boards/${board} )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/boards/common )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/maths )
include_directories( ${CMAKE_SOURCE_DIR}/../lib/sensors )
add_submodule( controller )
add_submodule( sensors )
add_submodule( debug )


file( GLOB HEADERS
${CMAKE_SOURCE_DIR}/*.h
${CMAKE_SOURCE_DIR}/boards/rpi/*.h
${CMAKE_SOURCE_DIR}/../lib/controller/*.h
${CMAKE_SOURCE_DIR}/../lib/links/*.h
)
file( GLOB BOARD_HEADERS ${CMAKE_SOURCE_DIR}/../lib/boards/common/*.h ${CMAKE_SOURCE_DIR}/../lib/boards/${board}/*.h )
list( APPEND HEADERS ${BOARD_HEADERS} )
message( WARNING ${HEADERS} )

# add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/rc_data.cpp COMMAND ${RCC} ${CMAKE_SOURCE_DIR}/ui/data.qrc > ${CMAKE_BINARY_DIR}/rc_data.cpp WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/MainWindow.moc.cpp COMMAND ${MOC} ${CMAKE_SOURCE_DIR}/ui/MainWindow.h > ${CMAKE_BINARY_DIR}/MainWindow.moc.cpp WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
set_source_files_properties( ${CMAKE_BINARY_DIR}/lua_init.cpp PROPERTIES GENERATED TRUE )
set_source_files_properties( ${CMAKE_BINARY_DIR}/rc_data.cpp PROPERTIES GENERATED TRUE )

file( GLOB_RECURSE BOARD_SOURCES boards/${board}/*.cpp boards/${board}/*.c )
file( GLOB_RECURSE ADCS_SOURCES ADCs/*.cpp ADCs/*.c )

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/lua_init.cpp
DEPENDS ${CMAKE_SOURCE_DIR}/../lib/luacore/classes.auto.lua ${HEADERS}
COMMAND ${CMAKE_SOURCE_DIR}/../lib/luacore/classes.auto.lua --init=lua_init --output="${CMAKE_BINARY_DIR}/lua_init.cpp" ${HEADERS}
)
add_custom_command(
OUTPUT
${CMAKE_BINARY_DIR}/ui_main.h
${CMAKE_BINARY_DIR}/ui_window.h
${CMAKE_BINARY_DIR}/ui_calibrate.h
${CMAKE_BINARY_DIR}/ui_camera.h
${CMAKE_BINARY_DIR}/ui_network.h
${CMAKE_BINARY_DIR}/ui_settings.h
COMMAND
${UIC} ${CMAKE_SOURCE_DIR}/ui/main.ui > ${CMAKE_BINARY_DIR}/ui_main.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/window.ui > ${CMAKE_BINARY_DIR}/ui_window.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/calibrate.ui > ${CMAKE_BINARY_DIR}/ui_calibrate.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/camera.ui > ${CMAKE_BINARY_DIR}/ui_camera.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/network.ui > ${CMAKE_BINARY_DIR}/ui_network.h
&& ${UIC} ${CMAKE_SOURCE_DIR}/ui/settings.ui > ${CMAKE_BINARY_DIR}/ui_settings.h
DEPENDS
${CMAKE_SOURCE_DIR}/ui/main.ui
${CMAKE_SOURCE_DIR}/ui/window.ui
${CMAKE_SOURCE_DIR}/ui/calibrate.ui
${CMAKE_SOURCE_DIR}/ui/camera.ui
${CMAKE_SOURCE_DIR}/ui/network.ui
${CMAKE_SOURCE_DIR}/ui/settings.ui
)
add_custom_target(ui_headers
DEPENDS
${CMAKE_BINARY_DIR}/ui_main.h
${CMAKE_BINARY_DIR}/ui_window.h
${CMAKE_BINARY_DIR}/ui_calibrate.h
${CMAKE_BINARY_DIR}/ui_camera.h
${CMAKE_BINARY_DIR}/ui_network.h
${CMAKE_BINARY_DIR}/ui_settings.h
)

add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/rc_data.cpp COMMAND ${RCC} ${CMAKE_SOURCE_DIR}/ui/data.qrc > ${CMAKE_BINARY_DIR}/rc_data.cpp WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/MainWindow.moc.cpp COMMAND ${MOC} ${CMAKE_SOURCE_DIR}/ui/MainWindow.h > ${CMAKE_BINARY_DIR}/MainWindow.moc.cpp WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )

add_executable( controller_rc
main.cpp
Config.cpp
ui/GlobalUI.cpp
ui/MainWindow.cpp
${CMAKE_BINARY_DIR}/rc_data.cpp
${CMAKE_BINARY_DIR}/MainWindow.moc.cpp
${ADCS_SOURCES}
${BOARD_SOURCES}
)
main.cpp
Config.cpp
ui/GlobalUI.cpp
ui/MainWindow.cpp
boards/${board}/ControllerClient.cpp
${CMAKE_BINARY_DIR}/rc_data.cpp
${CMAKE_BINARY_DIR}/MainWindow.moc.cpp
${CMAKE_BINARY_DIR}/lua_init.cpp
)

add_dependencies( controller_rc controller )
add_dependencies( controller_rc libluajit_static )
add_dependencies( controller_rc sensors )
add_dependencies( controller_rc maths )
add_dependencies( controller_rc ui_headers )
if ( BOARD_DEPENDENCIES )
add_dependencies( controller_rc ${BOARD_DEPENDENCIES} )
endif()


target_link_libraries( controller_rc -L./ controller libdebug libluajit_static.a -lrt -ldl ${RAWWIFI_LIBS} -lz pthread ${BOARD_LIBS} )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--unresolved-symbols=ignore-in-shared-libs -L${CMAKE_BINARY_DIR} ${BOARD_LIBS_PATHS}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--unresolved-symbols=ignore-in-shared-libs -L${CMAKE_BINARY_DIR} ${BOARD_LIBS_PATHS}" )
set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -Wl,--unresolved-symbols=ignore-in-shared-libs -L${CMAKE_BINARY_DIR} ${BOARD_LIBS_PATHS}" )
set(CMAKE_LINKER_FLAGS "${CMAKE_LD_FLAGS} -Wl,--unresolved-symbols=ignore-in-shared-libs -L${CMAKE_BINARY_DIR} ${BOARD_LIBS_PATHS}" )
target_link_libraries(
controller_rc
-L./
controller
sensors
debuglib
links
boards
maths
${RAWWIFI_LIBS}
Qt5Widgets Qt5Gui Qt5PrintSupport Qt5Core
-lrt
-ldl
-lz
${BOARD_LIBS}
pthread
)
# set( CONTROLLER_BOARD_LIBS ${CONTROLLER_BOARD_LIBS} -lGLESv2 -lEGL )

install( TARGETS controller_rc RUNTIME DESTINATION bin )
Loading