diff --git a/Modules/CMakeASM-ATTInformation.cmake b/Modules/CMakeASM-ATTInformation.cmake index 675c13bb3..07a2d3811 100644 --- a/Modules/CMakeASM-ATTInformation.cmake +++ b/Modules/CMakeASM-ATTInformation.cmake @@ -19,7 +19,7 @@ set(ASM_DIALECT "-ATT") # assembler but should be processed by gcc set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm) -set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o ") +set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o ") include(CMakeASMInformation) set(ASM_DIALECT) diff --git a/Modules/CMakeASM_NASMInformation.cmake b/Modules/CMakeASM_NASMInformation.cmake index 7058fc7ae..146f412cc 100644 --- a/Modules/CMakeASM_NASMInformation.cmake +++ b/Modules/CMakeASM_NASMInformation.cmake @@ -38,7 +38,7 @@ if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT) endif() endif() -set(CMAKE_ASM_NASM_COMPILE_OBJECT " -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o ") +set(CMAKE_ASM_NASM_COMPILE_OBJECT " -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o ") # Load the generic ASMInformation file: set(ASM_DIALECT "_NASM") diff --git a/Modules/Compiler/ARMCC-ASM.cmake b/Modules/Compiler/ARMCC-ASM.cmake index 8e3cfc5c8..539d5259f 100644 --- a/Modules/Compiler/ARMCC-ASM.cmake +++ b/Modules/Compiler/ARMCC-ASM.cmake @@ -3,5 +3,5 @@ include(Compiler/ARMCC) set(CMAKE_ASM_OUTPUT_EXTENSION ".o") set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1) -set(CMAKE_ASM_COMPILE_OBJECT " -o ") +set(CMAKE_ASM_COMPILE_OBJECT " -o ") set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa) diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake index ef125c061..9318a7d49 100644 --- a/Modules/FindGSL.cmake +++ b/Modules/FindGSL.cmake @@ -45,7 +45,7 @@ # of GSL installation discovered. These variables may optionally be set to # help this module find the correct files:: # -# GSL_CLBAS_LIBRARY - Location of the GSL CBLAS library. +# GSL_CBLAS_LIBRARY - Location of the GSL CBLAS library. # GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any). # GSL_CONFIG_EXECUTABLE - Location of the ``gsl-config`` script (if any). # GSL_LIBRARY - Location of the GSL library. diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake index 3cd9c22bc..805a58c59 100644 --- a/Modules/FindXCTest.cmake +++ b/Modules/FindXCTest.cmake @@ -140,6 +140,10 @@ function(xctest_add_bundle target testee) set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_BUNDLE_LOADER "$(TEST_HOST)" XCODE_ATTRIBUTE_TEST_HOST "$") + if(NOT XCODE_VERSION VERSION_LESS 7.3) + set_target_properties(${target} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "$/../PlugIns") + endif() else(XCODE) target_link_libraries(${target} PRIVATE -bundle_loader $) diff --git a/Modules/Platform/Generic-ADSP-ASM.cmake b/Modules/Platform/Generic-ADSP-ASM.cmake index 63a1388ce..e718bece2 100644 --- a/Modules/Platform/Generic-ADSP-ASM.cmake +++ b/Modules/Platform/Generic-ADSP-ASM.cmake @@ -3,5 +3,5 @@ include(Platform/Generic-ADSP-Common) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm) set(CMAKE_ASM_OUTPUT_EXTENSION ".doj" ) set(CMAKE_ASM_COMPILE_OBJECT - " -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o ") + " -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o ") diff --git a/Modules/Platform/gas.cmake b/Modules/Platform/gas.cmake index 7d2bc8454..7c659f2bb 100644 --- a/Modules/Platform/gas.cmake +++ b/Modules/Platform/gas.cmake @@ -4,7 +4,7 @@ else() set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj) endif() -set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o ") +set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT " -o ") set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY " cr " diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 683da4376..dea15411e 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 5) -set(CMake_VERSION_PATCH 1) +set(CMake_VERSION_PATCH 2) #set(CMake_VERSION_RC 0) diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index d17d6646f..c64e81315 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -117,7 +117,7 @@ void cmFLTKWrapUICommand::FinalPass() // people should add the srcs to the target themselves, but the old command // didn't support that, so check and see if they added the files in and if // they didn;t then print a warning and add then anyhow - cmTarget* target = this->Makefile->FindTarget(this->Target); + cmTarget* target = this->Makefile->FindLocalNonAliasTarget(this->Target); if(!target) { std::string msg = diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index c175e6208..b3b2f16fe 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -229,7 +229,7 @@ void cmFortranParser_RuleLineDirective(cmFortranParser* parser, cmSystemTools::ConvertToUnixSlashes(included); // Save the named file as included in the source. - if (cmSystemTools::FileExists(included)) + if (cmSystemTools::FileExists(included, true)) { parser->Info.Includes.insert(included); } diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 2d78a4101..7e72a8a99 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -381,7 +381,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) return false; } // Lookup this target in the current directory. - if(cmTarget* target=this->Makefile->FindTarget(*targetIt)) + if(cmTarget* target=this->Makefile->FindLocalNonAliasTarget(*targetIt)) { // Found the target. Check its type. if(target->GetType() != cmState::EXECUTABLE && diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 5e88fa2c7..b93fb8d61 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -446,7 +446,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmGeneratorTarget const* target, void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) { - this->Target = lg->FindGeneratorTarget(this->TargetName); + this->Target = lg->FindLocalNonAliasGeneratorTarget(this->TargetName); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 912be0c0f..586e4c69b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -485,19 +485,9 @@ private: std::string Name; }; -cmGeneratorTarget* cmLocalGenerator::FindGeneratorTarget( +cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget( const std::string& name) const { - std::map::const_iterator i = - this->AliasTargets.find(name); - if (i != this->AliasTargets.end()) - { - std::vector::const_iterator ai = - std::find_if(this->GeneratorTargets.begin(), - this->GeneratorTargets.end(), - NamedGeneratorTargetFinder(i->second)); - return *ai; - } std::vector::const_iterator ti = std::find_if(this->GeneratorTargets.begin(), this->GeneratorTargets.end(), @@ -506,7 +496,6 @@ cmGeneratorTarget* cmLocalGenerator::FindGeneratorTarget( { return *ti; } - return 0; } @@ -1839,7 +1828,7 @@ cmLocalGenerator::FindGeneratorTargetToUse(const std::string& name) const return *imported; } - if(cmGeneratorTarget* t = this->FindGeneratorTarget(name)) + if(cmGeneratorTarget* t = this->FindLocalNonAliasGeneratorTarget(name)) { return t; } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 68e766741..b673a85cc 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -129,7 +129,8 @@ public: void AddImportedGeneratorTarget(cmGeneratorTarget* gt); void AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt); - cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const; + cmGeneratorTarget* + FindLocalNonAliasGeneratorTarget(const std::string& name) const; cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const; /** diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index b2927a96e..2d13507ec 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -400,7 +400,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( bool symbolic = false; for (std::vector::const_iterator o = outputs.begin(); - o != outputs.end(); ++o) + !symbolic && o != outputs.end(); ++o) { if (cmSourceFile* sf = this->Makefile->GetSource(*o)) { @@ -444,7 +444,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( this->ConstructComment(ccg), "Custom command for " + ninjaOutputs[0], cc->GetUsesTerminal(), - /*restat*/!symbolic, + /*restat*/!symbolic || !byproducts.empty(), ninjaOutputs, ninjaDeps, orderOnlyDeps); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 600c985f0..df687d03e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4058,25 +4058,13 @@ std::vector cmMakefile::GetPropertyKeys() const return this->StateSnapshot.GetDirectory().GetPropertyKeys(); } -cmTarget* cmMakefile::FindTarget(const std::string& name, - bool excludeAliases) const +cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const { - if (!excludeAliases) - { - std::map::const_iterator i = - this->AliasTargets.find(name); - if (i != this->AliasTargets.end()) - { - cmTargets::iterator ai = this->Targets.find(i->second); - return &ai->second; - } - } cmTargets::iterator i = this->Targets.find( name ); if ( i != this->Targets.end() ) { return &i->second; } - return 0; } @@ -4247,7 +4235,7 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& name, } // Look for a target built in this directory. - if(cmTarget* t = this->FindTarget(name, excludeAliases)) + if(cmTarget* t = this->FindLocalNonAliasTarget(name)) { return t; } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 362ea75fb..45f2efb92 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -388,8 +388,7 @@ public: } std::vector GetImportedTargets() const; - cmTarget* FindTarget(const std::string& name, - bool excludeAliases = false) const; + cmTarget* FindLocalNonAliasTarget(const std::string& name) const; /** Find a target to use in place of the given name. The target returned may be imported or built within the project. */ diff --git a/Tests/AliasTarget/subdir/CMakeLists.txt b/Tests/AliasTarget/subdir/CMakeLists.txt index 8c84aea3c..05a7d86f0 100644 --- a/Tests/AliasTarget/subdir/CMakeLists.txt +++ b/Tests/AliasTarget/subdir/CMakeLists.txt @@ -1,3 +1,8 @@ add_library(tgt STATIC empty.cpp) add_library(Sub::tgt ALIAS tgt) + +# foo comes from the top-level CMakeLists.txt +add_library(Top::foo ALIAS foo) +get_target_property(some_prop Top::foo SOME_PROP) +target_link_libraries(tgt Top::foo) diff --git a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake new file mode 100644 index 000000000..6948c35bf --- /dev/null +++ b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake @@ -0,0 +1,28 @@ +add_custom_command( + OUTPUT gen-byproduct gen-byproduct-stamp + BYPRODUCTS byproduct + COMMAND ${CMAKE_COMMAND} -E touch gen-byproduct-stamp + COMMAND ${CMAKE_COMMAND} -E copy_if_different gen-byproduct-stamp byproduct + ) +set_property(SOURCE gen-byproduct PROPERTY SYMBOLIC 1) +add_custom_target(produce DEPENDS gen-byproduct) + +add_custom_command( + OUTPUT use-byproduct + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/byproduct + COMMAND ${CMAKE_COMMAND} -E touch use-byproduct + ) +add_custom_target(drive ALL DEPENDS use-byproduct) +add_dependencies(drive produce) + +file(GENERATE OUTPUT check-$>.cmake CONTENT " +if (check_step EQUAL 1) + set(check_pairs + \"${CMAKE_CURRENT_BINARY_DIR}/use-byproduct|${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp\" + ) +else() + set(check_pairs + \"${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp|${CMAKE_CURRENT_BINARY_DIR}/use-byproduct\" + ) +endif() +") diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index 31c72fbe1..0dd27d426 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -39,4 +39,5 @@ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio [67]|Xcode") unset(run_BuildDepends_skip_step_2) endif() +run_BuildDepends(Custom-Symbolic-and-Byproduct) run_BuildDepends(Custom-Always)