No longer use deprecated qt5_use_modules (#5931)

QT 5.11 finally removes the qt5_use_modules macro.
Instead target_link_libraries with the Qt5::Lib added should be used.
Since we already use that in one place, it should work everywhere. Since
the common companion lib already depends on Core, widges and multimedia
components that link against it, also implicitly link against those
libraries.
This commit is contained in:
Arne Schwabe
2018-06-02 18:14:49 +02:00
committed by Bertrand Songis
parent 9612d6e347
commit ce77fbd2ff
7 changed files with 5 additions and 11 deletions
+1 -2
View File
@@ -36,8 +36,7 @@ if(Qt5Widgets_FOUND)
add_library(${SIMULATOR_TARGET} SHARED ${SIMULATOR_SRC})
add_dependencies(${SIMULATOR_TARGET} ${FIRMWARE_DEPENDENCIES})
target_compile_definitions(${SIMULATOR_TARGET} PUBLIC ${APP_COMMON_DEFINES}) # set in top-level CMakeLists
target_link_libraries(${SIMULATOR_TARGET} ${SDL_LIBRARY})
qt5_use_modules(${SIMULATOR_TARGET} Core)
target_link_libraries(${SIMULATOR_TARGET} ${SDL_LIBRARY} Qt5::Core)
add_custom_target(libsimulator DEPENDS ${SIMULATOR_TARGET})
# Prepare the "all-simu-libs" target to build simulator libraries for *every* supported PCB type (PCB_TYPES list)
+1 -2
View File
@@ -38,9 +38,8 @@ if(GTEST_INCDIR AND GTEST_SRCDIR AND Qt5Widgets_FOUND)
use_cxx11() # ensure gnu++11 in CXX_FLAGS with CMake < 3.1
add_executable(gtests EXCLUDE_FROM_ALL ${TEST_SRC_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/location.h ${RADIO_SRC} ../targets/simu/simpgmspace.cpp ../targets/simu/simueeprom.cpp ../targets/simu/simufatfs.cpp)
qt5_use_modules(gtests Core Widgets)
add_dependencies(gtests ${FIRMWARE_DEPENDENCIES} gtests-lib)
target_link_libraries(gtests gtests-lib pthread)
target_link_libraries(gtests gtests-lib pthread Qt5::Core Qt5::Widgets)
message(STATUS "Added optional gtests target")
else()
message(WARNING "WARNING: gtests target will not be available (check that GTEST_INCDIR, GTEST_SRCDIR, and Qt5Widgets are configured).")