mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 02:39:48 -06:00
committed by
Brad King
parent
b480315e0c
commit
775c369420
@@ -1834,6 +1834,7 @@ cmSourceFile* cmQtAutoGenInitializer::RegisterGeneratedSource(
|
||||
cmSourceFile* gFile = this->Makefile->GetOrCreateSource(filename, true);
|
||||
gFile->MarkAsGenerated();
|
||||
gFile->SetProperty("SKIP_AUTOGEN", "1");
|
||||
gFile->SetProperty("SKIP_LINTING", "ON");
|
||||
return gFile;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
.*
|
||||
16
Tests/RunCMake/Autogen/AutogenSkipLinting.cmake
Normal file
16
Tests/RunCMake/Autogen/AutogenSkipLinting.cmake
Normal file
@@ -0,0 +1,16 @@
|
||||
enable_language(CXX)
|
||||
|
||||
find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "$<1:${PSEUDO_IWYU}>" -some -args)
|
||||
set(CMAKE_CXX_CLANG_TIDY "$<1:${PSEUDO_TIDY}>" -bad)
|
||||
set(CMAKE_CXX_CPPLINT "$<1:${PSEUDO_CPPLINT}>" --error)
|
||||
set(CMAKE_CXX_CPPCHECK "$<1:${PSEUDO_CPPCHECK}>" -error)
|
||||
|
||||
add_executable(SkipLinting SkipLinting.cxx SkipLinting.h)
|
||||
set_source_files_properties(SkipLinting.cxx PROPERTIES SKIP_LINTING TRUE)
|
||||
|
||||
target_link_libraries(SkipLinting Qt${with_qt_version}::Core
|
||||
Qt${with_qt_version}::Widgets
|
||||
Qt${with_qt_version}::Gui)
|
||||
@@ -87,5 +87,20 @@ if (DEFINED with_qt_version)
|
||||
message(STATUS "RunCMake_TEST_EXPECT_stdout: ${RunCMake_TEST_EXPECT_stdout}")
|
||||
run_cmake_command(AutogenUseSystemIncludeOff ${CMAKE_COMMAND} --build . --config Debug --verbose)
|
||||
endblock()
|
||||
|
||||
if(RunCMake_GENERATOR MATCHES "Make|Ninja")
|
||||
block()
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AutogenSkipLinting-build)
|
||||
list(APPEND RunCMake_TEST_OPTIONS
|
||||
"-DPSEUDO_CPPCHECK=${PSEUDO_CPPCHECK}"
|
||||
"-DPSEUDO_CPPLINT=${PSEUDO_CPPLINT}"
|
||||
"-DPSEUDO_IWYU=${PSEUDO_IWYU}"
|
||||
"-DPSEUDO_TIDY=${PSEUDO_TIDY}")
|
||||
|
||||
run_cmake(AutogenSkipLinting)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
run_cmake_command(AutogenSkipLinting-build ${CMAKE_COMMAND} --build . --config Debug --verbose)
|
||||
endblock()
|
||||
endif()
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
6
Tests/RunCMake/Autogen/SkipLinting.cxx
Normal file
6
Tests/RunCMake/Autogen/SkipLinting.cxx
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "SkipLinting.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
11
Tests/RunCMake/Autogen/SkipLinting.h
Normal file
11
Tests/RunCMake/Autogen/SkipLinting.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef SKIP_LINTING_H
|
||||
#define SKIP_LINTING_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class SkipMe : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -266,6 +266,10 @@ if(CMake_TEST_Qt6 AND Qt6Widgets_FOUND)
|
||||
-Dwith_qt_version=6
|
||||
"-DQt6_DIR:PATH=${Qt6_DIR}"
|
||||
"-DCMAKE_PREFIX_PATH:STRING=${base_dir}"
|
||||
-DPSEUDO_TIDY=$<TARGET_FILE:pseudo_tidy>
|
||||
-DPSEUDO_IWYU=$<TARGET_FILE:pseudo_iwyu>
|
||||
-DPSEUDO_CPPLINT=$<TARGET_FILE:pseudo_cpplint>
|
||||
-DPSEUDO_CPPCHECK=$<TARGET_FILE:pseudo_cppcheck>
|
||||
)
|
||||
set(want_NoQt_test FALSE)
|
||||
endif ()
|
||||
|
||||
Reference in New Issue
Block a user