Skip to content

Commit f2fc38a

Browse files
susilehtoladanmar
authored andcommitted
Use modern CMake syntax. (#1273)
* Use modern CMake syntax. * Update way of finding Qt5 components
1 parent 0771a81 commit f2fc38a

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project(CppCheck)
2-
cmake_minimum_required(VERSION 2.8.4)
2+
cmake_minimum_required(VERSION 2.8.11)
33

44
include(GNUInstallDirs)
55

cmake/findDependencies.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
if (BUILD_GUI)
2-
set(GUI_QT_COMPONENTS Core Gui Widgets PrintSupport)
3-
find_package(Qt5 COMPONENTS ${GUI_QT_COMPONENTS})
2+
find_package(Qt5Core)
3+
find_package(Qt5Gui)
4+
find_package(Qt5Widgets)
5+
find_package(Qt5PrintSupport)
46
find_package(Qt5LinguistTools)
57
endif()
68

@@ -21,4 +23,3 @@ if (NOT ${USE_MATCHCOMPILER_OPT} STREQUAL "Off")
2123
set(USE_MATCHCOMPILER_OPT "Off")
2224
endif()
2325
endif()
24-

gui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (BUILD_GUI)
2424
if (HAVE_RULES)
2525
target_link_libraries(cppcheck-gui pcre)
2626
endif()
27-
qt5_use_modules(cppcheck-gui ${GUI_QT_COMPONENTS})
27+
target_link_libraries(cppcheck-gui Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::LinguistTools)
2828

2929
install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)
3030
install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)

0 commit comments

Comments
 (0)