diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c90b0a0a9c14d63e2a9787c3deaaf020f7ac4884..1ca9ddfd313853802c7420615f0ccd2e798ad58c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,8 +5,6 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${Qt5Location_PRIVATE_INCLUDE_DIRS} - - qgcunittest ) set(EXTRA_SRC) @@ -43,23 +41,7 @@ if(BUILD_TESTING) add_dependencies(check QGroundControl) endfunction() - list(APPEND QGC_SRC - - qgcunittest/FileDialogTest.cc - qgcunittest/FileManagerTest.cc - qgcunittest/FlightGearTest.cc - qgcunittest/GeoTest.cc - qgcunittest/LinkManagerTest.cc - qgcunittest/MainWindowTest.cc - qgcunittest/MavlinkLogTest.cc - qgcunittest/MessageBoxTest.cc - qgcunittest/MultiSignalSpy.cc - qgcunittest/RadioConfigTest.cc - qgcunittest/TCPLinkTest.cc - qgcunittest/TCPLoopBackServer.cc - qgcunittest/UnitTest.cc - qgcunittest/UnitTestList.cc - ) + add_subdirectory(qgcunittest) add_qgc_test(AudioOutputTest) add_qgc_test(CameraCalcTest) @@ -214,5 +196,9 @@ target_link_libraries(qgc ViewWidgets ) +if(BUILD_TESTING) + target_link_libraries(qgc PUBLIC qgcunittest) +endif() + target_include_directories(qgc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/qgcunittest/CMakeLists.txt b/src/qgcunittest/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..cd1533f1aebe8293a27c69ccce5f3f066ca4db4c --- /dev/null +++ b/src/qgcunittest/CMakeLists.txt @@ -0,0 +1,28 @@ + +add_library(qgcunittest + FileDialogTest.cc + FileManagerTest.cc + FlightGearTest.cc + GeoTest.cc + LinkManagerTest.cc + MainWindowTest.cc + MavlinkLogTest.cc + MessageBoxTest.cc + MultiSignalSpy.cc + RadioConfigTest.cc + TCPLinkTest.cc + TCPLoopBackServer.cc + UnitTest.cc + UnitTestList.cc +) + +target_link_libraries(qgcunittest + PUBLIC + qgc +) + +target_include_directories(qgcunittest + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ) +