diff options
171 files changed, 1040 insertions, 473 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index fa21a1f..82d5588 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -167,6 +167,8 @@ Properties on Targets /prop_tgt/IMPORTED_CONFIGURATIONS /prop_tgt/IMPORTED_IMPLIB_CONFIG /prop_tgt/IMPORTED_IMPLIB + /prop_tgt/IMPORTED_LIBNAME_CONFIG + /prop_tgt/IMPORTED_LIBNAME /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES /prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES_CONFIG diff --git a/Help/prop_tgt/IMPORTED_LIBNAME.rst b/Help/prop_tgt/IMPORTED_LIBNAME.rst new file mode 100644 index 0000000..1943dba --- /dev/null +++ b/Help/prop_tgt/IMPORTED_LIBNAME.rst @@ -0,0 +1,23 @@ +IMPORTED_LIBNAME +---------------- + +Specify the link library name for an :ref:`imported <Imported Targets>` +:ref:`Interface Library <Interface Libraries>`. + +An interface library builds no library file itself but does specify +usage requirements for its consumers. The ``IMPORTED_LIBNAME`` +property may be set to specify a single library name to be placed +on the link line in place of the interface library target name as +a requirement for using the interface. + +This property is intended for use in naming libraries provided by +a platform SDK for which the full path to a library file may not +be known. The value may be a plain library name such as ``foo`` +but may *not* be a path (e.g. ``/usr/lib/libfoo.so``) or a flag +(e.g. ``-Wl,...``). The name is never treated as a library target +name even if it happens to name one. + +The ``IMPORTED_LIBNAME`` property is allowed only on +:ref:`imported <Imported Targets>` :ref:`Interface Libraries` +and is rejected on targets of other types (for which +the :prop_tgt:`IMPORTED_LOCATION` target property may be used). diff --git a/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst b/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst new file mode 100644 index 0000000..a28b838 --- /dev/null +++ b/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst @@ -0,0 +1,7 @@ +IMPORTED_LIBNAME_<CONFIG> +------------------------- + +<CONFIG>-specific version of :prop_tgt:`IMPORTED_LIBNAME` property. + +Configuration names correspond to those provided by the project from +which the target is imported. diff --git a/Help/release/dev/cpack-rpm-omit-unsupported-tags.rst b/Help/release/dev/cpack-rpm-omit-unsupported-tags.rst new file mode 100644 index 0000000..abcb7a6 --- /dev/null +++ b/Help/release/dev/cpack-rpm-omit-unsupported-tags.rst @@ -0,0 +1,8 @@ +cpack-rpm-omit-unsupported-tags +------------------------------- + +* The :module:`CPackRPM` module learned to omit + tags that are not supported by provided + rpmbuild tool. If unsupported tags are set + they are ignored and a developer warning is + printed out. diff --git a/Help/release/dev/imported-interface-libname.rst b/Help/release/dev/imported-interface-libname.rst new file mode 100644 index 0000000..fdbae78 --- /dev/null +++ b/Help/release/dev/imported-interface-libname.rst @@ -0,0 +1,7 @@ +imported-interface-libname +-------------------------- + +* :ref:`Imported <Imported Targets>` :ref:`Interface Libraries` learned new + :prop_tgt:`IMPORTED_LIBNAME` and :prop_tgt:`IMPORTED_LIBNAME_<CONFIG>` + target properties to specify a link library name since interface libraries + do not build their own library files. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 2483a13..39697f0 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -1844,6 +1844,12 @@ function(cpack_rpm_generate_package) set(CPACK_RPM_PACKAGE_RELOCATABLE FALSE) # disable relocatable option if building source RPM endif() + execute_process( + COMMAND "${RPMBUILD_EXECUTABLE}" --querytags + OUTPUT_VARIABLE RPMBUILD_TAG_LIST + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REPLACE "\n" ";" RPMBUILD_TAG_LIST "${RPMBUILD_TAG_LIST}") + # Check if additional fields for RPM spec header are given # There may be some COMPONENT specific variables as well # If component specific var is not provided we use the global one @@ -1852,6 +1858,7 @@ function(cpack_rpm_generate_package) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}") endif() + if(CPACK_RPM_PACKAGE_COMPONENT) cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}" "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}" @@ -1859,9 +1866,24 @@ function(cpack_rpm_generate_package) endif() if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + # Prefix can be replaced by Prefixes but the old version stil works so we'll ignore it for now + # Requires* is a special case because it gets transformed to Requires(pre/post/preun/postun) + # Auto* is a special case because the tags can not be queried by querytags rpmbuild flag + set(special_case_tags_ PREFIX REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN AUTOPROV AUTOREQ AUTOREQPROV) + if(NOT _RPM_SPEC_HEADER IN_LIST RPMBUILD_TAG_LIST AND NOT _RPM_SPEC_HEADER IN_LIST special_case_tags_) + cmake_policy(POP) + message(AUTHOR_WARNING "CPackRPM:Warning: ${_RPM_SPEC_HEADER} not " + "supported in provided rpmbuild. Tag will not be used.") + continue() + endif() + cmake_policy(POP) + if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") endif() + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) endif() @@ -2416,6 +2438,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_PROVIDES\@ \@TMP_RPM_OBSOLETES\@ \@TMP_RPM_CONFLICTS\@ +\@TMP_RPM_SUGGESTS\@ \@TMP_RPM_AUTOPROV\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ @@ -2470,6 +2493,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_PROVIDES\@ \@TMP_RPM_OBSOLETES\@ \@TMP_RPM_CONFLICTS\@ +\@TMP_RPM_SUGGESTS\@ \@TMP_RPM_AUTOPROV\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 072a27a..3f75b19 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -193,7 +193,7 @@ function(_pkg_create_imp_target _prefix _no_cmake_path _no_cmake_environment_pat foreach (flag IN LISTS ${_prefix}_LDFLAGS) if (flag MATCHES "^-L(.*)") # only look into the given paths from now on - set(_find_opts "HINTS ${${CMAKE_MATCH_1}} NO_DEFAULT_PATH") + set(_find_opts HINTS ${CMAKE_MATCH_1} NO_DEFAULT_PATH) continue() endif() if (flag MATCHES "^-l(.*)") diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt index dee57b5..3a66f68 100644 --- a/Modules/FortranCInterface/CMakeLists.txt +++ b/Modules/FortranCInterface/CMakeLists.txt @@ -94,6 +94,9 @@ add_library(myfort STATIC mysub.f my_sub.f ${myfort_modules}) # Provide symbols through C but fall back to Fortran. add_library(symbols STATIC ${symbol_sources}) target_link_libraries(symbols myfort) +# In case the Fortran compiler produces PIC by default make sure +# the C compiler produces PIC even if it is not its default. +set_property(TARGET symbols PROPERTY POSITION_INDEPENDENT_CODE 1) # Require symbols through Fortran. add_executable(FortranCInterface main.F call_sub.f ${call_mod}) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ac54c5d..b1549a1 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 7) -set(CMake_VERSION_PATCH 20161106) +set(CMake_VERSION_PATCH 20161109) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 7ee0f75..08ea4ee 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -22,6 +22,7 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index d21471d..d10f7ad 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -926,7 +926,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( return false; } size_t fileSize = static_cast<size_t>(st.st_size); - FILE* fp = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); + FILE* fp = cmsys::SystemTools::Fopen(local_file, "rb"); if (!fp) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot open file: " << local_file << std::endl); diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 9038469..5e03c39 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -5,6 +5,7 @@ #include "CMakeSetupDialog.h" #include "cmAlgorithms.h" #include "cmDocumentation.h" +#include "cmDocumentationEntry.h" #include "cmVersion.h" #include "cmake.h" #include <QApplication> @@ -17,6 +18,7 @@ #include <cmsys/CommandLineArguments.hxx> #include <cmsys/Encoding.hxx> #include <cmsys/SystemTools.hxx> +#include <iostream> #include "cmSystemTools.h" // IWYU pragma: keep diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index aa55379..22f69fa 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -3,9 +3,17 @@ #ifndef cmAlgorithms_h #define cmAlgorithms_h -#include <cmConfigure.h> - -#include "cmStandardIncludes.h" +#include <cmConfigure.h> // IWYU pragma: keep + +#include <algorithm> +#include <cm_kwiml.h> +#include <functional> +#include <iterator> +#include <sstream> +#include <string.h> +#include <string> +#include <utility> +#include <vector> inline bool cmHasLiteralPrefixImpl(const std::string& str1, const char* str2, size_t N) diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 655c42a..942688c 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -2,9 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCMakeMinimumRequired.h" +#include <sstream> +#include <stdio.h> + #include "cmMakefile.h" #include "cmSystemTools.h" #include "cmVersion.h" +#include "cmake.h" + +class cmExecutionStatus; // cmCMakeMinimumRequired bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args, diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index 3acedd2..08a5c38 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -3,8 +3,14 @@ #ifndef cmCMakeMinimumRequired_h #define cmCMakeMinimumRequired_h +#include <cmConfigure.h> +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmCMakeMinimumRequired * \brief cmake_minimum_required command * diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index b70074e..d1f8446 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -408,7 +408,7 @@ char CCONV* cmExpandVariablesInString(void* arg, const char* source, std::string result = mf->ExpandVariablesInString( barf, (escapeQuotes ? true : false), (atOnly ? true : false)); char* res = static_cast<char*>(malloc(result.size() + 1)); - if (result.size()) { + if (!result.empty()) { strcpy(res, result.c_str()); } res[result.size()] = '\0'; @@ -570,7 +570,7 @@ void* CCONV cmAddSource(void* arg, void* arg2) rsf->GetProperties() = osf->Properties; for (std::vector<std::string>::iterator i = osf->Depends.begin(); i != osf->Depends.end(); ++i) { - rsf->AddDepend(i->c_str()); + rsf->AddDepend(*i); } // Create the proxy for the real source file. @@ -676,7 +676,7 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir, std::string hname = pathname; if (cmSystemTools::FileExists(hname.c_str())) { sf->SourceName = cmSystemTools::GetFilenamePath(name); - if (sf->SourceName.size() > 0) { + if (!sf->SourceName.empty()) { sf->SourceName += "/"; } sf->SourceName += cmSystemTools::GetFilenameWithoutLastExtension(name); @@ -756,7 +756,7 @@ void CCONV cmSourceFileSetName2(void* arg, const char* name, const char* dir, fname += "."; fname += ext; } - sf->FullPath = cmSystemTools::CollapseFullPath(fname.c_str(), dir); + sf->FullPath = cmSystemTools::CollapseFullPath(fname, dir); cmSystemTools::ConvertToUnixSlashes(sf->FullPath); sf->SourceExtension = ext; } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 024260c..010fc4e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2,6 +2,27 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTest.h" +#include <cm_curl.h> +#include <cm_zlib.h> +#include <cmsys/Base64.h> +#include <cmsys/Directory.hxx> +#include <cmsys/FStream.hxx> +#include <cmsys/Glob.hxx> +#include <cmsys/Process.h> +#include <cmsys/String.hxx> +#include <cmsys/SystemInformation.hxx> +#include <ctype.h> +#include <iostream> +#include <map> +#include <sstream> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <string> +#include <time.h> +#include <utility> +#include <vector> + #include "cmAlgorithms.h" #include "cmCTestBuildAndTestHandler.h" #include "cmCTestBuildHandler.h" @@ -21,35 +42,15 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmVersionConfig.h" #include "cmXMLWriter.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include <cm_auto_ptr.hxx> -#include <cm_curl.h> -#include <cm_zlib.h> -#include <cmsys/Base64.h> -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/Process.h> -#include <cmsys/String.hxx> -#include <cmsys/SystemInformation.hxx> -#include <ctype.h> -#include <iostream> -#include <map> -#include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <string> -#include <time.h> -#include <utility> -#include <vector> - #if defined(__BEOS__) || defined(__HAIKU__) #include <be/kernel/OS.h> /* disable_debugger() API. */ #endif diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index e84012c..cb0ba63 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -2,11 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCacheManager.h" -#include "cmGeneratedFileStream.h" -#include "cmSystemTools.h" -#include "cmVersion.h" -#include "cmake.h" - #include <algorithm> #include <cmsys/FStream.hxx> #include <cmsys/Glob.hxx> @@ -14,6 +9,12 @@ #include <stdio.h> #include <string.h> +#include "cmGeneratedFileStream.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmVersion.h" +#include "cmake.h" + cmCacheManager::cmCacheManager() { this->CacheMajorVersion = 0; diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 90731f5..e82c9ef 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -5,9 +5,6 @@ #include <cmConfigure.h> // IWYU pragma: keep -#include "cmPropertyMap.h" -#include "cmState.h" - #include <iosfwd> #include <map> #include <set> @@ -15,6 +12,9 @@ #include <utility> #include <vector> +#include "cmPropertyMap.h" +#include "cmStateTypes.h" + class cmake; /** \class cmCacheManager diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h index 50af2e2..b19b0f9 100644 --- a/Source/cmCommandArgumentsHelper.h +++ b/Source/cmCommandArgumentsHelper.h @@ -5,10 +5,12 @@ #include <cmConfigure.h> -#include "cmStandardIncludes.h" +#include <set> +#include <string> +#include <vector> -class cmCommandArgumentsHelper; class cmCommandArgumentGroup; +class cmCommandArgumentsHelper; /* cmCommandArgumentsHelper, cmCommandArgumentGroup and cmCommandArgument (i.e. its derived classes cmCAXXX can be used to simplify the processing of diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 95b95c1..c3a925f 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCommonTargetGenerator.h" -#include <algorithm> #include <cmConfigure.h> #include <set> #include <sstream> @@ -16,8 +15,8 @@ #include "cmLocalCommonGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmOutputConverter.h" #include "cmSourceFile.h" -#include "cmStateDirectory.h" #include "cmStateTypes.h" cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt) diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index fe27038..bdd6645 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -4,19 +4,16 @@ #define cmCommonTargetGenerator_h #include <cmConfigure.h> // IWYU pragma: keep - -#include "cmOutputConverter.h" - #include <map> #include <string> #include <vector> class cmGeneratorTarget; class cmGlobalCommonGenerator; +class cmLinkLineComputer; class cmLocalCommonGenerator; class cmMakefile; class cmSourceFile; -class cmLinkLineComputer; /** \class cmCommonTargetGenerator * \brief Common infrastructure for Makefile and Ninja per-target generators diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 28aa533..80e7e7d 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -606,6 +606,12 @@ void cmComputeLinkInformation::AddItem(std::string const& item, // of COMPATIBLE_INTERFACE_ enforcement. The generators will ignore // this for the actual link line. this->Items.push_back(Item(std::string(), false, tgt)); + + // Also add the item the interface specifies to be used in its place. + std::string const& libName = tgt->GetImportedLibName(config); + if (!libName.empty()) { + this->AddItem(libName, CM_NULLPTR); + } } else { // Decide whether to use an import library. bool implib = diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 71d6c4e..f2eb601 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -2,12 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmConditionEvaluator.h" +#include <algorithm> +#include <cmConfigure.h> +#include <cmsys/RegularExpression.hxx> +#include <sstream> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #include "cmAlgorithms.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmState.h" #include "cmSystemTools.h" +class cmCommand; +class cmTest; + static std::string const keyAND = "AND"; static std::string const keyCOMMAND = "COMMAND"; static std::string const keyDEFINED = "DEFINED"; diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h index 3c9d2cd..5815177 100644 --- a/Source/cmConditionEvaluator.h +++ b/Source/cmConditionEvaluator.h @@ -3,12 +3,18 @@ #ifndef cmConditionEvaluator_h #define cmConditionEvaluator_h -#include "cmCommand.h" +#include <cmConfigure.h> // IWYU pragma: keep + +#include <list> +#include <string> +#include <vector> + #include "cmExpandedCommandArgument.h" #include "cmListFileCache.h" +#include "cmPolicies.h" #include "cmake.h" -#include <list> +class cmMakefile; class cmConditionEvaluator { diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index b7d2196..3b46fc0 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -2,16 +2,24 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCoreTryCompile.h" +#include <cmConfigure.h> +#include <cmsys/Directory.hxx> +#include <set> +#include <sstream> +#include <stdio.h> +#include <string.h> + #include "cmAlgorithms.h" #include "cmExportTryCompileFileGenerator.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" +#include "cmPolicies.h" #include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmVersion.h" #include "cmake.h" -#include <cmsys/Directory.hxx> - -#include <assert.h> static std::string const kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN = "CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN"; diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index 0d9bb79..1c94f09 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -3,6 +3,11 @@ #ifndef cmCoreTryCompile_h #define cmCoreTryCompile_h +#include <cmConfigure.h> // IWYU pragma: keep + +#include <string> +#include <vector> + #include "cmCommand.h" #include "cmStateTypes.h" diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index 14a6c88..69532e6 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -2,10 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCreateTestSourceList.h" +#include <algorithm> + #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +class cmExecutionStatus; + // cmCreateTestSourceList bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h index 2f71a00..5e003cf 100644 --- a/Source/cmCreateTestSourceList.h +++ b/Source/cmCreateTestSourceList.h @@ -3,8 +3,15 @@ #ifndef cmCreateTestSourceList_h #define cmCreateTestSourceList_h +#include <cmConfigure.h> + +#include <string> +#include <vector> + #include "cmCommand.h" +class cmExecutionStatus; + /** \class cmCreateTestSourceList * \brief Test driver generation command * diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 0b459f9..47fe76a 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -3,6 +3,7 @@ #include "cmDefinitions.h" #include <assert.h> +#include <cmConfigure.h> #include <set> #include <utility> diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 8dfb9ea..ad40665 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -3,14 +3,14 @@ #ifndef cmDefinitions_h #define cmDefinitions_h -#include <cmConfigure.h> - -#include "cmLinkedTree.h" -#include "cm_unordered_map.hxx" +#include <cmConfigure.h> // IWYU pragma: keep #include <string> #include <vector> +#include "cmLinkedTree.h" +#include "cm_unordered_map.hxx" + /** \class cmDefinitions * \brief Store a scope of variable definitions for CMake language. * diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 84ab072..e6000db 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -2,16 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsC.h" +#include <cmsys/FStream.hxx> +#include <utility> + #include "cmAlgorithms.h" #include "cmFileTimeComparison.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmSystemTools.h" -#include <cmsys/FStream.hxx> -#include <utility> - #define INCLUDE_REGEX_LINE \ "^[ \t]*#[ \t]*(include|import)[ \t]*[<\"]([^\">]+)([\">])" diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index c8723d0..7927402 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -2,14 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmDependsFortran.h" -#include "cmFortranParser.h" /* Interface to parser object. */ -#include "cmGeneratedFileStream.h" -#include "cmLocalGenerator.h" -#include "cmMakefile.h" -#include "cmOutputConverter.h" -#include "cmStateDirectory.h" -#include "cmSystemTools.h" - #include <assert.h> #include <cmsys/FStream.hxx> #include <iostream> @@ -18,6 +10,15 @@ #include <string.h> #include <utility> +#include "cmFortranParser.h" /* Interface to parser object. */ +#include "cmGeneratedFileStream.h" +#include "cmLocalGenerator.h" +#include "cmMakefile.h" +#include "cmOutputConverter.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" +#include "cmSystemTools.h" + // TODO: Test compiler for the case of the mod file. Some always // use lower case and some always use upper case. I do not know if any // use the case from the source code. diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index 1597ea7..71b939c 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -8,6 +8,8 @@ #include <string> #include <vector> +class cmDependsJavaParserHelper; + #define YYSTYPE cmDependsJavaParserHelper::ParserType #define YYSTYPE_IS_DECLARED #define YY_EXTRA_TYPE cmDependsJavaParserHelper* diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index 7d4e97c..fd3c416 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -3,10 +3,6 @@ #ifndef cmExecutionStatus_h #define cmExecutionStatus_h -#include <cmConfigure.h> - -#include "cmStandardIncludes.h" - /** \class cmExecutionStatus * \brief Superclass for all command status classes * diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h index 39cffce..9770fe6 100644 --- a/Source/cmExpandedCommandArgument.h +++ b/Source/cmExpandedCommandArgument.h @@ -3,9 +3,9 @@ #ifndef cmExpandedCommandArgument_h #define cmExpandedCommandArgument_h -#include <cmConfigure.h> +#include <cmConfigure.h> // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include <string> /** \class cmExpandedCommandArgument * \brief Represents an expanded command argument diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index 38f95d2..dab0c2c 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -2,14 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportBuildAndroidMKGenerator.h" -#include "cmExportSet.h" +#include <algorithm> +#include <map> +#include <sstream> +#include <utility> + +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" +#include "cmLinkItem.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmTargetExport.h" - -#include <algorithm> +#include "cmPolicies.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator() { diff --git a/Source/cmExportBuildAndroidMKGenerator.h b/Source/cmExportBuildAndroidMKGenerator.h index c9e0145..2a5a42e 100644 --- a/Source/cmExportBuildAndroidMKGenerator.h +++ b/Source/cmExportBuildAndroidMKGenerator.h @@ -3,10 +3,16 @@ #ifndef cmExportBuildAndroidMKGenerator_h #define cmExportBuildAndroidMKGenerator_h +#include <cmConfigure.h> + +#include <iosfwd> +#include <string> +#include <vector> + #include "cmExportBuildFileGenerator.h" -#include "cmListFileCache.h" +#include "cmExportFileGenerator.h" -class cmExportSet; +class cmGeneratorTarget; /** \class cmExportBuildAndroidMKGenerator * \brief Generate a file exporting targets from a build tree. diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index 2069785..9772f49 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -2,16 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExportInstallAndroidMKGenerator.h" -#include "cmAlgorithms.h" +#include <ostream> +#include <stddef.h> + #include "cmExportBuildAndroidMKGenerator.h" #include "cmExportSet.h" -#include "cmExportSetMap.h" -#include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" #include "cmInstallExportGenerator.h" #include "cmInstallTargetGenerator.h" -#include "cmLocalGenerator.h" +#include "cmStateTypes.h" +#include "cmSystemTools.h" +#include "cmTarget.h" #include "cmTargetExport.h" cmExportInstallAndroidMKGenerator::cmExportInstallAndroidMKGenerator( diff --git a/Source/cmExportInstallAndroidMKGenerator.h b/Source/cmExportInstallAndroidMKGenerator.h index c713027..f2f8927 100644 --- a/Source/cmExportInstallAndroidMKGenerator.h +++ b/Source/cmExportInstallAndroidMKGenerator.h @@ -3,10 +3,18 @@ #ifndef cmExportInstallAndroidMKGenerator_h #define cmExportInstallAndroidMKGenerator_h +#include <cmConfigure.h> + +#include <iosfwd> +#include <set> +#include <string> +#include <vector> + +#include "cmExportFileGenerator.h" #include "cmExportInstallFileGenerator.h" +class cmGeneratorTarget; class cmInstallExportGenerator; -class cmInstallTargetGenerator; /** \class cmExportInstallAndroidMKGenerator * \brief Generate a file exporting targets from an install tree. diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 41fc428..b0a4c47 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraCodeBlocksGenerator.h" +#include <map> +#include <ostream> +#include <string.h> +#include <utility> + #include "cmAlgorithms.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" @@ -14,12 +19,6 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include <algorithm> -#include <map> -#include <ostream> -#include <string.h> -#include <utility> - /* Some useful URLs: Homepage: http://www.codeblocks.org diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index c4e86a9..ff2703e 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -2,13 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraEclipseCDT4Generator.h" +#include <algorithm> +#include <assert.h> +#include <cmsys/RegularExpression.hxx> +#include <map> +#include <sstream> +#include <stdio.h> +#include <utility> + #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" -#include "cmOutputConverter.h" #include "cmSourceFile.h" #include "cmSourceGroup.h" #include "cmState.h" @@ -17,14 +24,6 @@ #include "cmXMLWriter.h" #include "cmake.h" -#include <algorithm> -#include <assert.h> -#include <cmsys/RegularExpression.hxx> -#include <map> -#include <sstream> -#include <stdio.h> -#include <utility> - static void AppendAttribute(cmXMLWriter& xml, const char* keyval) { xml.StartElement("attribute"); diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 9ef684d..5712ab2 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -2,7 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmExtraSublimeTextGenerator.h" +#include <cmsys/RegularExpression.hxx> +#include <set> +#include <sstream> +#include <string.h> +#include <utility> + #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" @@ -10,12 +17,7 @@ #include "cmSourceFile.h" #include "cmStateTypes.h" #include "cmSystemTools.h" - -#include <cmsys/RegularExpression.hxx> -#include <ostream> -#include <set> -#include <string.h> -#include <utility> +#include "cmake.h" /* Sublime Text 2 Generator diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 1bade57..afff0f3 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -20,6 +20,7 @@ #undef GetCurrentDirectory #include <assert.h> +#include <stdlib.h> #include <sys/types.h> // include sys/stat.h after sys/types.h diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index 55d8c2a..991ebb8 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileTimeComparison.h" -#include <cmConfigure.h> #include <string> #include <time.h> #include <utility> diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 3d67ac1..dce5021 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -2,8 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindBase.h" +#include <cmConfigure.h> +#include <iostream> +#include <map> +#include <stddef.h> + #include "cmAlgorithms.h" #include "cmMakefile.h" +#include "cmSearchPath.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h index 2b8d4a2..423d453 100644 --- a/Source/cmFindBase.h +++ b/Source/cmFindBase.h @@ -3,6 +3,11 @@ #ifndef cmFindBase_h #define cmFindBase_h +#include <cmConfigure.h> // IWYU pragma: keep + +#include <string> +#include <vector> + #include "cmFindCommon.h" /** \class cmFindBase diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 75d1453..110195c 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -2,12 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFindCommon.h" +#include <algorithm> +#include <string.h> +#include <utility> + #include "cmMakefile.h" #include "cmSystemTools.h" -#include <algorithm> -#include <functional> - cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL"); cmFindCommon::PathLabel cmFindCommon::PathLabel::CMake("CMAKE"); cmFindCommon::PathLabel cmFindCommon::PathLabel::CMakeEnvironment( diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 1809c0a..4d6d569 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -3,10 +3,19 @@ #ifndef cmFindCommon_h #define cmFindCommon_h +#include <cmConfigure.h> + +#include <map> +#include <set> +#include <string> +#include <vector> + #include "cmCommand.h" #include "cmPathLabel.h" #include "cmSearchPath.h" +class cmMakefile; + /** \class cmFindCommon * \brief Base class for FIND_XXX implementations. * diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h index 388115d..b3450b3 100644 --- a/Source/cmFunctionBlocker.h +++ b/Source/cmFunctionBlocker.h @@ -3,12 +3,9 @@ #ifndef cmFunctionBlocker_h #define cmFunctionBlocker_h -#include <cmConfigure.h> - -#include "cmStandardIncludes.h" - -#include "cmExecutionStatus.h" #include "cmListFileCache.h" + +class cmExecutionStatus; class cmMakefile; class cmFunctionBlocker diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 0ba575a..31adcb7 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFunctionCommand.h" -#include <algorithm> #include <sstream> #include "cmAlgorithms.h" diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 6cdb7f5..4731493 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratedFileStream.h" -#include "cmSystemTools.h" - #include <stdio.h> +#include "cmSystemTools.h" + #if defined(CMAKE_BUILD_WITH_CMAKE) +#include "cm_codecvt.hxx" #include <cm_zlib.h> #endif diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 34f763c..1f2d2b4 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -2,6 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorExpression.h" +#include <cmsys/RegularExpression.hxx> +#include <utility> + #include "assert.h" #include "cmAlgorithms.h" #include "cmGeneratorExpressionContext.h" @@ -9,9 +12,7 @@ #include "cmGeneratorExpressionLexer.h" #include "cmGeneratorExpressionParser.h" #include "cmSystemTools.h" - -#include <cmsys/RegularExpression.hxx> -#include <utility> +#include "cm_auto_ptr.hxx" cmGeneratorExpression::cmGeneratorExpression( const cmListFileBacktrace& backtrace) diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index c6c4c3a..aeb005f 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorExpressionEvaluationFile.h" +#include <cmConfigure.h> +#include <cmsys/FStream.hxx> +#include <sstream> +#include <utility> + #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmListFileCache.h" @@ -9,13 +14,9 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include <cmConfigure.h> -#include <cmsys/FStream.hxx> -#include <sstream> -#include <utility> - cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile( const std::string& input, CM_AUTO_PTR<cmCompiledGeneratorExpression> outputFileExpr, diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h index d597270..26135df 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.h +++ b/Source/cmGeneratorExpressionEvaluationFile.h @@ -5,14 +5,19 @@ #include <cmConfigure.h> // IWYU pragma: keep -#include "cmGeneratorExpression.h" - -#include <cm_auto_ptr.hxx> #include <map> #include <string> -#include <sys/types.h> #include <vector> +#include "cmGeneratorExpression.h" +#include "cm_auto_ptr.hxx" + +#if defined(_MSC_VER) +typedef unsigned short mode_t; +#else +#include <sys/types.h> +#endif + class cmLocalGenerator; class cmGeneratorExpressionEvaluationFile diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index ca056c0..903bcec 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2,6 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGeneratorTarget.h" +#include <algorithm> +#include <assert.h> +#include <cmsys/RegularExpression.hxx> +#include <errno.h> +#include <iterator> +#include <queue> +#include <sstream> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" @@ -24,16 +35,7 @@ #include "cm_unordered_set.hxx" #include "cmake.h" -#include <algorithm> -#include <assert.h> -#include <cmsys/RegularExpression.hxx> -#include <errno.h> -#include <iterator> -#include <queue> -#include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> +class cmMessenger; template <> const char* cmTargetPropertyComputer::GetSources<cmGeneratorTarget>( @@ -2796,6 +2798,16 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const } } +std::string cmGeneratorTarget::GetImportedLibName( + std::string const& config) const +{ + if (cmGeneratorTarget::ImportInfo const* info = + this->GetImportInfo(config)) { + return info->LibName; + } + return std::string(); +} + std::string cmGeneratorTarget::GetFullPath(const std::string& config, bool implib, bool realname) const { @@ -3945,9 +3957,9 @@ std::string cmGeneratorTarget::GetFortranModuleDirectory( std::string const& working_dir) const { if (!this->FortranModuleDirectoryCreated) { - this->FortranModuleDirectory = true; this->FortranModuleDirectory = this->CreateFortranModuleDirectory(working_dir); + this->FortranModuleDirectoryCreated = true; } return this->FortranModuleDirectory; @@ -4711,6 +4723,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, } } if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { + if (loc) { + info.LibName = loc; + } return; } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 3805bfc..4c3c14b 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -147,6 +147,9 @@ public: const cmGeneratorTarget* head, bool usage_requirements_only) const; + /** Get the library name for an imported interface library. */ + std::string GetImportedLibName(std::string const& config) const; + /** Get the full path to the target according to the settings in its makefile and the configuration type. */ std::string GetFullPath(const std::string& config = "", bool implib = false, @@ -643,6 +646,7 @@ private: std::string Location; std::string SOName; std::string ImportLibrary; + std::string LibName; std::string Languages; std::string Libraries; std::string LibrariesProp; diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index c92ae21..7962da6 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetCMakePropertyCommand.h" -#include <algorithm> #include <set> #include "cmAlgorithms.h" diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index a0a33ea..d2372a7 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalBorlandMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index cf51c6a..2d0767f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -9,6 +9,16 @@ #include "cmGlobalGenerator.h" +#include <algorithm> +#include <assert.h> +#include <cmsys/Directory.hxx> +#include <cmsys/FStream.hxx> +#include <iterator> +#include <sstream> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #include "cmAlgorithms.h" #include "cmCPackPropertiesGenerator.h" #include "cmComputeTargetDepends.h" @@ -29,20 +39,11 @@ #include "cmQtAutoGeneratorInitializer.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmVersion.h" #include "cmake.h" -#include <algorithm> -#include <assert.h> -#include <cmsys/Directory.hxx> -#include <cmsys/FStream.hxx> -#include <iterator> -#include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - #if defined(CMAKE_BUILD_WITH_CMAKE) #include <cm_jsoncpp_value.h> #include <cm_jsoncpp_writer.h> diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 4bf4bd1..88ef8da 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -5,8 +5,15 @@ #include <cmConfigure.h> +#include <iosfwd> +#include <map> +#include <set> +#include <string> +#include <utility> +#include <vector> + +#include "cmCustomCommandLines.h" #include "cmExportSetMap.h" -#include "cmStateDirectory.h" #include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -14,26 +21,19 @@ #include "cm_codecvt.hxx" #include "cm_unordered_map.hxx" -#include <iosfwd> -#include <map> -#include <set> -#include <string> -#include <utility> -#include <vector> - #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmFileLockPool.h" #endif -class cmCustomCommandLines; -class cmSourceFile; class cmExportBuildFileGenerator; class cmExternalMakefileProjectGenerator; class cmGeneratorTarget; -class cmLocalGenerator; class cmLinkLineComputer; +class cmLocalGenerator; class cmMakefile; class cmOutputConverter; +class cmSourceFile; +class cmStateDirectory; class cmake; /** \class cmGlobalGenerator diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 528e118..5e948f7 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -5,12 +5,11 @@ #include <cmConfigure.h> -#include <cmConfigure.h> - -#include "cmStandardIncludes.h" +#include <string> +#include <vector> -class cmake; class cmGlobalGenerator; +class cmake; struct cmDocumentationEntry; /** \class cmGlobalGeneratorFactory diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index 78bf5bd..18c45e0 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/Source/cmGlobalJOMMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalJOMMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index f17b915..7e0d0d4 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -2,11 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalMSYSMakefileGenerator.h" +#include <cmsys/FStream.hxx> + +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" #include "cmake.h" -#include <cmsys/FStream.hxx> cmGlobalMSYSMakefileGenerator::cmGlobalMSYSMakefileGenerator(cmake* cm) : cmGlobalUnixMakefileGenerator3(cm) diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx index 255c0f5..3c3a5d1d 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.cxx +++ b/Source/cmGlobalMinGWMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalMinGWMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 06aba73..da683fb 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalNMakeMakefileGenerator.h" +#include "cmDocumentationEntry.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 830ab7f..1bdef53 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2,6 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalNinjaGenerator.h" +#include <algorithm> +#include <cm_jsoncpp_reader.h> +#include <cm_jsoncpp_value.h> +#include <cm_jsoncpp_writer.h> +#include <cmsys/FStream.hxx> +#include <ctype.h> +#include <functional> +#include <iterator> +#include <sstream> +#include <stdio.h> + #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmFortranParser.h" @@ -13,6 +24,9 @@ #include "cmMakefile.h" #include "cmNinjaLinkLineComputer.h" #include "cmOutputConverter.h" +#include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" @@ -21,15 +35,7 @@ #include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cm_jsoncpp_reader.h" -#include "cm_jsoncpp_writer.h" - -#include <algorithm> -#include <ctype.h> -#include <functional> -#include <iterator> -#include <sstream> -#include <stdio.h> +class cmLinkLineComputer; const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja"; const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja"; @@ -130,7 +136,7 @@ std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit) std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) { - std::string result = path; + std::string result = path; // NOLINT(clang-tidy) #ifdef _WIN32 if (this->IsGCCOnWindows()) std::replace(result.begin(), result.end(), '\\', '/'); @@ -283,7 +289,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild( bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps, const cmNinjaDeps& orderOnly) { - std::string cmd = command; + std::string cmd = command; // NOLINT(clang-tidy) #ifdef _WIN32 if (cmd.empty()) // TODO Shouldn't an empty command be handled by ninja? diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 064ff0b..a51e919 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -5,12 +5,6 @@ #include <cmConfigure.h> -#include "cmGlobalCommonGenerator.h" -#include "cmGlobalGenerator.h" -#include "cmGlobalGeneratorFactory.h" -#include "cmNinjaTypes.h" -#include "cmPolicies.h" - #include <iosfwd> #include <map> #include <set> @@ -18,13 +12,23 @@ #include <utility> #include <vector> +#include "cmGlobalCommonGenerator.h" +#include "cmGlobalGenerator.h" +#include "cmGlobalGeneratorFactory.h" +#include "cmNinjaTypes.h" +#include "cmPolicies.h" +#include "cm_codecvt.hxx" + class cmCustomCommand; -class cmMakefile; -class cmake; -struct cmDocumentationEntry; class cmGeneratedFileStream; class cmGeneratorTarget; +class cmLinkLineComputer; class cmLocalGenerator; +class cmMakefile; +class cmOutputConverter; +class cmStateDirectory; +class cmake; +struct cmDocumentationEntry; /** * \class cmGlobalNinjaGenerator diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 90caaf9..23b3718 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGlobalUnixMakefileGenerator3.h" +#include <algorithm> +#include <functional> +#include <sstream> +#include <utility> + #include "cmAlgorithms.h" #include "cmDocumentationEntry.h" #include "cmGeneratedFileStream.h" @@ -14,16 +19,12 @@ #include "cmOutputConverter.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetDepend.h" #include "cmake.h" -#include <algorithm> -#include <functional> -#include <sstream> -#include <utility> - cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm) : cmGlobalCommonGenerator(cm) { diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 843e5dc..67d7bc9 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -5,11 +5,6 @@ #include <cmConfigure.h> -#include "cmGeneratorTarget.h" -#include "cmGlobalCommonGenerator.h" -#include "cmGlobalGeneratorFactory.h" -#include "cmStateTypes.h" - #include <iosfwd> #include <map> #include <set> @@ -17,6 +12,11 @@ #include <string> #include <vector> +#include "cmGeneratorTarget.h" +#include "cmGlobalCommonGenerator.h" +#include "cmGlobalGeneratorFactory.h" +#include "cmStateSnapshot.h" + class cmGeneratedFileStream; class cmLocalGenerator; class cmLocalUnixMakefileGenerator3; diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index 0900797..94cdb38 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -5,7 +5,6 @@ #include "cmDocumentationEntry.h" #include "cmMakefile.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmake.h" cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator(cmake* cm) diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index a154373..e6aec47 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -3,9 +3,9 @@ #ifndef cmGraphAdjacencyList_h #define cmGraphAdjacencyList_h -#include <cmConfigure.h> +#include <cmConfigure.h> // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include <vector> /** * Graph edge representation. Most use cases just need the diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 6b32f73..0f69aaa 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -2,21 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGraphVizWriter.h" +#include <cmConfigure.h> +#include <iostream> +#include <sstream> +#include <utility> + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cm_auto_ptr.hxx" #include "cmake.h" -#include <cmConfigure.h> -#include <iostream> -#include <sstream> -#include <utility> - static const char* getShapeForTarget(const cmGeneratorTarget* target) { if (!target) { diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx index db855d2..d9d6598 100644 --- a/Source/cmHexFileConverter.cxx +++ b/Source/cmHexFileConverter.cxx @@ -2,11 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmHexFileConverter.h" -#include "cmSystemTools.h" - +#include <cmConfigure.h> #include <stdio.h> #include <string.h> +#include "cmSystemTools.h" + #define INTEL_HEX_MIN_LINE_LENGTH (1 + 8 + 2) #define INTEL_HEX_MAX_LINE_LENGTH (1 + 8 + (256 * 2) + 2) #define MOTOROLA_SREC_MIN_LINE_LENGTH (2 + 2 + 4 + 2) diff --git a/Source/cmHexFileConverter.h b/Source/cmHexFileConverter.h index cb550bb..1050bc1 100644 --- a/Source/cmHexFileConverter.h +++ b/Source/cmHexFileConverter.h @@ -3,10 +3,6 @@ #ifndef cmHexFileConverter_h #define cmHexFileConverter_h -#include <cmConfigure.h> - -#include "cmStandardIncludes.h" - /** \class cmHexFileConverter * \brief Can detects Intel Hex and Motorola S-record files and convert them * to binary files. diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index bf59e88..fadebb4 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommand.h" -#include <algorithm> #include <cmsys/Glob.hxx> #include <sstream> #include <stddef.h> diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index de6919b..6b15468 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallCommandArguments.h" +#include <cmConfigure.h> + #include "cmSystemTools.h" // Table of valid permissions. diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h index 82c2310..c1523b2 100644 --- a/Source/cmInstallCommandArguments.h +++ b/Source/cmInstallCommandArguments.h @@ -3,9 +3,10 @@ #ifndef cmInstallCommandArguments_h #define cmInstallCommandArguments_h -#include <cmConfigure.h> +#include <cmConfigure.h> // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include <string> +#include <vector> #include "cmCommandArgumentsHelper.h" diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index f1df073..4dfa40f 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -2,6 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallTargetGenerator.h" +#include <assert.h> +#include <map> +#include <set> +#include <sstream> +#include <utility> + #include "cmComputeLinkInformation.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -12,15 +18,8 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" -#include "cm_auto_ptr.hxx" #include "cmake.h" -#include <assert.h> -#include <map> -#include <set> -#include <sstream> -#include <utility> - cmInstallTargetGenerator::cmInstallTargetGenerator( const std::string& targetName, const char* dest, bool implib, const char* file_permissions, std::vector<std::string> const& configurations, diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 74d6774..6fd6f50 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -3,8 +3,16 @@ #ifndef cmLinkItem_h #define cmLinkItem_h +#include <cmConfigure.h> + +#include <algorithm> +#include <map> +#include <string> +#include <vector> + #include "cmListFileCache.h" #include "cmSystemTools.h" +#include "cmTargetLinkLibraryType.h" class cmGeneratorTarget; diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index c271246..cf0cf88 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -2,10 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLinkLineComputer.h" + +#include <sstream> +#include <vector> + #include "cmComputeLinkInformation.h" #include "cmGeneratorTarget.h" #include "cmOutputConverter.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter, cmStateDirectory stateDir) diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h index 6bbb69e..97a5d1b 100644 --- a/Source/cmLinkLineComputer.h +++ b/Source/cmLinkLineComputer.h @@ -4,6 +4,10 @@ #ifndef cmLinkLineComputer_h #define cmLinkLineComputer_h +#include <cmConfigure.h> // IWYU pragma: keep + +#include <string> + #include "cmStateDirectory.h" class cmComputeLinkInformation; diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index d2c6f33..4f95522 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -5,9 +5,9 @@ #include <cmConfigure.h> -#include "cmStandardIncludes.h" - #include <assert.h> +#include <iterator> +#include <vector> /** @brief A adaptor for traversing a tree structure in a vector diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 6b49f1e..d5f9d27 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -2,10 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalCommonGenerator.h" +#include <vector> + #include "cmGeneratorTarget.h" #include "cmMakefile.h" - -#include <vector> +#include "cmOutputConverter.h" class cmGlobalGenerator; diff --git a/Source/cmLocalCommonGenerator.h b/Source/cmLocalCommonGenerator.h index eb5f850..f83f371 100644 --- a/Source/cmLocalCommonGenerator.h +++ b/Source/cmLocalCommonGenerator.h @@ -5,11 +5,10 @@ #include <cmConfigure.h> -#include "cmLocalGenerator.h" -#include "cmOutputConverter.h" - #include <string> +#include "cmLocalGenerator.h" + class cmGeneratorTarget; class cmGlobalGenerator; class cmMakefile; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4aecb1d..7d3a2f0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -18,6 +18,7 @@ #include "cmSourceFile.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTestGenerator.h" @@ -32,10 +33,10 @@ #include <algorithm> #include <assert.h> #include <cmsys/RegularExpression.hxx> -#include <ctype.h> #include <iterator> #include <sstream> #include <stdio.h> +#include <string.h> #include <utility> #if defined(__HAIKU__) diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 6314aff..fdca78a 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -5,29 +5,28 @@ #include <cmConfigure.h> -#include "cmListFileCache.h" -#include "cmOutputConverter.h" -#include "cmPolicies.h" -#include "cmRulePlaceholderExpander.h" -#include "cmStateTypes.h" -#include "cmake.h" - #include <cm_kwiml.h> #include <iosfwd> #include <map> #include <set> -#include <string.h> #include <string> #include <vector> +#include "cmListFileCache.h" +#include "cmOutputConverter.h" +#include "cmPolicies.h" +#include "cmStateSnapshot.h" +#include "cmake.h" + class cmComputeLinkInformation; class cmCustomCommandGenerator; class cmGeneratorTarget; class cmGlobalGenerator; -class cmRulePlaceholderExpander; +class cmLinkLineComputer; class cmMakefile; +class cmRulePlaceholderExpander; class cmSourceFile; -class cmLinkLineComputer; +class cmState; /** \class cmLocalGenerator * \brief Create required build files for a directory. diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index c27ab09..c2d9d57 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -2,6 +2,13 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalNinjaGenerator.h" +#include <algorithm> +#include <assert.h> +#include <iterator> +#include <sstream> +#include <stdio.h> +#include <utility> + #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" @@ -15,15 +22,9 @@ #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include <algorithm> -#include <assert.h> -#include <iterator> -#include <sstream> -#include <stdio.h> -#include <utility> - cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmMakefile* mf) : cmLocalCommonGenerator(gg, mf, mf->GetState()->GetBinaryDirectory()) diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 95d8eb8..1080319 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -5,17 +5,16 @@ #include <cmConfigure.h> -#include "cmLocalCommonGenerator.h" -#include "cmLocalGenerator.h" -#include "cmNinjaTypes.h" -#include "cmOutputConverter.h" - #include <iosfwd> #include <map> #include <set> #include <string> #include <vector> +#include "cmLocalCommonGenerator.h" +#include "cmNinjaTypes.h" +#include "cmOutputConverter.h" + class cmCustomCommand; class cmCustomCommandGenerator; class cmGeneratedFileStream; @@ -23,6 +22,7 @@ class cmGeneratorTarget; class cmGlobalGenerator; class cmGlobalNinjaGenerator; class cmMakefile; +class cmRulePlaceholderExpander; class cmSourceFile; class cmake; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4f81ef1..8bb084a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2,6 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLocalUnixMakefileGenerator3.h" +#include <algorithm> +#include <cmsys/FStream.hxx> +#include <cmsys/Terminal.h> +#include <functional> +#include <sstream> +#include <stdio.h> +#include <utility> + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" @@ -18,9 +26,11 @@ #include "cmSourceFile.h" #include "cmState.h" #include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmVersion.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" // Include dependency scanners for supported languages. Only the @@ -31,15 +41,6 @@ #include "cmDependsJava.h" #endif -#include <algorithm> -#include <cm_auto_ptr.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/Terminal.h> -#include <functional> -#include <sstream> -#include <stdio.h> -#include <utility> - // Escape special characters in Makefile dependency lines class cmMakeSafe { diff --git a/Source/cmLocale.h b/Source/cmLocale.h index f35e528..e8e751d 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -5,8 +5,6 @@ #include <cmConfigure.h> -#include "cmStandardIncludes.h" - #include <locale.h> class cmLocaleRAII diff --git a/Source/cmMSVC60LinkLineComputer.cxx b/Source/cmMSVC60LinkLineComputer.cxx index 9308d91..d761e7b 100644 --- a/Source/cmMSVC60LinkLineComputer.cxx +++ b/Source/cmMSVC60LinkLineComputer.cxx @@ -3,7 +3,13 @@ #include "cmMSVC60LinkLineComputer.h" +#include "cmStateDirectory.h" + +#if defined(_WIN32) && !defined(__CYGWIN__) #include "cmSystemTools.h" +#endif + +class cmOutputConverter; cmMSVC60LinkLineComputer::cmMSVC60LinkLineComputer( cmOutputConverter* outputConverter, cmStateDirectory stateDir) diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h index 381b8a2..9a28dca 100644 --- a/Source/cmMSVC60LinkLineComputer.h +++ b/Source/cmMSVC60LinkLineComputer.h @@ -4,8 +4,15 @@ #ifndef cmMSVC60LinkLineComputer_h #define cmMSVC60LinkLineComputer_h +#include <cmConfigure.h> + +#include <string> + #include "cmLinkLineComputer.h" +class cmOutputConverter; +class cmStateDirectory; + class cmMSVC60LinkLineComputer : public cmLinkLineComputer { public: diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index d777bd5..583f801 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMacroCommand.h" -#include <algorithm> #include <sstream> #include <stdio.h> diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 741ffb8..90182f9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2,6 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefile.h" +#include <algorithm> +#include <assert.h> +#include <cmsys/FStream.hxx> +#include <cmsys/RegularExpression.hxx> +#include <ctype.h> +#include <sstream> +#include <stdlib.h> +#include <string.h> +#include <utility> + #include "cmAlgorithms.h" #include "cmCommand.h" #include "cmCommandArgumentParserHelper.h" @@ -14,6 +24,7 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorExpressionEvaluationFile.h" #include "cmGlobalGenerator.h" +#include "cmInstallGenerator.h" // IWYU pragma: keep #include "cmListFileCache.h" #include "cmSourceFile.h" #include "cmSourceFileLocation.h" @@ -21,28 +32,17 @@ #include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cmTargetLinkLibraryType.h" #include "cmTest.h" +#include "cmTestGenerator.h" // IWYU pragma: keep #include "cmVersion.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cmInstallGenerator.h" // IWYU pragma: keep -#include "cmTestGenerator.h" // IWYU pragma: keep - #ifdef CMAKE_BUILD_WITH_CMAKE #include "cmVariableWatch.h" #endif -#include <algorithm> -#include <assert.h> -#include <cm_auto_ptr.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> -#include <ctype.h> -#include <sstream> -#include <stdlib.h> -#include <string.h> -#include <utility> - class cmMessenger; // default is not to be building executables diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 3067f2c..859b3c8 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -5,13 +5,21 @@ #include <cmConfigure.h> +#include <cmsys/RegularExpression.hxx> +#include <map> +#include <set> +#include <stack> +#include <string> +#include <vector> + #include "cmAlgorithms.h" #include "cmListFileCache.h" #include "cmNewLineStyle.h" #include "cmPolicies.h" #include "cmStateSnapshot.h" +#include "cmStateTypes.h" #include "cmTarget.h" -#include "cmTargetLinkLibraryType.h" +#include "cm_auto_ptr.hxx" #include "cm_unordered_map.hxx" #include "cmake.h" @@ -19,15 +27,6 @@ #include "cmSourceGroup.h" #endif -#include <cm_auto_ptr.hxx> -#include <cmsys/RegularExpression.hxx> - -#include <map> -#include <set> -#include <stack> -#include <string> -#include <vector> - class cmCommand; class cmCompiledGeneratorExpression; class cmCustomCommandLines; @@ -40,6 +39,7 @@ class cmGlobalGenerator; class cmInstallGenerator; class cmMessenger; class cmSourceFile; +class cmState; class cmTest; class cmTestGenerator; class cmVariableWatch; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index cbbd2e6..358804e 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileExecutableTargetGenerator.h" +#include <sstream> +#include <string> +#include <vector> + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" @@ -13,13 +17,12 @@ #include "cmOutputConverter.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include <sstream> -#include <string> -#include <vector> - cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator( cmGeneratorTarget* target) : cmMakefileTargetGenerator(target) diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index a249efd..c591bb3 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -2,6 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileLibraryTargetGenerator.h" +#include <cmConfigure.h> // IWYU pragma: keep + +#include <sstream> +#include <vector> + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" @@ -13,13 +18,13 @@ #include "cmOutputConverter.h" #include "cmRulePlaceholderExpander.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include <sstream> -#include <vector> - cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator( cmGeneratorTarget* target) : cmMakefileTargetGenerator(target) diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 68aabef..5bec2bb 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileTargetGenerator.h" +#include <sstream> +#include <stdio.h> +#include <utility> + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommand.h" @@ -10,8 +14,6 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" -#include "cmLinkLineComputer.h" -#include "cmLocalGenerator.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmMakefileExecutableTargetGenerator.h" @@ -21,17 +23,13 @@ #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cm_auto_ptr.hxx" #include "cmake.h" -#include <algorithm> -#include <ctype.h> -#include <sstream> -#include <stdio.h> -#include <utility> - #ifndef _WIN32 #include <unistd.h> #endif diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index e44f64a..347f9f2 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -5,22 +5,24 @@ #include <cmConfigure.h> -#include "cmCommonTargetGenerator.h" -#include "cmLocalUnixMakefileGenerator3.h" -#include "cmOSXBundleGenerator.h" - #include <iosfwd> #include <map> #include <set> #include <string> #include <vector> +#include "cmCommonTargetGenerator.h" +#include "cmLocalUnixMakefileGenerator3.h" +#include "cmOSXBundleGenerator.h" + class cmCustomCommandGenerator; class cmGeneratedFileStream; class cmGeneratorTarget; class cmGlobalUnixMakefileGenerator3; -class cmSourceFile; class cmLinkLineComputer; +class cmOutputConverter; +class cmSourceFile; +class cmStateDirectory; /** \class cmMakefileTargetGenerator * \brief Support Routines for writing makefiles diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index ecb29cb..a7c5d27 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -2,17 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileUtilityTargetGenerator.h" +#include <ostream> +#include <string> +#include <vector> + #include "cmGeneratedFileStream.h" #include "cmGeneratorTarget.h" #include "cmGlobalUnixMakefileGenerator3.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmOSXBundleGenerator.h" -#include "cmOutputConverter.h" - -#include <ostream> -#include <string> -#include <vector> +#include "cmSystemTools.h" cmMakefileUtilityTargetGenerator::cmMakefileUtilityTargetGenerator( cmGeneratorTarget* target) diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 2e15720..43fb5f5 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMessageCommand.h" -#include <algorithm> - #include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmMessenger.h" diff --git a/Source/cmNinjaLinkLineComputer.cxx b/Source/cmNinjaLinkLineComputer.cxx index fa9df6d..2546b55 100644 --- a/Source/cmNinjaLinkLineComputer.cxx +++ b/Source/cmNinjaLinkLineComputer.cxx @@ -2,7 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaLinkLineComputer.h" + #include "cmGlobalNinjaGenerator.h" +#include "cmStateDirectory.h" + +class cmOutputConverter; cmNinjaLinkLineComputer::cmNinjaLinkLineComputer( cmOutputConverter* outputConverter, cmStateDirectory stateDir, diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h index daecea4..ff0771b 100644 --- a/Source/cmNinjaLinkLineComputer.h +++ b/Source/cmNinjaLinkLineComputer.h @@ -4,10 +4,15 @@ #ifndef cmNinjaLinkLineComputer_h #define cmNinjaLinkLineComputer_h +#include <cmConfigure.h> + +#include <string> + #include "cmLinkLineComputer.h" -#include "cmState.h" class cmGlobalNinjaGenerator; +class cmOutputConverter; +class cmStateDirectory; class cmNinjaLinkLineComputer : public cmLinkLineComputer { diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index d70bf8e..a23e0ad 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -2,6 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaNormalTargetGenerator.h" +#include <algorithm> +#include <assert.h> +#include <iterator> +#include <limits> +#include <map> +#include <set> +#include <sstream> +#include <stddef.h> + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmCustomCommandGenerator.h" @@ -18,19 +27,13 @@ #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include <algorithm> -#include <assert.h> -#include <iterator> -#include <limits> -#include <map> -#include <set> -#include <sstream> -#include <stddef.h> - #ifndef _WIN32 #include <unistd.h> #endif diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index cf60892..a220cd8 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -2,10 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmNinjaTargetGenerator.h" +#include <algorithm> +#include <assert.h> +#include <cm_jsoncpp_value.h> +#include <cm_jsoncpp_writer.h> +#include <iterator> +#include <map> +#include <sstream> +#include <string.h> + #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratedFileStream.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalNinjaGenerator.h" #include "cmLocalGenerator.h" @@ -19,16 +29,9 @@ #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cm_jsoncpp_writer.h" - -#include <algorithm> -#include <iterator> -#include <map> -#include <sstream> -#include <string.h> - cmNinjaTargetGenerator* cmNinjaTargetGenerator::New(cmGeneratorTarget* target) { switch (target->GetType()) { diff --git a/Source/cmNinjaTypes.h b/Source/cmNinjaTypes.h index b4eaa59..3fd536a 100644 --- a/Source/cmNinjaTypes.h +++ b/Source/cmNinjaTypes.h @@ -3,9 +3,11 @@ #ifndef cmNinjaTypes_h #define cmNinjaTypes_h -#include <cmConfigure.h> +#include <cmConfigure.h> // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include <map> +#include <string> +#include <vector> typedef std::vector<std::string> cmNinjaDeps; typedef std::map<std::string, std::string> cmNinjaVars; diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index bbd6090..00a2d2b 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOptionCommand.h" -#include <algorithm> - #include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmState.h" diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 445ad0b..d6864a6 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -2,16 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmOutputConverter.h" -#include "cmAlgorithms.h" -#include "cmState.h" -#include "cmStateDirectory.h" -#include "cmSystemTools.h" - #include <algorithm> #include <assert.h> #include <ctype.h> #include <set> #include <sstream> +#include <vector> + +#include "cmAlgorithms.h" +#include "cmState.h" +#include "cmStateDirectory.h" +#include "cmSystemTools.h" cmOutputConverter::cmOutputConverter(cmStateSnapshot snapshot) : StateSnapshot(snapshot) diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index dabb091..a3da4cd 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -5,10 +5,12 @@ #include <cmConfigure.h> // IWYU pragma: keep +#include <string> + #include "cmStateSnapshot.h" -#include <string> -#include <vector> +class cmState; +class cmStateDirectory; class cmOutputConverter { diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx index 0a2dd12..d75ee8e 100644 --- a/Source/cmParseArgumentsCommand.cxx +++ b/Source/cmParseArgumentsCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmParseArgumentsCommand.h" -#include <algorithm> #include <map> #include <set> #include <sstream> diff --git a/Source/cmPathLabel.cxx b/Source/cmPathLabel.cxx index 19e6820..30ba081 100644 --- a/Source/cmPathLabel.cxx +++ b/Source/cmPathLabel.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmPathLabel.h" +#include <stddef.h> + cmPathLabel::cmPathLabel(const std::string& label) : Label(label) , Hash(0) diff --git a/Source/cmPathLabel.h b/Source/cmPathLabel.h index 5e9e423..cd9743c 100644 --- a/Source/cmPathLabel.h +++ b/Source/cmPathLabel.h @@ -3,9 +3,9 @@ #ifndef cmPathLabel_h #define cmPathLabel_h -#include <cmConfigure.h> +#include <cmConfigure.h> // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include <string> /** \class cmPathLabel * \brief Helper class for text based labels diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index f0373a1..8afd532 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -13,7 +13,6 @@ #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmake.h" @@ -27,7 +26,6 @@ #include <cmConfigure.h> #include <cmsys/FStream.hxx> #include <cmsys/RegularExpression.hxx> -#include <iostream> #include <map> #include <set> #include <sstream> diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index f56f575..499da3a 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -2,18 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmQtAutoGenerators.h" -#include "cmAlgorithms.h" -#include "cmFilePathUuid.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" -#include "cmOutputConverter.h" -#include "cmState.h" -#include "cmStateDirectory.h" -#include "cmStateTypes.h" -#include "cmSystemTools.h" -#include "cm_auto_ptr.hxx" -#include "cmake.h" - #include <algorithm> #include <assert.h> #include <cmConfigure.h> @@ -26,6 +14,17 @@ #include <string.h> #include <utility> +#include "cmAlgorithms.h" +#include "cmFilePathUuid.h" +#include "cmGlobalGenerator.h" +#include "cmMakefile.h" +#include "cmOutputConverter.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" +#include "cmSystemTools.h" +#include "cm_auto_ptr.hxx" +#include "cmake.h" + #if defined(__APPLE__) #include <unistd.h> #endif diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx index 75ac54d..f190a5c 100644 --- a/Source/cmRulePlaceholderExpander.cxx +++ b/Source/cmRulePlaceholderExpander.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmRulePlaceholderExpander.h" +#include <ctype.h> +#include <string.h> +#include <utility> + #include "cmOutputConverter.h" #include "cmSystemTools.h" diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h index 444419c..5223ae9 100644 --- a/Source/cmRulePlaceholderExpander.h +++ b/Source/cmRulePlaceholderExpander.h @@ -9,7 +9,6 @@ #include <map> #include <string> -class cmGeneratorTarget; class cmOutputConverter; class cmRulePlaceholderExpander diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index ff0b836..0df6e0c 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -2,7 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSearchPath.h" +#include <algorithm> #include <cassert> +#include <utility> #include "cmAlgorithms.h" #include "cmFindCommon.h" diff --git a/Source/cmSearchPath.h b/Source/cmSearchPath.h index 80815ed..9ffa871 100644 --- a/Source/cmSearchPath.h +++ b/Source/cmSearchPath.h @@ -5,7 +5,9 @@ #include <cmConfigure.h> -#include "cmStandardIncludes.h" +#include <set> +#include <string> +#include <vector> class cmFindCommon; diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index 51a363f..5a71dc0 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -14,6 +14,7 @@ #include "cm_jsoncpp_value.h" #endif +#include <algorithm> #include <fstream> #include <iostream> #include <memory> diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx index b4af52b..008052b 100644 --- a/Source/cmServerConnection.cxx +++ b/Source/cmServerConnection.cxx @@ -8,6 +8,7 @@ #include "cmServer.h" #include <assert.h> +#include <string.h> namespace { diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index e49f142..820e7f6 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSetCommand.h" -#include <algorithm> #include <string.h> #include "cmAlgorithms.h" diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6f29b18..5c4f18b 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -2,17 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceFile.h" +#include <sstream> + #include "cmCustomCommand.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmProperty.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" -#include <sstream> - cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name) : Location(mf, name) { diff --git a/Source/cmState.cxx b/Source/cmState.cxx index db1e542..6e934e2 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -2,24 +2,22 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmState.h" -#include "cmStatePrivate.h" +#include <algorithm> +#include <assert.h> +#include <cmsys/RegularExpression.hxx> +#include <string.h> +#include <utility> #include "cmAlgorithms.h" #include "cmCacheManager.h" #include "cmCommand.h" #include "cmDefinitions.h" #include "cmListFileCache.h" +#include "cmStatePrivate.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmake.h" -#include <algorithm> -#include <assert.h> -#include <cmsys/RegularExpression.hxx> -#include <iterator> -#include <stdio.h> -#include <string.h> -#include <utility> - cmState::cmState() : IsInTryCompile(false) , WindowsShell(false) diff --git a/Source/cmState.h b/Source/cmState.h index 6d74815..41ffcdc 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -5,25 +5,22 @@ #include <cmConfigure.h> // IWYU pragma: keep -#include "cmAlgorithms.h" +#include <map> +#include <set> +#include <string> +#include <vector> + #include "cmDefinitions.h" #include "cmLinkedTree.h" #include "cmProperty.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +#include "cmStatePrivate.h" #include "cmStateTypes.h" -#include <map> -#include <set> -#include <string> -#include <vector> - class cmCacheManager; class cmCommand; -class cmListFileBacktrace; class cmPropertyDefinition; - -class cmStateDirectory; class cmStateSnapshot; class cmState diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 01e1e7e..46a1858 100644 --- a/Source/cmStateDirectory.cxx +++ b/Source/cmStateDirectory.cxx @@ -2,8 +2,18 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmStateDirectory.h" + +#include <algorithm> +#include <assert.h> +#include <iterator> +#include <map> +#include <utility> + +#include "cmProperty.h" +#include "cmPropertyMap.h" #include "cmState.h" #include "cmStatePrivate.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" static std::string const kBINARY_DIR = "BINARY_DIR"; diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h index 17a89d8..8accc8e 100644 --- a/Source/cmStateDirectory.h +++ b/Source/cmStateDirectory.h @@ -10,9 +10,10 @@ #include <vector> #include "cmAlgorithms.h" +#include "cmLinkedTree.h" #include "cmListFileCache.h" +#include "cmStatePrivate.h" #include "cmStateSnapshot.h" -#include "cmStateTypes.h" class cmStateDirectory { diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index 8daa3cf..20700f2 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -12,9 +12,16 @@ #include "cmDefinitions.h" #include "cmLinkedTree.h" #include "cmListFileCache.h" +#include "cmPolicies.h" #include "cmPropertyMap.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" +namespace cmStateDetail { +struct BuildsystemDirectoryStateType; +struct PolicyStackEntry; +} // namespace cmStateDetail + static const std::string cmPropertySentinal = std::string(); struct cmStateDetail::SnapshotDataType diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index 7f86221..c6288a5 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -3,13 +3,25 @@ #include "cmStateSnapshot.h" +#include <algorithm> +#include <assert.h> +#include <iterator> +#include <stdio.h> + +#include "cmAlgorithms.h" +#include "cmDefinitions.h" +#include "cmListFileCache.h" +#include "cmPropertyMap.h" #include "cmState.h" #include "cmStateDirectory.h" #include "cmStatePrivate.h" -#include "cmSystemTools.h" #include "cmVersion.h" #include "cmake.h" +#if defined(__CYGWIN__) +#include "cmSystemTools.h" +#endif + cmStateSnapshot::cmStateSnapshot(cmState* state) : State(state) , Position() diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 63b581d..72d0349 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -6,10 +6,10 @@ #include <cmConfigure.h> // IWYU pragma: keep -#include <map> #include <string> #include <vector> +#include "cmLinkedTree.h" #include "cmPolicies.h" #include "cmStateTypes.h" diff --git a/Source/cmStateTypes.h b/Source/cmStateTypes.h index 75f9e60..2c974c1 100644 --- a/Source/cmStateTypes.h +++ b/Source/cmStateTypes.h @@ -4,12 +4,12 @@ #ifndef cmStateTypes_h #define cmStateTypes_h +#include <cmConfigure.h> // IWYU pragma: keep + #include "cmLinkedTree.h" namespace cmStateDetail { -struct BuildsystemDirectoryStateType; struct SnapshotDataType; -struct PolicyStackEntry; typedef cmLinkedTree<cmStateDetail::SnapshotDataType>::iterator PositionType; } diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 512bc91..f835445 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmStringCommand.h" -#include <algorithm> #include <cmsys/RegularExpression.hxx> #include <ctype.h> #include <sstream> diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 9817a3c..0801f26 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -11,6 +11,12 @@ #include <string> #include <vector> +#if defined(_MSC_VER) +typedef unsigned short mode_t; +#else +#include <sys/types.h> +#endif + class cmSystemToolsFileTime; /** \class cmSystemTools diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 25ae339..54bdfe6 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2,6 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTarget.h" +#include <algorithm> +#include <assert.h> +#include <cmsys/RegularExpression.hxx> +#include <map> +#include <set> +#include <sstream> +#include <string.h> + #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -14,19 +22,13 @@ #include "cmSourceFile.h" #include "cmSourceFileLocation.h" #include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTargetPropertyComputer.h" #include "cm_unordered_set.hxx" #include "cmake.h" -#include <algorithm> -#include <assert.h> -#include <cmsys/RegularExpression.hxx> -#include <map> -#include <set> -#include <sstream> -#include <string.h> - template <> const char* cmTargetPropertyComputer::ComputeLocationForBuild<cmTarget>( cmTarget const* tgt) @@ -289,6 +291,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, ci != configNames.end(); ++ci) { std::string configUpper = cmSystemTools::UpperCase(*ci); for (const char** p = configProps; *p; ++p) { + // Interface libraries have no output locations, so honor only + // the configuration map. if (this->TargetTypeValue == cmStateEnums::INTERFACE_LIBRARY && strcmp(*p, "MAP_IMPORTED_CONFIG_") != 0) { continue; @@ -910,6 +914,9 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) this->Internal->SourceEntries.push_back(value); this->Internal->SourceBacktraces.push_back(lfbt); } + } else if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME") && + !this->CheckImportedLibName(prop, value ? value : "")) { + /* error was reported by check method */ } else { this->Properties.SetProperty(prop, value); } @@ -977,6 +984,9 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); this->Internal->SourceEntries.push_back(value); this->Internal->SourceBacktraces.push_back(lfbt); + } else if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME")) { + this->Makefile->IssueMessage(cmake::FATAL_ERROR, + prop + " property may not be APPENDed."); } else { this->Properties.AppendProperty(prop, value, asString); } @@ -1372,18 +1382,41 @@ void cmTarget::SetPropertyDefault(const std::string& property, } } +bool cmTarget::CheckImportedLibName(std::string const& prop, + std::string const& value) const +{ + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY || + !this->IsImported()) { + this->Makefile->IssueMessage( + cmake::FATAL_ERROR, prop + + " property may be set only on imported INTERFACE library targets."); + return false; + } + if (!value.empty()) { + if (value[0] == '-') { + this->Makefile->IssueMessage(cmake::FATAL_ERROR, prop + + " property value\n " + value + + "\nmay not start with '-'."); + return false; + } + std::string::size_type bad = value.find_first_of(":/\\;"); + if (bad != value.npos) { + this->Makefile->IssueMessage( + cmake::FATAL_ERROR, prop + " property value\n " + value + + "\nmay not contain '" + value.substr(bad, 1) + "'."); + return false; + } + } + return true; +} + bool cmTarget::GetMappedConfig(std::string const& desired_config, const char** loc, const char** imp, std::string& suffix) const { - if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { - // This method attempts to find a config-specific LOCATION for the - // IMPORTED library. In the case of cmStateEnums::INTERFACE_LIBRARY, there - // is no - // LOCATION at all, so leaving *loc and *imp unchanged is the appropriate - // and valid response. - return true; - } + std::string const locPropBase = + this->GetType() == cmStateEnums::INTERFACE_LIBRARY ? "IMPORTED_LIBNAME" + : "IMPORTED_LOCATION"; // Track the configuration-specific property suffix. suffix = "_"; @@ -1410,7 +1443,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, if (mci->empty()) { // An empty string in the mapping has a special meaning: // look up the config-less properties. - *loc = this->GetProperty("IMPORTED_LOCATION"); + *loc = this->GetProperty(locPropBase); if (allowImp) { *imp = this->GetProperty("IMPORTED_IMPLIB"); } @@ -1420,7 +1453,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, } } else { std::string mcUpper = cmSystemTools::UpperCase(*mci); - std::string locProp = "IMPORTED_LOCATION_"; + std::string locProp = locPropBase + "_"; locProp += mcUpper; *loc = this->GetProperty(locProp); if (allowImp) { @@ -1438,16 +1471,18 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, } // If we needed to find one of the mapped configurations but did not - // then the target is not found. The project does not want any - // other configuration. + // then the target location is not found. The project does not want + // any other configuration. if (!mappedConfigs.empty() && !*loc && !*imp) { - return false; + // Interface libraries are always available because their + // library name is optional so it is okay to leave *loc empty. + return this->GetType() == cmStateEnums::INTERFACE_LIBRARY; } // If we have not yet found it then there are no mapped // configurations. Look for an exact-match. if (!*loc && !*imp) { - std::string locProp = "IMPORTED_LOCATION"; + std::string locProp = locPropBase; locProp += suffix; *loc = this->GetProperty(locProp); if (allowImp) { @@ -1465,7 +1500,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, // Look for a configuration-less location. This may be set by // manually-written code. - *loc = this->GetProperty("IMPORTED_LOCATION"); + *loc = this->GetProperty(locPropBase); if (allowImp) { *imp = this->GetProperty("IMPORTED_IMPLIB"); } @@ -1483,7 +1518,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, !*loc && !*imp && aci != availableConfigs.end(); ++aci) { suffix = "_"; suffix += cmSystemTools::UpperCase(*aci); - std::string locProp = "IMPORTED_LOCATION"; + std::string locProp = locPropBase; locProp += suffix; *loc = this->GetProperty(locProp); if (allowImp) { @@ -1493,9 +1528,11 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, } } } - // If we have not yet found it then the target is not available. + // If we have not yet found it then the target location is not available. if (!*loc && !*imp) { - return false; + // Interface libraries are always available because their + // library name is optional so it is okay to leave *loc empty. + return this->GetType() == cmStateEnums::INTERFACE_LIBRARY; } return true; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 1f035a1..1d40d20 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -5,6 +5,13 @@ #include <cmConfigure.h> // IWYU pragma: keep +#include <iosfwd> +#include <map> +#include <set> +#include <string> +#include <utility> +#include <vector> + #include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmListFileCache.h" @@ -14,16 +21,10 @@ #include "cmTargetLinkLibraryType.h" #include "cm_unordered_map.hxx" -#include <iosfwd> -#include <map> -#include <set> -#include <string> -#include <utility> -#include <vector> - +class cmGlobalGenerator; class cmMakefile; +class cmMessenger; class cmSourceFile; -class cmGlobalGenerator; class cmTargetInternals; class cmTargetInternalPointer @@ -277,6 +278,9 @@ private: void SetPropertyDefault(const std::string& property, const char* default_value); + bool CheckImportedLibName(std::string const& prop, + std::string const& value) const; + private: cmPropertyMap Properties; std::set<std::string> SystemIncludeDirectories; diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index a1c9b82..1b6c008 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileFeaturesCommand.h" -#include <algorithm> #include <sstream> #include "cmAlgorithms.h" diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index a4db55b..1b4056d 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetCompileOptionsCommand.h" -#include <algorithm> #include <sstream> #include "cmAlgorithms.h" diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index acea6ea..a953efb 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -3,9 +3,9 @@ #ifndef cmTargetDepend_h #define cmTargetDepend_h -#include <cmConfigure.h> +#include <cmConfigure.h> // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include <set> class cmGeneratorTarget; diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h index 634148b..b08ede2 100644 --- a/Source/cmTargetExport.h +++ b/Source/cmTargetExport.h @@ -3,13 +3,13 @@ #ifndef cmTargetExport_h #define cmTargetExport_h -#include <cmConfigure.h> +#include <cmConfigure.h> // IWYU pragma: keep -#include "cmStandardIncludes.h" +#include <string> class cmGeneratorTarget; -class cmInstallTargetGenerator; class cmInstallFilesGenerator; +class cmInstallTargetGenerator; /** \brief A member of an ExportSet * diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx index 7aba0f8..9a5c1da 100644 --- a/Source/cmTargetPropCommandBase.cxx +++ b/Source/cmTargetPropCommandBase.cxx @@ -4,6 +4,9 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" +#include "cmStateTypes.h" +#include "cmTarget.h" +#include "cmake.h" bool cmTargetPropCommandBase::HandleArguments( std::vector<std::string> const& args, const std::string& prop, diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h index 485a7f3..8b49653 100644 --- a/Source/cmTargetPropCommandBase.h +++ b/Source/cmTargetPropCommandBase.h @@ -3,6 +3,11 @@ #ifndef cmTargetPropCommandBase_h #define cmTargetPropCommandBase_h +#include <cmConfigure.h> // IWYU pragma: keep + +#include <string> +#include <vector> + #include "cmCommand.h" class cmTarget; diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx index 7cf1fd8..3a9bddb 100644 --- a/Source/cmTargetPropertyComputer.cxx +++ b/Source/cmTargetPropertyComputer.cxx @@ -3,14 +3,13 @@ #include "cmTargetPropertyComputer.h" -#include "cmGeneratorTarget.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" +#include <sstream> + #include "cmMessenger.h" -#include "cmSourceFile.h" -#include "cmSourceFileLocation.h" -#include "cmTarget.h" +#include "cmPolicies.h" +#include "cmStateSnapshot.h" #include "cm_unordered_set.hxx" +#include "cmake.h" bool cmTargetPropertyComputer::HandleLocationPropertyPolicy( std::string const& tgtName, cmMessenger* messenger, @@ -66,7 +65,9 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty( return true; } - if (cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_")) { + if (prop == "IMPORTED_CONFIGURATIONS" || prop == "IMPORTED_LIBNAME" || + cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME_") || + cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_")) { return true; } diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h index 7989589..45d31be 100644 --- a/Source/cmTargetPropertyComputer.h +++ b/Source/cmTargetPropertyComputer.h @@ -5,14 +5,13 @@ #include <cmConfigure.h> // IWYU pragma: keep +#include <string> + #include "cmAlgorithms.h" #include "cmListFileCache.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include <map> -#include <string> - -class cmTarget; class cmMessenger; class cmTargetPropertyComputer diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index 13c9a8f..058659a 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTargetSourcesCommand.h" -#include <algorithm> #include <sstream> #include "cmAlgorithms.h" diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx index 1c36dc6..4d0cbaa 100644 --- a/Source/cmTest.cxx +++ b/Source/cmTest.cxx @@ -5,7 +5,6 @@ #include "cmMakefile.h" #include "cmProperty.h" #include "cmState.h" -#include "cmStateTypes.h" #include "cmSystemTools.h" cmTest::cmTest(cmMakefile* mf) diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 843f7b1..4164f3a 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -2,6 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTestGenerator.h" +#include <map> +#include <ostream> +#include <utility> + #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmLocalGenerator.h" @@ -11,11 +15,6 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTest.h" -#include "cm_auto_ptr.hxx" - -#include <map> -#include <ostream> -#include <utility> cmTestGenerator::cmTestGenerator( cmTest* test, std::vector<std::string> const& configurations) diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index 9597e09..589f195 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -2,15 +2,11 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmTimestamp.h" -#include "cmSystemTools.h" - -#include <cstdlib> +#include <cmConfigure.h> #include <cstring> #include <sstream> -#include <sys/types.h> -// include sys/stat.h after sys/types.h -#include <sys/stat.h> +#include "cmSystemTools.h" std::string cmTimestamp::CurrentTime(const std::string& formatString, bool utcFlag) diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h index 44e397b..fdee564 100644 --- a/Source/cmTimestamp.h +++ b/Source/cmTimestamp.h @@ -3,9 +3,7 @@ #ifndef cmTimestamp_h #define cmTimestamp_h -#include <cmConfigure.h> - -#include "cmStandardIncludes.h" +#include <cmConfigure.h> // IWYU pragma: keep #include <string> #include <time.h> diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index 5f16bd8..fcd9954 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -3,10 +3,11 @@ #ifndef cm_codecvt_hxx #define cm_codecvt_hxx -#include <cmConfigure.h> // IWYU pragma: keep +#include <cmConfigure.h> #include <locale> #include <vector> +#include <wchar.h> class codecvt : public std::codecvt<char, char, mbstate_t> { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index eb76ca0..6c066c6 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -17,6 +17,7 @@ #include "cmMakefile.h" #include "cmMessenger.h" #include "cmState.h" +#include "cmStateDirectory.h" #include "cmSystemTools.h" #include "cmTarget.h" #include "cmTargetLinkLibraryType.h" @@ -25,11 +26,11 @@ #include "cm_auto_ptr.hxx" #if defined(CMAKE_BUILD_WITH_CMAKE) +#include <cm_jsoncpp_writer.h> + #include "cmGraphVizWriter.h" #include "cmVariableWatch.h" #include "cm_unordered_map.hxx" - -#include <cm_jsoncpp_writer.h> #endif // only build kdevelop generator on non-windows platforms diff --git a/Source/cmake.h b/Source/cmake.h index 6e8d9c8..0f1891d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -5,17 +5,18 @@ #include <cmConfigure.h> -#include "cmInstalledFile.h" -#include "cmListFileCache.h" -#include "cmStateSnapshot.h" - #include <map> #include <set> #include <string> #include <vector> +#include "cmInstalledFile.h" +#include "cmListFileCache.h" +#include "cmStateSnapshot.h" +#include "cmStateTypes.h" + #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_jsoncpp_value.h" +#include <cm_jsoncpp_value.h> #endif class cmExternalMakefileProjectGeneratorFactory; @@ -24,6 +25,7 @@ class cmGlobalGenerator; class cmGlobalGeneratorFactory; class cmMakefile; class cmMessenger; +class cmState; class cmVariableWatch; struct cmDocumentationEntry; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 44af966..a974061 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -12,6 +12,7 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmake.h" #include "cmcmd.h" diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index c008791..1db147a 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -8,6 +8,7 @@ #include "cmMakefile.h" #include "cmQtAutoGenerators.h" #include "cmStateDirectory.h" +#include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmUtils.hxx" #include "cmVersion.h" diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt index ee81419..3db210a 100644 --- a/Tests/InterfaceLibrary/CMakeLists.txt +++ b/Tests/InterfaceLibrary/CMakeLists.txt @@ -25,8 +25,25 @@ target_sources(iface_objlib INTERFACE $<TARGET_OBJECTS:objlib>) add_library(intermediate INTERFACE) target_link_libraries(intermediate INTERFACE iface_objlib) +add_library(item_fake_tgt STATIC item_fake.cpp) +set_property(TARGET item_fake_tgt PROPERTY OUTPUT_NAME item_fake) +add_library(item_real STATIC item.cpp) +add_library(item_iface INTERFACE IMPORTED) +set_property(TARGET item_iface PROPERTY IMPORTED_LIBNAME item_real) +add_dependencies(item_iface item_real) +link_directories(${CMAKE_CURRENT_BINARY_DIR}) + add_executable(InterfaceLibrary definetestexe.cpp) -target_link_libraries(InterfaceLibrary iface_nodepends headeriface subiface intermediate) +target_link_libraries(InterfaceLibrary + iface_nodepends + headeriface + subiface + intermediate + + item_iface + item_fake # ensure that 'item_real' is ordered in place of item_iface + ) +add_dependencies(InterfaceLibrary item_fake_tgt) add_subdirectory(libsdir) diff --git a/Tests/InterfaceLibrary/definetestexe.cpp b/Tests/InterfaceLibrary/definetestexe.cpp index a6b5592..098502c 100644 --- a/Tests/InterfaceLibrary/definetestexe.cpp +++ b/Tests/InterfaceLibrary/definetestexe.cpp @@ -17,8 +17,9 @@ extern int obj(); extern int sub(); +extern int item(); int main(int, char**) { - return obj() + sub(); + return obj() + sub() + item(); } diff --git a/Tests/InterfaceLibrary/item.cpp b/Tests/InterfaceLibrary/item.cpp new file mode 100644 index 0000000..85cda1b --- /dev/null +++ b/Tests/InterfaceLibrary/item.cpp @@ -0,0 +1,4 @@ +int item() +{ + return 0; +} diff --git a/Tests/InterfaceLibrary/item_fake.cpp b/Tests/InterfaceLibrary/item_fake.cpp new file mode 100644 index 0000000..b4bd829 --- /dev/null +++ b/Tests/InterfaceLibrary/item_fake.cpp @@ -0,0 +1,5 @@ +extern int item_undefined(); +int item() +{ + return item_undefined(); +} diff --git a/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake new file mode 100644 index 0000000..02ebb44 --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-ExpectedFiles.cmake @@ -0,0 +1,5 @@ +set(whitespaces_ "[\t\n\r ]*") + +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_1 "rpm_suggests*.rpm") +set(EXPECTED_FILE_CONTENT_1 "^/usr/foo${whitespaces_}/usr/foo/CMakeLists.txt$") diff --git a/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake new file mode 100644 index 0000000..32cc6d1 --- /dev/null +++ b/Tests/RunCMake/CPack/RPM/RPM_SUGGESTS-VerifyResult.cmake @@ -0,0 +1,31 @@ +execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --querytags + OUTPUT_VARIABLE RPMBUILD_CAPS + RESULT_VARIABLE RPMBUILD_CAPS_RESULT) + +if(NOT RPMBUILD_CAPS_RESULT) + string(REPLACE "\n" ";" RPMBUILD_CAPS "${RPMBUILD_CAPS}") + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if(SUGGESTS IN_LIST RPMBUILD_CAPS) + set(should_contain_suggests_tag_ true) + endif() + cmake_policy(POP) +endif() + +# Only verify that suggests tag is present only if that tag is supported. +# If it is not supported the rpm package was corretly generated by ignoring +# that tag and that was already checked by expected files test. +if(should_contain_suggests_tag_) + execute_process(COMMAND ${RPM_EXECUTABLE} -q --suggests -p "${FOUND_FILE_1}" + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + RESULT_VARIABLE rpm_result_ + OUTPUT_VARIABLE rpm_output_ + ERROR_VARIABLE error_variable_ + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(rpm_result_ OR NOT rpm_output_ STREQUAL "libsuggested") + message(FATAL_ERROR "RPM_SUGGESTED package error: no suggested packages" + " (result: '${rpm_result_}'; output: '${rpm_output_}';" + " error: '${error_variable_}')") + endif() +endif() diff --git a/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake b/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake new file mode 100644 index 0000000..e6e0c1f --- /dev/null +++ b/Tests/RunCMake/CPack/RPM_SUGGESTS.cmake @@ -0,0 +1,4 @@ +install(FILES CMakeLists.txt DESTINATION foo) + +set(CPACK_RPM_PACKAGE_SUGGESTS "libsuggested") +set(CPACK_PACKAGE_NAME "rpm_suggests") diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 474ee33..38bd0ea 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cpack_test(CUSTOM_NAMES "RPM;DEB" true) run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM" false) run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false) run_cpack_test(RPM_DIST "RPM" false) +run_cpack_test(RPM_SUGGESTS "RPM" false) run_cpack_test(INSTALL_SCRIPTS "RPM" false) run_cpack_test(DEB_GENERATE_SHLIBS "DEB" true) run_cpack_test(DEB_GENERATE_SHLIBS_LDCONFIG "DEB" true) diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-result.txt b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-stderr.txt b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-stderr.txt new file mode 100644 index 0000000..454c655 --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-stderr.txt @@ -0,0 +1,44 @@ +^CMake Error at IMPORTED_LIBNAME-bad-value.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property value + + -flag + + may not start with '-'. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-bad-value.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property value + + item1;item2 + + may not contain ';'. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-bad-value.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property value + + /path/to/item1 + + may not contain '/'. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-bad-value.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property value + + \\path\\to\\item1 + + may not contain '\\'. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-bad-value.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property value + + c:\\path\\to\\item1 + + may not contain ':'. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value.cmake b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value.cmake new file mode 100644 index 0000000..1af65b4 --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value.cmake @@ -0,0 +1,6 @@ +add_library(MyTarget INTERFACE IMPORTED) +set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME -flag) +set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME item1 item2) +set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME /path/to/item1) +set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME \\path\\to\\item1) +set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME c:\\path\\to\\item1) diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-result.txt b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-stderr.txt b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-stderr.txt new file mode 100644 index 0000000..3a329d2 --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-stderr.txt @@ -0,0 +1,45 @@ +^CMake Error at IMPORTED_LIBNAME-non-iface.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property may be set only on imported INTERFACE library + targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-iface.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property may not be APPENDed. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-iface.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME_DEBUG property may be set only on imported INTERFACE + library targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-iface.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME_DEBUG property may not be APPENDed. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-iface.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property may be set only on imported INTERFACE library + targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-iface.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property may be set only on imported INTERFACE library + targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-iface.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property may be set only on imported INTERFACE library + targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-iface.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property may be set only on imported INTERFACE library + targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface.cmake b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface.cmake new file mode 100644 index 0000000..fe6841a --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface.cmake @@ -0,0 +1,17 @@ +add_custom_target(MyCustom) +set_property(TARGET MyCustom PROPERTY IMPORTED_LIBNAME item1) +set_property(TARGET MyCustom APPEND PROPERTY IMPORTED_LIBNAME item2) +set_property(TARGET MyCustom PROPERTY IMPORTED_LIBNAME_DEBUG item1) +set_property(TARGET MyCustom APPEND PROPERTY IMPORTED_LIBNAME_DEBUG item2) + +add_library(MyStatic STATIC IMPORTED) +set_property(TARGET MyStatic PROPERTY IMPORTED_LIBNAME item1) + +add_library(MyShared SHARED IMPORTED) +set_property(TARGET MyShared PROPERTY IMPORTED_LIBNAME item1) + +add_library(MyModule MODULE IMPORTED) +set_property(TARGET MyModule PROPERTY IMPORTED_LIBNAME item1) + +add_executable(MyExe IMPORTED) +set_property(TARGET MyExe PROPERTY IMPORTED_LIBNAME item1) diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-result.txt b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-stderr.txt b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-stderr.txt new file mode 100644 index 0000000..e9d94cf --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-stderr.txt @@ -0,0 +1,21 @@ +^CMake Error at IMPORTED_LIBNAME-non-imported.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property may be set only on imported INTERFACE library + targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-imported.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME property may not be APPENDed. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-imported.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME_DEBUG property may be set only on imported INTERFACE + library targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Error at IMPORTED_LIBNAME-non-imported.cmake:[0-9]+ \(set_property\): + IMPORTED_LIBNAME_DEBUG property may not be APPENDed. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported.cmake b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported.cmake new file mode 100644 index 0000000..07a67d7 --- /dev/null +++ b/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported.cmake @@ -0,0 +1,5 @@ +add_library(MyTarget INTERFACE) +set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME item1) +set_property(TARGET MyTarget APPEND PROPERTY IMPORTED_LIBNAME item2) +set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME_DEBUG item1) +set_property(TARGET MyTarget APPEND PROPERTY IMPORTED_LIBNAME_DEBUG item2) diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake index 201daa7..5a6af1d 100644 --- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake @@ -8,3 +8,6 @@ run_cmake(invalid_signature) run_cmake(global-interface) run_cmake(genex_link) run_cmake(add_custom_command-TARGET) +run_cmake(IMPORTED_LIBNAME-bad-value) +run_cmake(IMPORTED_LIBNAME-non-iface) +run_cmake(IMPORTED_LIBNAME-non-imported) |