diff options
author | Brad King <brad.king@kitware.com> | 2004-06-18 19:01:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-06-18 19:01:54 (GMT) |
commit | 491ef99291bb7df70acffe58d8a9d62c14df9ccf (patch) | |
tree | 72de492d9630fe937d6e5ebf0c11ace61ca34ac6 /Source | |
parent | 0fec8c8ce9ebcd04750418289fbdf97e25764b6e (diff) | |
download | CMake-491ef99291bb7df70acffe58d8a9d62c14df9ccf.zip CMake-491ef99291bb7df70acffe58d8a9d62c14df9ccf.tar.gz CMake-491ef99291bb7df70acffe58d8a9d62c14df9ccf.tar.bz2 |
BUG: Added special hack for VTK 4.0-4.4 to re-enable automatic addition of current source directory to -I path.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 29762b7..6e6725e 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -2497,6 +2497,7 @@ void cmLocalUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout) // CMake versions below 2.0 would add the source tree to the -I path // automatically. Preserve compatibility. + bool includeSourceDir = false; const char* versionValue = m_Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); if(versionValue) @@ -2505,11 +2506,32 @@ void cmLocalUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout) int minor = 0; if(sscanf(versionValue, "%d.%d", &major, &minor) == 2 && major < 2) { - fout << "-I" - << this->ConvertToOutputForExisting(m_Makefile->GetStartDirectory()) - << " "; + includeSourceDir = true; } } + const char* vtkSourceDir = + m_Makefile->GetDefinition("VTK_SOURCE_DIR"); + if(vtkSourceDir) + { + // Special hack for VTK 4.0 - 4.4. + const char* vtk_major = m_Makefile->GetDefinition("VTK_MAJOR_VERSION"); + const char* vtk_minor = m_Makefile->GetDefinition("VTK_MINOR_VERSION"); + vtk_major = vtk_major? vtk_major : "4"; + vtk_minor = vtk_minor? vtk_minor : "4"; + int major = 0; + int minor = 0; + if(sscanf(vtk_major, "%d", &major) && sscanf(vtk_minor, "%d", &minor) && + major == 4 && minor <= 4) + { + includeSourceDir = true; + } + } + if(includeSourceDir) + { + fout << "-I" + << this->ConvertToOutputForExisting(m_Makefile->GetStartDirectory()) + << " "; + } implicitIncludes["/usr/include"] = "/usr/include"; if(m_Makefile->GetDefinition("CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES")) |