diff options
21 files changed, 91 insertions, 16 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index bee69d9..ddf8b23 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -914,7 +914,7 @@ function(cpack_deb_prepare_package_vars) extract_so_info("${_FILE}" libname soversion) if(libname AND soversion) list(APPEND CPACK_DEBIAN_PACKAGE_SHLIBS_LIST - "${libname} ${soversion} ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY} ${CPACK_PACKAGE_VERSION})") + "${libname} ${soversion} ${CPACK_DEBIAN_PACKAGE_NAME} (${CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY} ${CPACK_DEBIAN_PACKAGE_VERSION})") else() message(AUTHOR_WARNING "Shared library '${_FILE}' is missing soname or soversion. Library will not be added to DEBIAN/shlibs control file.") endif() @@ -967,7 +967,7 @@ function(cpack_deb_prepare_package_vars) # Patch package file name to be in corrent debian format: # <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb set(CPACK_OUTPUT_FILE_NAME - "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") + "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") else() cmake_policy(PUSH) cmake_policy(SET CMP0010 NEW) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 5021c41..722ee15 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -2473,8 +2473,8 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ # We should generate a USER spec file template: # - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE # - or the user did not provide one : NOT CPACK_RPM_USER_BINARY_SPECFILE + set(RPMBUILD_FLAGS "-bb") if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE) - set(RPMBUILD_FLAGS "-bb") file(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in "# -*- rpm-spec -*- diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake index 3765079..4783424 100644 --- a/Modules/Compiler/PGI-Fortran.cmake +++ b/Modules/Compiler/PGI-Fortran.cmake @@ -1,6 +1,9 @@ include(Compiler/PGI) __compiler_pgi(Fortran) +set(CMAKE_Fortran_PREPROCESS_SOURCE + "<CMAKE_Fortran_COMPILER> -Mpreprocess <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") + set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-Mnofreeform") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-Mfreeform") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ce20358..7a2482a 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 20161223) +set(CMake_VERSION_PATCH 20170110) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 36566a4..5c50da8 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -173,7 +173,11 @@ int cmCPackDebGenerator::PackageComponentsAllInOne( std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + this->GetOutputExtension()); // all GROUP in one vs all COMPONENT in one - localToplevel += "/" + compInstDirName; + // if must be here otherwise non component paths have a trailing / while + // components don't + if (!compInstDirName.empty()) { + localToplevel += "/" + compInstDirName; + } /* replace the TEMP DIRECTORY with the component one */ this->SetOption("CPACK_TEMPORARY_DIRECTORY", localToplevel.c_str()); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 736aa91..96535eb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1977,6 +1977,22 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, buildSettings->AddAttribute("HEADER_SEARCH_PATHS", dirs.CreateList()); } + if (this->XcodeVersion >= 60) { + // Add those per-language flags in addition to HEADER_SEARCH_PATHS to gain + // system include directory awareness. We need to also keep on setting + // HEADER_SEARCH_PATHS to work around a missing compile options flag for + // GNU assembly files (#16449) + for (std::set<std::string>::iterator li = languages.begin(); + li != languages.end(); ++li) { + std::string includeFlags = this->CurrentLocalGenerator->GetIncludeFlags( + includes, gtgt, *li, true, false, configName); + + if (!includeFlags.empty()) { + cflags[*li] += " " + includeFlags; + } + } + } + bool same_gflags = true; std::map<std::string, std::string> gflags; std::string const* last_gflag = 0; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fccb486..cfc0495 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2215,7 +2215,7 @@ const char* cmMakefile::GetRequiredDefinition(const std::string& name) const const char* ret = this->GetDefinition(name); if (!ret) { cmSystemTools::Error("Error required internal CMake variable not " - "set, cmake may be not be built correctly.\n", + "set, cmake may not be built correctly.\n", "Missing variable is:\n", name.c_str()); return ""; } diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index f47cb33..334a05a 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -731,12 +731,16 @@ static Json::Value DumpTarget(cmGeneratorTarget* target, Json::Value result = Json::objectValue; result[kNAME_KEY] = target->GetName(); - result[kTYPE_KEY] = typeName; - result[kFULL_NAME_KEY] = target->GetFullName(config); result[kSOURCE_DIRECTORY_KEY] = lg->GetCurrentSourceDirectory(); result[kBUILD_DIRECTORY_KEY] = lg->GetCurrentBinaryDirectory(); + if (type == cmStateEnums::INTERFACE_LIBRARY) { + return result; + } + + result[kFULL_NAME_KEY] = target->GetFullName(config); + if (target->HaveWellDefinedOutputFiles()) { Json::Value artifacts = Json::arrayValue; artifacts.append(target->GetFullPath(config, false)); @@ -997,6 +1001,8 @@ cmServerResponse cmServerProtocol1_0::ProcessConfigure( } } + cmSystemTools::ResetErrorOccuredFlag(); // Reset error state + if (cm->AddCMakePaths() != 1) { return request.ReportError("Failed to set CMake paths."); } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ee4ff39..9261ca8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -858,6 +858,12 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } + if (prop == "TYPE") { + std::ostringstream e; + e << "TYPE property is read-only\n"; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + return; + } if (prop == "EXPORT_NAME" && this->IsImported()) { std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt index 4920582..db18462 100644 --- a/Tests/IncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/CMakeLists.txt @@ -3,7 +3,9 @@ project(IncludeDirectories) if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.4) OR CMAKE_C_COMPILER_ID STREQUAL Clang OR CMAKE_C_COMPILER_ID STREQUAL AppleClang) - AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Ninja")) + AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles" + OR CMAKE_GENERATOR STREQUAL "Ninja" + OR (CMAKE_GENERATOR STREQUAL "Xcode" AND NOT XCODE_VERSION VERSION_LESS 6.0))) include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-Wunused-variable run_sys_includes_test) if(run_sys_includes_test) diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt index dcee85e..5078f30 100644 --- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt @@ -15,10 +15,17 @@ target_include_directories(upstream SYSTEM PUBLIC ) add_library(config_specific INTERFACE) -set(testConfig ${CMAKE_BUILD_TYPE}) -target_include_directories(config_specific SYSTEM INTERFACE - "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>" -) +if(CMAKE_GENERATOR STREQUAL "Xcode") + # CMAKE_BUILD_TYPE does not work here for multi-config generators + target_include_directories(config_specific SYSTEM INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/config_specific" + ) +else() + set(testConfig ${CMAKE_BUILD_TYPE}) + target_include_directories(config_specific SYSTEM INTERFACE + "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>" + ) +endif() add_library(consumer consumer.cpp) target_link_libraries(consumer upstream config_specific) diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake index 89da610..f883c69 100644 --- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake +++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake @@ -60,7 +60,11 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK ) foreach(o out err) - if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt) + if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt) + set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt") + elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-std${o}.txt) + set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-std${o}.txt") + elseif(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt) set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt") elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-std${o}.txt) set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-std${o}.txt") diff --git a/Tests/RunCMake/CPack/README.txt b/Tests/RunCMake/CPack/README.txt index f51d254..7c98f69 100644 --- a/Tests/RunCMake/CPack/README.txt +++ b/Tests/RunCMake/CPack/README.txt @@ -155,8 +155,18 @@ VerifyResult.cmake script also automatically prints out standard output and standard error from CPack execution phase that is compared with '<test_name>/<generator_name>-stdout.txt' regular expression and and '<test_name>/<generator_name>-stderr.txt' regular expresson respectively. -NOTE: For subtests generator name can also be suffixed with subtest name and in - such case subtest file is preferred. +NOTE: For subtests generator name can also be suffixed with subtest name and/or + packaging type (MONOLITHIC, COMPONENT, GROUP) and in such cases the + preferences of which file will be used are as follows: + - generator name + packaging type + subtest name + - generator name + packaging type + - generator name + subtest name + - generator name + - default generator + File name format: '<generator_name>-<packaging_type>-<subtest_name>-std<type>.txt' + where <type> can either be 'out' or 'err'. + File name format: '<generator_name>-<packaging_type>-std<type>.txt' + where <type> can either be 'out' or 'err'. File name format: '<generator_name>-<subtest_name>-std<type>.txt' where <type> can either be 'out' or 'err'. NOTE: If none of the comparison files are present then the default generator @@ -223,3 +233,4 @@ To add a new generator we must - if needed add 'default_expected_std<type>.txt' files where <type> is either 'out' or 'err' which will contain default expected output of package generation regular expression. +- add generator to list of other CPack generators in RunCMake/CMakeLists.txt diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index ea6d96b..af44182 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -23,3 +23,4 @@ run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_co run_cpack_source_test(SOURCE_PACKAGE "RPM") run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC") run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC") +run_cpack_test(MD5SUMS "DEB" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/tests/MD5SUMS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/MD5SUMS/ExpectedFiles.cmake new file mode 100644 index 0000000..6142eb3 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/MD5SUMS/ExpectedFiles.cmake @@ -0,0 +1,2 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/CMakeLists.txt") diff --git a/Tests/RunCMake/CPack/tests/MD5SUMS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/MD5SUMS/VerifyResult.cmake new file mode 100644 index 0000000..fbdda9c --- /dev/null +++ b/Tests/RunCMake/CPack/tests/MD5SUMS/VerifyResult.cmake @@ -0,0 +1,3 @@ +set(whitespaces_ "[\t\n\r ]*") +set(md5sums_md5sums "^.* usr/foo/CMakeLists\.txt${whitespaces_}$") +verifyDebControl("${FOUND_FILE_1}" "md5sums" "md5sums") diff --git a/Tests/RunCMake/CPack/tests/MD5SUMS/test.cmake b/Tests/RunCMake/CPack/tests/MD5SUMS/test.cmake new file mode 100644 index 0000000..15c5892 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/MD5SUMS/test.cmake @@ -0,0 +1,5 @@ +install(FILES CMakeLists.txt DESTINATION foo COMPONENT test) + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(CPACK_COMPONENTS_ALL test) +endif() diff --git a/Tests/RunCMake/set_property/RunCMakeTest.cmake b/Tests/RunCMake/set_property/RunCMakeTest.cmake index 37c7124..1ddacee 100644 --- a/Tests/RunCMake/set_property/RunCMakeTest.cmake +++ b/Tests/RunCMake/set_property/RunCMakeTest.cmake @@ -6,4 +6,5 @@ run_cmake(COMPILE_OPTIONS) run_cmake(INCLUDE_DIRECTORIES) run_cmake(LINK_LIBRARIES) run_cmake(SOURCES) +run_cmake(TYPE) run_cmake(USER_PROP) diff --git a/Tests/RunCMake/set_property/TYPE-result.txt b/Tests/RunCMake/set_property/TYPE-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/set_property/TYPE-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/set_property/TYPE-stderr.txt b/Tests/RunCMake/set_property/TYPE-stderr.txt new file mode 100644 index 0000000..fbc8653 --- /dev/null +++ b/Tests/RunCMake/set_property/TYPE-stderr.txt @@ -0,0 +1 @@ +TYPE property is read-only diff --git a/Tests/RunCMake/set_property/TYPE.cmake b/Tests/RunCMake/set_property/TYPE.cmake new file mode 100644 index 0000000..8481266 --- /dev/null +++ b/Tests/RunCMake/set_property/TYPE.cmake @@ -0,0 +1,2 @@ +add_custom_target(CustomTarget) +set_property(TARGET CustomTarget PROPERTY TYPE foo) |