summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCacheManager.h1
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx5
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h1
-rw-r--r--Source/cmTarget.cxx40
-rw-r--r--Source/cmake.cxx6
-rw-r--r--Source/cmake.h3
-rw-r--r--Source/cmakemain.cxx24
-rw-r--r--Source/cmakewizard.cxx155
-rw-r--r--Source/cmakewizard.h42
12 files changed, 64 insertions, 222 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 7efaa50..01e4f88 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -281,8 +281,6 @@ set(SRCS
cmXMLSafe.h
cmake.cxx
cmake.h
- cmakewizard.cxx
- cmakewizard.h
cm_sha2.h
cm_sha2.c
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index a44f362..321066d 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 12)
-set(CMake_VERSION_TWEAK 20131021)
+set(CMake_VERSION_TWEAK 20131022)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 2eb440a..4b8c07d 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -179,7 +179,6 @@ private:
// the commands should never use the cmCacheManager directly
friend class cmMakefile; // allow access to add cache values
friend class cmake; // allow access to add cache values
- friend class cmakewizard; // allow access to add cache values
friend class cmMarkAsAdvancedCommand; // allow access to add cache values
};
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index f21abc3..30c3d73 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -2050,6 +2050,11 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
fout << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\"\n";
}
this->WriteProjectSCC(fout, target);
+ if(const char* targetFrameworkVersion =
+ target.GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
+ {
+ fout << "\tTargetFrameworkVersion=\"" << targetFrameworkVersion << "\"\n";
+ }
fout << "\tKeyword=\"" << keyword << "\">\n"
<< "\t<Platforms>\n"
<< "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index ffab8e5..f7efc1e 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -241,6 +241,11 @@ cmPolicies::cmPolicies()
CMP0027, "CMP0027",
"Conditionally linked imported targets with missing include directories.",
3,0,0,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0028, "CMP0028",
+ "Double colon in target name means ALIAS or IMPORTED target.",
+ 3,0,0,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 39c2afb..68cd7c2 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -79,6 +79,7 @@ public:
CMP0026, ///< Disallow use of the LOCATION target property.
CMP0027, ///< Conditionally linked imported targets with missing include
/// directories.
+ CMP0028, ///< Double colon in target name means ALIAS or IMPORTED target.
/** \brief Always the last entry.
*
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 6e5e0ff..126cdbd 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5505,6 +5505,46 @@ void cmTarget::ComputeLinkImplementation(const char* config,
{
continue;
}
+ cmTarget *tgt = this->Makefile->FindTargetToUse(li->c_str());
+
+ if(!tgt && std::string(item).find("::") != std::string::npos)
+ {
+ bool noMessage = false;
+ cmake::MessageType messageType = cmake::FATAL_ERROR;
+ cmOStringStream e;
+ switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028))
+ {
+ case cmPolicies::WARN:
+ {
+ e << (this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0028)) << "\n";
+ messageType = cmake::AUTHOR_WARNING;
+ }
+ break;
+ case cmPolicies::OLD:
+ noMessage = true;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ // Issue the fatal message.
+ break;
+ }
+
+ if(!noMessage)
+ {
+ e << "Target \"" << this->GetName() << "\" links to target \"" << item
+ << "\" but the target was not found. Perhaps a find_package() "
+ "call is missing for an IMPORTED target, or a ALIAS target is "
+ "missing?";
+ this->Makefile->GetCMakeInstance()->IssueMessage(messageType,
+ e.str(),
+ this->GetBacktrace());
+ if (messageType == cmake::FATAL_ERROR)
+ {
+ return;
+ }
+ }
+ }
// The entry is meant for this configuration.
impl.Libraries.push_back(item);
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 9c79516..6822fe1 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2871,8 +2871,7 @@ int cmake::Build(const std::string& dir,
const std::string& target,
const std::string& config,
const std::vector<std::string>& nativeOptions,
- bool clean,
- cmSystemTools::OutputOption outputflag)
+ bool clean)
{
if(!cmSystemTools::FileIsDirectory(dir.c_str()))
{
@@ -2914,7 +2913,8 @@ int cmake::Build(const std::string& dir,
projName.c_str(), target.c_str(),
&output,
makeProgram.c_str(),
- config.c_str(), clean, false, 0, outputflag,
+ config.c_str(), clean, false, 0,
+ cmSystemTools::OUTPUT_PASSTHROUGH,
0, nativeOptions);
}
diff --git a/Source/cmake.h b/Source/cmake.h
index 73e5109..7fe130b 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -362,8 +362,7 @@ class cmake
const std::string& target,
const std::string& config,
const std::vector<std::string>& nativeOptions,
- bool clean,
- cmSystemTools::OutputOption outputflag);
+ bool clean);
void UnwatchUnusedCli(const char* var);
void WatchUnusedCli(const char* var);
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 5113a75..ff5c8ae 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -20,7 +20,6 @@
#include "cmcmd.h"
#include "cmCacheManager.h"
#include "cmListFileCache.h"
-#include "cmakewizard.h"
#include "cmSourceFile.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
@@ -50,10 +49,7 @@ static const char * cmDocumentationUsage[][2] =
" --config <cfg> = For multi-configuration tools, choose <cfg>.\n" \
" --clean-first = Build target 'clean' first, then build.\n" \
" (To clean only, use --target 'clean'.)\n" \
- " --use-stderr = Don't merge stdout/stderr output and pass the\n" \
- " original stdout/stderr handles to the native\n" \
- " tool so it can use the capabilities of the\n" \
- " calling terminal (e.g. colored output).\n" \
+ " --use-stderr = Ignored. Behavior is default in CMake >= 3.0.\n" \
" -- = Pass remaining options to the native tool.\n"
//----------------------------------------------------------------------------
@@ -61,7 +57,6 @@ static const char * cmDocumentationOptions[][2] =
{
CMAKE_STANDARD_OPTIONS_TABLE,
{"-E", "CMake command mode."},
- {"-i", "Run in wizard mode."},
{"-L[A][H]", "List non-advanced cached variables."},
{"--build <dir>", "Build a CMake-generated project binary tree."},
{"-N", "View mode only."},
@@ -236,7 +231,6 @@ int do_cmake(int ac, char** av)
}
#endif
- bool wiz = false;
bool sysinfo = false;
bool list_cached = false;
bool list_all_cached = false;
@@ -248,7 +242,11 @@ int do_cmake(int ac, char** av)
{
if(strcmp(av[i], "-i") == 0)
{
- wiz = true;
+ std::cerr <<
+ "The \"cmake -i\" wizard mode is no longer supported.\n"
+ "Use the -D option to set cache values on the command line.\n"
+ "Use cmake-gui or ccmake for an interactive dialog.\n";
+ return 1;
}
else if(strcmp(av[i], "--system-information") == 0)
{
@@ -301,11 +299,6 @@ int do_cmake(int ac, char** av)
args.push_back(av[i]);
}
}
- if (wiz)
- {
- cmakewizard wizard;
- return wizard.RunWizard(args);
- }
if (sysinfo)
{
cmake cm;
@@ -372,7 +365,6 @@ static int do_build(int ac, char** av)
std::string dir;
std::vector<std::string> nativeOptions;
bool clean = false;
- cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_MERGE;
enum Doing { DoingNone, DoingDir, DoingTarget, DoingConfig, DoingNative};
Doing doing = DoingDir;
@@ -397,7 +389,7 @@ static int do_build(int ac, char** av)
}
else if(strcmp(av[i], "--use-stderr") == 0)
{
- outputflag = cmSystemTools::OUTPUT_PASSTHROUGH;
+ /* tolerate legacy option */
}
else if(strcmp(av[i], "--") == 0)
{
@@ -444,6 +436,6 @@ static int do_build(int ac, char** av)
}
cmake cm;
- return cm.Build(dir, target, config, nativeOptions, clean, outputflag);
+ return cm.Build(dir, target, config, nativeOptions, clean);
#endif
}
diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx
deleted file mode 100644
index bac403a..0000000
--- a/Source/cmakewizard.cxx
+++ /dev/null
@@ -1,155 +0,0 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-#include "cmakewizard.h"
-#include "cmake.h"
-#include "cmCacheManager.h"
-
-cmakewizard::cmakewizard()
-{
- this->ShowAdvanced = false;
-}
-
-
-void cmakewizard::AskUser(const char* key,
- cmCacheManager::CacheIterator& iter)
-{
- printf("Variable Name: %s\n", key);
- const char* helpstring = iter.GetProperty("HELPSTRING");
- printf("Description: %s\n", (helpstring?helpstring:"(none)"));
- printf("Current Value: %s\n", iter.GetValue());
- printf("New Value (Enter to keep current value): ");
- char buffer[4096];
- if(!fgets(buffer, static_cast<int>(sizeof(buffer) - 1), stdin))
- {
- buffer[0] = 0;
- }
-
- if(strlen(buffer) > 0)
- {
- std::string sbuffer = buffer;
- std::string::size_type pos = sbuffer.find_last_not_of(" \n\r\t");
- std::string value = "";
- if ( pos != std::string::npos )
- {
- value = sbuffer.substr(0, pos+1);
- }
-
- if ( value.size() > 0 )
- {
- if(iter.GetType() == cmCacheManager::PATH ||
- iter.GetType() == cmCacheManager::FILEPATH)
- {
- cmSystemTools::ConvertToUnixSlashes(value);
- }
- if(iter.GetType() == cmCacheManager::BOOL)
- {
- if(!cmSystemTools::IsOn(value.c_str()))
- {
- value = "OFF";
- }
- }
- iter.SetValue(value.c_str());
- }
- }
- printf("\n");
-}
-
-bool cmakewizard::AskAdvanced()
-{
- printf("Would you like to see advanced options? [No]:");
- char buffer[4096];
- if(!fgets(buffer, static_cast<int>(sizeof(buffer) - 1), stdin))
- {
- buffer[0] = 0;
- }
- else if(buffer[0] == 'y' || buffer[0] == 'Y')
- {
- return true;
- }
- return false;
-}
-
-
-void cmakewizard::ShowMessage(const char* m)
-{
- printf("%s\n", m);
-}
-
-
-
-int cmakewizard::RunWizard(std::vector<std::string> const& args)
-{
- this->ShowAdvanced = this->AskAdvanced();
- cmSystemTools::DisableRunCommandOutput();
- cmake make;
- make.SetArgs(args);
- make.SetCMakeCommand(args[0].c_str());
- make.LoadCache();
- make.SetCacheArgs(args);
- std::map<cmStdString, cmStdString> askedCache;
- bool asked = false;
- // continue asking questions until no new questions are asked
- do
- {
- asked = false;
- // run cmake
- this->ShowMessage(
- "Please wait while cmake processes CMakeLists.txt files....\n");
-
- make.Configure();
- this->ShowMessage("\n");
- // load the cache from disk
- cmCacheManager *cachem = make.GetCacheManager();
- cachem->LoadCache(make.GetHomeOutputDirectory());
- cmCacheManager::CacheIterator i = cachem->NewIterator();
- // iterate over all entries in the cache
- for(;!i.IsAtEnd(); i.Next())
- {
- std::string key = i.GetName();
- if( i.GetType() == cmCacheManager::INTERNAL ||
- i.GetType() == cmCacheManager::STATIC ||
- i.GetType() == cmCacheManager::UNINITIALIZED )
- {
- continue;
- }
- if(askedCache.count(key))
- {
- std::string& e = askedCache.find(key)->second;
- if(e != i.GetValue())
- {
- if(this->ShowAdvanced || !i.GetPropertyAsBool("ADVANCED"))
- {
- this->AskUser(key.c_str(), i);
- asked = true;
- }
- }
- }
- else
- {
- if(this->ShowAdvanced || !i.GetPropertyAsBool("ADVANCED"))
- {
- this->AskUser(key.c_str(), i);
- asked = true;
- }
- }
- askedCache[key] = i.GetValue();
- }
- cachem->SaveCache(make.GetHomeOutputDirectory());
- }
- while(asked);
- if(make.Generate() == 0)
- {
- this->ShowMessage("CMake complete, run make to build project.\n");
- return 0;
- }
- return 1;
-}
diff --git a/Source/cmakewizard.h b/Source/cmakewizard.h
deleted file mode 100644
index 0c8dba9..0000000
--- a/Source/cmakewizard.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-
-
-#include "cmMakefile.h"
-
-class cmakewizard
-{
-public:
- cmakewizard();
- virtual ~cmakewizard() {}
- /**
- * Prompt the user to see if they want to see advanced entries.
- */
- virtual bool AskAdvanced();
-
- /**
- * Prompt the User for a new value for key, the answer is put in entry.
- */
- virtual void AskUser(const char* key, cmCacheManager::CacheIterator& iter);
- ///! Show a message to wait for cmake to run.
- virtual void ShowMessage(const char*);
-
- /**
- * Run cmake in wizard mode. This will coninue to ask the user questions
- * until there are no more entries in the cache.
- */
- int RunWizard(std::vector<std::string>const& args);
-
-private:
- bool ShowAdvanced;
-};
-