diff options
author | Brad King <brad.king@kitware.com> | 2013-10-18 13:09:32 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-22 09:09:52 -0400 |
commit | 248d1dc057564dc00e3374d7797a1e42ea57032d (patch) | |
tree | f02f66efaede660545b5ed228e36587f80164872 | |
parent | 6865c8fe05d407077a598fcc0921ef62dfeaf021 (diff) | |
download | cmake-248d1dc057564dc00e3374d7797a1e42ea57032d.tar.gz |
Add policy CMP0033 to disallow export_library_dependencies
-rw-r--r-- | Help/command/export_library_dependencies.rst | 4 | ||||
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 1 | ||||
-rw-r--r-- | Help/policy/CMP0033.rst | 14 | ||||
-rw-r--r-- | Source/cmExportLibraryDependencies.cxx | 4 | ||||
-rw-r--r-- | Source/cmExportLibraryDependencies.h | 39 | ||||
-rw-r--r-- | Source/cmPolicies.cxx | 5 | ||||
-rw-r--r-- | Source/cmPolicies.h | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-NEW-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt | 12 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake | 1 |
17 files changed, 61 insertions, 36 deletions
diff --git a/Help/command/export_library_dependencies.rst b/Help/command/export_library_dependencies.rst index c09f3d5a42..73c0b42405 100644 --- a/Help/command/export_library_dependencies.rst +++ b/Help/command/export_library_dependencies.rst @@ -1,7 +1,9 @@ export_library_dependencies --------------------------- -Deprecated. Use INSTALL(EXPORT) or EXPORT command. +Disallowed. See CMake Policy :policy:`CMP0033`. + +Use :command:`install(EXPORT)` or :command:`export` command. This command generates an old-style library dependencies file. Projects requiring CMake 2.6 or later should not use the command. Use diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 04ac33bab9..062a75d032 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -62,3 +62,4 @@ All Policies /policy/CMP0030 /policy/CMP0031 /policy/CMP0032 + /policy/CMP0033 diff --git a/Help/policy/CMP0033.rst b/Help/policy/CMP0033.rst new file mode 100644 index 0000000000..677e1c41b3 --- /dev/null +++ b/Help/policy/CMP0033.rst @@ -0,0 +1,14 @@ +CMP0033 +------- + +The :command:`export_library_dependencies` command should not be called. + +This command was added in January 2003 to export ``<tgt>_LIB_DEPENDS`` +internal CMake cache entries to a file for installation with a project. +This was used at the time to allow transitive link dependencies to +work for applications outside of the original build tree of a project. +The functionality has been superseded by the :command:`export` and +:command:`install(EXPORT)` commands. + +.. |disallowed_version| replace:: 3.0.0 +.. include:: DISALLOWED_COMMAND.txt diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependencies.cxx index e3b1626c5c..064ffa36aa 100644 --- a/Source/cmExportLibraryDependencies.cxx +++ b/Source/cmExportLibraryDependencies.cxx @@ -21,6 +21,10 @@ bool cmExportLibraryDependenciesCommand ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) { + if(this->Disallowed(cmPolicies::CMP0033, + "The export_library_dependencies command should not be called; " + "see CMP0033.")) + { return true; } if(args.size() < 1 ) { this->SetError("called with incorrect number of arguments"); diff --git a/Source/cmExportLibraryDependencies.h b/Source/cmExportLibraryDependencies.h index a384a7c980..29b568fc80 100644 --- a/Source/cmExportLibraryDependencies.h +++ b/Source/cmExportLibraryDependencies.h @@ -14,50 +14,19 @@ #include "cmCommand.h" -/** \class cmExportLibraryDependenciesCommand - * \brief Add a test to the lists of tests to run. - * - * cmExportLibraryDependenciesCommand adds a test to the list of tests to run - * - */ class cmExportLibraryDependenciesCommand : public cmCommand { public: - /** - * This is a virtual constructor for the command. - */ - virtual cmCommand* Clone() - { - return new cmExportLibraryDependenciesCommand; - } - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ + cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand); + virtual cmCommand* Clone() { return new cmExportLibraryDependenciesCommand; } virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); + virtual const char* GetName() const { return "export_library_dependencies";} + virtual bool IsDiscouraged() const { return true; } - /** - * This is called at the end after all the information - * specified by the command is accumulated. - */ virtual void FinalPass(); virtual bool HasFinalPass() const { return true; } - /** - * The name of the command as specified in CMakeList.txt. - */ - virtual const char* GetName() const { return "export_library_dependencies";} - - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - - cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand); - private: std::string Filename; bool Append; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index bf4d2c14b0..7852d9aa10 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -266,6 +266,11 @@ cmPolicies::cmPolicies() CMP0032, "CMP0032", "The output_required_files command should not be called.", 3,0,0,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0033, "CMP0033", + "The export_library_dependencies command should not be called.", + 3,0,0,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 851fdb8a6f..99982c4a69 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -84,6 +84,7 @@ public: CMP0030, ///< Disallow command: use_mangled_mesa CMP0031, ///< Disallow command: load_command CMP0032, ///< Disallow command: output_required_files + CMP0033, ///< Disallow command: export_library_dependencies /** \brief Always the last entry. * diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt new file mode 100644 index 0000000000..8d210aa689 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CMP0033-NEW.cmake:2 \(export_library_dependencies\): + The export_library_dependencies command should not be called; see CMP0033. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake new file mode 100644 index 0000000000..6f90f29e80 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0033 NEW) +export_library_dependencies() diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt new file mode 100644 index 0000000000..e5dd2dd79b --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CMP0033-OLD.cmake:2 \(export_library_dependencies\): + export_library_dependencies called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake new file mode 100644 index 0000000000..a3504b67d3 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0033 OLD) +export_library_dependencies() diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt new file mode 100644 index 0000000000..e561dacafe --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN-stderr.txt @@ -0,0 +1,12 @@ +CMake Warning \(dev\) at CMP0033-WARN.cmake:1 \(export_library_dependencies\): + Policy CMP0033 is not set: The export_library_dependencies command should + not be called. Run "cmake --help-policy CMP0033" for policy details. Use + the cmake_policy command to set the policy and suppress this warning. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error at CMP0033-WARN.cmake:1 \(export_library_dependencies\): + export_library_dependencies called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake new file mode 100644 index 0000000000..f897dddf51 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0033-WARN.cmake @@ -0,0 +1 @@ +export_library_dependencies() diff --git a/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake b/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake index 3d54d8f317..003298aaa9 100644 --- a/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake +++ b/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake @@ -5,6 +5,7 @@ foreach(p CMP0030 CMP0031 CMP0032 + CMP0033 ) run_cmake(${p}-WARN) run_cmake(${p}-OLD) |