File: CMakeLists.txt

package info (click to toggle)
cppcheck 2.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,132 kB
  • sloc: cpp: 268,935; python: 20,890; ansic: 8,090; sh: 1,045; makefile: 1,008; xml: 1,005; cs: 291
file content (30 lines) | stat: -rw-r--r-- 1,560 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
qt_wrap_cpp(test-cppchecklibrarydata_SRC testcppchecklibrarydata.h)
QT_ADD_RESOURCES(test-cppchecklibrarydata_resources "resources.qrc")
add_custom_target(build-cppchecklibrarydata-deps SOURCES ${test-cppchecklibrarydata_SRC} ${test-cppchecklibrarydata_resources})
add_dependencies(gui-build-deps build-cppchecklibrarydata-deps)
add_executable(test-cppchecklibrarydata
        ${test-cppchecklibrarydata_SRC}
        ${test-cppchecklibrarydata_resources}
        testcppchecklibrarydata.cpp
        ${CMAKE_SOURCE_DIR}/gui/cppchecklibrarydata.cpp
        )
target_include_directories(test-cppchecklibrarydata PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/gui)
target_compile_definitions(test-cppchecklibrarydata PRIVATE SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(test-cppchecklibrarydata ${QT_CORE_LIB} ${QT_TEST_LIB})

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    if(QT_VERSION VERSION_LESS "6.0.0")
        # Q_UNUSED() in generated code - see https://bugreports.qt.io/browse/QTBUG-82978
        target_compile_options_safe(test-cppchecklibrarydata -Wno-extra-semi-stmt)
    endif()
    if(QT_VERSION VERSION_GREATER_EQUAL "6.9.0")
        # caused by Qt generated moc code starting with 6.9.0 - see https://bugreports.qt.io/browse/QTBUG-135638
        target_compile_options_safe(test-cppchecklibrarydata -Wno-ctad-maybe-unsupported)
    endif()
endif()

if (REGISTER_GUI_TESTS)
    add_test(NAME test-cppchecklibrarydata COMMAND $<TARGET_FILE:test-cppchecklibrarydata>)
endif()

add_dependencies(gui-tests test-cppchecklibrarydata)