summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx43
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h7
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx30
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx6
-rw-r--r--Source/cmakemain.cxx56
6 files changed, 86 insertions, 58 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 6d9dbd1..b5d8520 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 20131017)
+set(CMake_VERSION_TWEAK 20131018)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 0b9796d..d476c24 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -21,6 +21,7 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
const char* platformName)
{
this->FindMakeProgramFile = "CMakeVS7FindMake.cmake";
+ this->IntelProjectVersion = 0;
if (!platformName)
{
@@ -29,6 +30,45 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
this->PlatformName = platformName;
}
+cmGlobalVisualStudio7Generator::~cmGlobalVisualStudio7Generator()
+{
+ free(this->IntelProjectVersion);
+}
+
+// Package GUID of Intel Visual Fortran plugin to VS IDE
+#define CM_INTEL_PLUGIN_GUID "{B68A201D-CB9B-47AF-A52F-7EEC72E217E4}"
+
+const char* cmGlobalVisualStudio7Generator::GetIntelProjectVersion()
+{
+ if(!this->IntelProjectVersion)
+ {
+ // Compute the version of the Intel plugin to the VS IDE.
+ // If the key does not exist then use a default guess.
+ std::string intelVersion;
+ std::string vskey = this->GetRegistryBase();
+ vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion";
+ cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion,
+ cmSystemTools::KeyWOW64_32);
+ unsigned int intelVersionNumber = ~0u;
+ sscanf(intelVersion.c_str(), "%u", &intelVersionNumber);
+ if(intelVersionNumber >= 11)
+ {
+ // Default to latest known project file version.
+ intelVersion = "11.0";
+ }
+ else if(intelVersionNumber == 10)
+ {
+ // Version 10.x actually uses 9.10 in project files!
+ intelVersion = "9.10";
+ }
+ else
+ {
+ // Version <= 9: use ProductVersion from registry.
+ }
+ this->IntelProjectVersion = strdup(intelVersion.c_str());
+ }
+ return this->IntelProjectVersion;
+}
void cmGlobalVisualStudio7Generator
::EnableLanguage(std::vector<std::string>const & lang,
@@ -36,7 +76,6 @@ void cmGlobalVisualStudio7Generator
{
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
- mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort");
this->AddPlatformDefinitions(mf);
if(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
{
@@ -156,6 +195,8 @@ void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf)
{
cmGlobalVisualStudioGenerator::AddPlatformDefinitions(mf);
mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName());
+ mf->AddDefinition("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION",
+ this->GetIntelProjectVersion());
}
void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf)
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 4d22cff..66dc443 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -27,6 +27,8 @@ class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
{
public:
cmGlobalVisualStudio7Generator(const char* platformName = NULL);
+ ~cmGlobalVisualStudio7Generator();
+
static cmGlobalGeneratorFactory* NewFactory() {
return new cmGlobalGeneratorSimpleFactory
<cmGlobalVisualStudio7Generator>(); }
@@ -101,6 +103,8 @@ public:
LinkLibraryDependencies and link to .sln dependencies. */
virtual bool NeedLinkLibraryDependencies(cmTarget&) { return false; }
+ const char* GetIntelProjectVersion();
+
protected:
virtual const char* GetIDEVersion() { return "7.0"; }
@@ -159,6 +163,9 @@ protected:
// There is one SLN file per project.
std::string CurrentProject;
std::string PlatformName;
+
+private:
+ char* IntelProjectVersion;
};
#define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 64de448..f21abc3 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -27,9 +27,6 @@
#include <ctype.h> // for isspace
-// Package GUID of Intel Visual Fortran plugin to VS IDE
-#define CM_INTEL_PLUGIN_GUID "{B68A201D-CB9B-47AF-A52F-7EEC72E217E4}"
-
static bool cmLVS6G_IsFAT(const char* dir);
class cmLocalVisualStudio7GeneratorInternals
@@ -1961,35 +1958,10 @@ cmLocalVisualStudio7Generator
cmGlobalVisualStudio7Generator* gg =
static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
-
- // Compute the version of the Intel plugin to the VS IDE.
- // If the key does not exist then use a default guess.
- std::string intelVersion;
- std::string vskey = gg->GetRegistryBase();
- vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion";
- cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion,
- cmSystemTools::KeyWOW64_32);
- unsigned int intelVersionNumber = ~0u;
- sscanf(intelVersion.c_str(), "%u", &intelVersionNumber);
- if(intelVersionNumber >= 11)
- {
- // Default to latest known project file version.
- intelVersion = "11.0";
- }
- else if(intelVersionNumber == 10)
- {
- // Version 10.x actually uses 9.10 in project files!
- intelVersion = "9.10";
- }
- else
- {
- // Version <= 9: use ProductVersion from registry.
- }
-
fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
<< "<VisualStudioProject\n"
<< "\tProjectCreator=\"Intel Fortran\"\n"
- << "\tVersion=\"" << intelVersion << "\"\n";
+ << "\tVersion=\"" << gg->GetIntelProjectVersion() << "\"\n";
const char* keyword = target.GetProperty("VS_KEYWORD");
if(!keyword)
{
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 22f6a03..0707c62 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -151,7 +151,8 @@ bool cmTargetLinkLibrariesCommand
else if(args[i] == "LINK_PUBLIC")
{
if(i != 1
- && this->CurrentProcessingState != ProcessingPlainPrivateInterface)
+ && this->CurrentProcessingState != ProcessingPlainPrivateInterface
+ && this->CurrentProcessingState != ProcessingPlainPublicInterface)
{
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
@@ -181,7 +182,8 @@ bool cmTargetLinkLibrariesCommand
else if(args[i] == "LINK_PRIVATE")
{
if(i != 1
- && this->CurrentProcessingState != ProcessingPlainPublicInterface)
+ && this->CurrentProcessingState != ProcessingPlainPublicInterface
+ && this->CurrentProcessingState != ProcessingPlainPrivateInterface)
{
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 5b534f0..5113a75 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -84,6 +84,17 @@ static const char * cmDocumentationOptions[][2] =
#endif
+static int do_command(int ac, char** av)
+{
+ std::vector<std::string> args;
+ args.push_back(av[0]);
+ for(int i = 2; i < ac; ++i)
+ {
+ args.push_back(av[i]);
+ }
+ return cmcmd::ExecuteCMakeCommand(args);
+}
+
int do_cmake(int ac, char** av);
static int do_build(int ac, char** av);
@@ -157,9 +168,16 @@ int main(int ac, char** av)
{
cmSystemTools::EnableMSVCDebugHook();
cmSystemTools::FindExecutableDirectory(av[0]);
- if(ac > 1 && strcmp(av[1], "--build") == 0)
+ if(ac > 1)
{
- return do_build(ac, av);
+ if(strcmp(av[1], "--build") == 0)
+ {
+ return do_build(ac, av);
+ }
+ else if(strcmp(av[1], "-E") == 0)
+ {
+ return do_command(ac, av);
+ }
}
int ret = do_cmake(ac, av);
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -180,7 +198,7 @@ int do_cmake(int ac, char** av)
#ifdef CMAKE_BUILD_WITH_CMAKE
cmDocumentation doc;
doc.addCMakeStandardDocSections();
- if(doc.CheckOptions(ac, av, "-E"))
+ if(doc.CheckOptions(ac, av))
{
// Construct and print requested documentation.
cmake hcm;
@@ -220,7 +238,6 @@ int do_cmake(int ac, char** av)
bool wiz = false;
bool sysinfo = false;
- bool command = false;
bool list_cached = false;
bool list_all_cached = false;
bool list_help = false;
@@ -229,43 +246,37 @@ int do_cmake(int ac, char** av)
std::vector<std::string> args;
for(int i =0; i < ac; ++i)
{
- if(!command && strcmp(av[i], "-i") == 0)
+ if(strcmp(av[i], "-i") == 0)
{
wiz = true;
}
- else if(!command && strcmp(av[i], "--system-information") == 0)
+ else if(strcmp(av[i], "--system-information") == 0)
{
sysinfo = true;
}
- // if command has already been set, then
- // do not eat the -E
- else if (!command && strcmp(av[i], "-E") == 0)
- {
- command = true;
- }
- else if (!command && strcmp(av[i], "-N") == 0)
+ else if (strcmp(av[i], "-N") == 0)
{
view_only = true;
}
- else if (!command && strcmp(av[i], "-L") == 0)
+ else if (strcmp(av[i], "-L") == 0)
{
list_cached = true;
}
- else if (!command && strcmp(av[i], "-LA") == 0)
+ else if (strcmp(av[i], "-LA") == 0)
{
list_all_cached = true;
}
- else if (!command && strcmp(av[i], "-LH") == 0)
+ else if (strcmp(av[i], "-LH") == 0)
{
list_cached = true;
list_help = true;
}
- else if (!command && strcmp(av[i], "-LAH") == 0)
+ else if (strcmp(av[i], "-LAH") == 0)
{
list_all_cached = true;
list_help = true;
}
- else if (!command && strncmp(av[i], "-P", strlen("-P")) == 0)
+ else if (strncmp(av[i], "-P", strlen("-P")) == 0)
{
if ( i == ac -1 )
{
@@ -279,8 +290,8 @@ int do_cmake(int ac, char** av)
args.push_back(av[i]);
}
}
- else if (!command && strncmp(av[i], "--find-package",
- strlen("--find-package")) == 0)
+ else if (strncmp(av[i], "--find-package",
+ strlen("--find-package")) == 0)
{
workingMode = cmake::FIND_PACKAGE_MODE;
args.push_back(av[i]);
@@ -290,11 +301,6 @@ int do_cmake(int ac, char** av)
args.push_back(av[i]);
}
}
- if(command)
- {
- int ret = cmcmd::ExecuteCMakeCommand(args);
- return ret;
- }
if (wiz)
{
cmakewizard wizard;