cmake stable port information

Package: cmake
Version: 2.4.6
Revision: 1001
Source: http://www.cmake.org/files/v2.4/%n-%v.tar.gz
Source-MD5: c99c747ad8e9bfb3bef9cca875a52129
License: BSD
GCC: 4.0
BuildDepends: libncurses5 (>= 5.4-20041023-1006)
Depends: libncurses5-shlibs (>= 5.4-20041023-1006)
PatchScript: <<
# Virtualize explicit '/sw' in sources
perl -pi -e 's,/sw,%p,g' Modules/*cmake Modules/Platform/Darwin.cmake
<<
CompileScript: <<
./bootstrap --prefix=%p --docdir=/share/doc/%n --mandir=/share/man
make
make
<<
InstallScript: <<
make install DESTDIR=%d
<<
DocFiles: Docs/cmake*.el Docs/cmake*.vim ChangeLog.*
Description: Cross-platform Make
DescDetail: <<
CMake is used to control the software compilation process using simple
platform and compiler independent configuration files. CMake generates
native makefiles and workspaces that can be used in the compiler
environment of your choice. CMake is quite sophisticated: it is possible
to support complex environments requiring system configuration,
pre-processor generation, code generation, and template instantiation.
<<
DescPort: <<
Previous versions by Sylvain Cuaz.

The right install_name has to be introduced by hand,
the INSTALLNAME_DIR mechanism which is present in this version
still does not work.
<<
Maintainer: Martin Costabel
Homepage: http://www.cmake.org

cmake stable port .patch

diff -ur cmake-2.0.2/Modules/Platform/Darwin.cmake cmake-2.0.2.corr/Modules/Platform/Darwin.cmake
--- cmake-2.0.2/Modules/Platform/Darwin.cmake Wed Apr 28 19:21:56 2004
+++ cmake-2.0.2.corr/Modules/Platform/Darwin.cmake Mon Jun 28 13:38:54 2004
@@ -37,6 +37,9 @@
IF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
+ELSE("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
+ SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
+ "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -undefined dynamic_lookup -bind_at_load")
ENDIF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")

IF(NOT XCODE)

cmake _unstable_ port information

Package: cmake
Version: 2.6.1
Revision: 2
Source: http://www.cmake.org/files/v2.6/%n-%v.tar.gz
Source-MD5: 6717f4bc3cfcced4172ad98660ce7599
License: BSD
GCC: 4.0
BuildDepends: libncurses5 (>= 5.4-20041023-1006), fink (>= 0.24.12)
Depends: libncurses5-shlibs (>= 5.4-20041023-1006)
PatchFile: %n.patch
PatchFile-MD5: 9b58ffd54086772a8d8f52d2632e97f8
PatchScript: <<
# Virtualize explicit '/sw' in sources
perl -pi -e 's,/sw,%p,g' Modules/*.cmake Modules/Platform/Darwin*.cmake
# don't waste time by searching for frameworks and app bundles first
perl -pi -e 's,FRAMEWORK FIRST,FRAMEWORK LAST,g;s,APPBUNDLE FIRST,APPBUNDLE LAST,g' Modules/Platform/Darwin.cmake
# add compatibility_version and current_version support (from CMake HEAD)
patch -p1 < %{PatchFile}
<<
CompileScript: <<
#!/bin/sh -ev
./bootstrap --prefix=%p --docdir=/share/doc/%n --mandir=/share/man
make
make
<<
InstallScript: <<
make install DESTDIR=%d
<<
DocFiles: Docs/cmake*.el Docs/cmake*.vim ChangeLog.*
Description: Cross-platform Make
DescDetail: <<
CMake is used to control the software compilation process using simple
platform and compiler independent configuration files. CMake generates
native makefiles and workspaces that can be used in the compiler
environment of your choice. CMake is quite sophisticated: it is possible
to support complex environments requiring system configuration,
pre-processor generation, code generation, and template instantiation.
<<
DescPort: <<
Earlier versions by Sylvain Cuaz.
<<
Maintainer: Martin Costabel
Homepage: http://www.cmake.org

cmake _unstable_ port .patch

diff -Nurd cmake-2.6.1/Modules/Platform/Darwin.cmake cmake-2.6.1-new/Modules/Platform/Darwin.cmake
--- cmake-2.6.1/Modules/Platform/Darwin.cmake 2008-08-01 11:34:50.000000000 -0400
+++ cmake-2.6.1-new/Modules/Platform/Darwin.cmake 2008-08-27 11:38:44.000000000 -0400
@@ -27,6 +27,11 @@
SET(CMAKE_MODULE_EXISTS 1)
SET(CMAKE_DL_LIBS "")

+SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG -Wl,-compatibility_version,)
+SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG -Wl,-current_version,)
+SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
+SET(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
+
SET(CMAKE_C_LINK_FLAGS "-headerpad_max_install_names")
SET(CMAKE_CXX_LINK_FLAGS "-headerpad_max_install_names")

@@ -62,7 +67,7 @@
IF(NOT "$ENV{CMAKE_OSX_SYSROOT}" STREQUAL "")
SET(_CMAKE_OSX_SDKS "$ENV{CMAKE_OSX_SYSROOT}")
ENDIF(NOT "$ENV{CMAKE_OSX_SYSROOT}" STREQUAL "")
- SET(CMAKE_OSX_SYSROOT ${_CMAKE_OSX_SDKS} CACHE STRING
+ SET(CMAKE_OSX_SYSROOT ${_CMAKE_OSX_SDKS} CACHE PATH
"isysroot used for universal binary support")
# set _CMAKE_OSX_MACHINE to umame -m
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE)
diff -Nurd cmake-2.6.1/Source/cmGlobalXCodeGenerator.cxx cmake-2.6.1-new/Source/cmGlobalXCodeGenerator.cxx
--- cmake-2.6.1/Source/cmGlobalXCodeGenerator.cxx 2008-08-01 11:34:52.000000000 -0400
+++ cmake-2.6.1-new/Source/cmGlobalXCodeGenerator.cxx 2008-08-27 11:38:44.000000000 -0400
@@ -1455,10 +1455,6 @@

buildSettings->AddAttribute("LIBRARY_STYLE",
this->CreateString("DYNAMIC"));
- buildSettings->AddAttribute("DYLIB_COMPATIBILITY_VERSION",
- this->CreateString("1"));
- buildSettings->AddAttribute("DYLIB_CURRENT_VERSION",
- this->CreateString("1"));
break;
}
case cmTarget::EXECUTABLE:
@@ -1676,6 +1672,38 @@
this->CreateString(
"-Wmost -Wno-four-char-constants"
" -Wno-unknown-pragmas"));
+
+ // Runtime version information.
+ if(target.GetType() == cmTarget::SHARED_LIBRARY)
+ {
+ int major;
+ int minor;
+ int patch;
+
+ // VERSION -> current_version
+ target.GetTargetVersion(false, major, minor, patch);
+ if(major == 0 && minor == 0 && patch == 0)
+ {
+ // Xcode always wants at least 1.0.0
+ major = 1;
+ }
+ cmOStringStream v;
+ v << major << "." << minor << "." << patch;
+ buildSettings->AddAttribute("DYLIB_CURRENT_VERSION",
+ this->CreateString(v.str().c_str()));
+
+ // SOVERSION -> compatibility_version
+ target.GetTargetVersion(true, major, minor, patch);
+ if(major == 0 && minor == 0 && patch == 0)
+ {
+ // Xcode always wants at least 1.0.0
+ major = 1;
+ }
+ cmOStringStream vso;
+ vso << major << "." << minor << "." << patch;
+ buildSettings->AddAttribute("DYLIB_COMPATIBILITY_VERSION",
+ this->CreateString(vso.str().c_str()));
+ }
}

//----------------------------------------------------------------------------
diff -Nurd cmake-2.6.1/Source/cmMakefileLibraryTargetGenerator.cxx cmake-2.6.1-new/Source/cmMakefileLibraryTargetGenerator.cxx
--- cmake-2.6.1/Source/cmMakefileLibraryTargetGenerator.cxx 2008-08-01 11:34:53.000000000 -0400
+++ cmake-2.6.1-new/Source/cmMakefileLibraryTargetGenerator.cxx 2008-08-27 11:38:44.000000000 -0400
@@ -364,6 +364,14 @@
std::string linkFlags;
this->LocalGenerator->AppendFlags(linkFlags, extraFlags);

+ // Add OSX version flags, if any.
+ if(this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
+ this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+ {
+ this->AppendOSXVerFlag(linkFlags, linkLanguage, "COMPATIBILITY", true);
+ this->AppendOSXVerFlag(linkFlags, linkLanguage, "CURRENT", false);
+ }
+
// Construct the name of the library.
std::string targetName;
std::string targetNameSO;
@@ -905,3 +913,37 @@
this->CleanFiles.insert(this->CleanFiles.end(),
libCleanFiles.begin(),libCleanFiles.end());
}
+
+//----------------------------------------------------------------------------
+void
+cmMakefileLibraryTargetGenerator
+::AppendOSXVerFlag(std::string& flags, const char* lang,
+ const char* name, bool so)
+{
+ // Lookup the flag to specify the version.
+ std::string fvar = "CMAKE_";
+ fvar += lang;
+ fvar += "_OSX_";
+ fvar += name;
+ fvar += "_VERSION_FLAG";
+ const char* flag = this->Makefile->GetDefinition(fvar.c_str());
+
+ // Skip if no such flag.
+ if(!flag)
+ {
+ return;
+ }
+
+ // Lookup the target version information.
+ int major;
+ int minor;
+ int patch;
+ this->Target->GetTargetVersion(so, major, minor, patch);
+ if(major > 0 || minor > 0 || patch > 0)
+ {
+ // Append the flag since a non-zero version is specified.
+ cmOStringStream vflag;
+ vflag << flag << major << "." << minor << "." << patch;
+ this->LocalGenerator->AppendFlags(flags, vflag.str().c_str());
+ }
+}
diff -Nurd cmake-2.6.1/Source/cmMakefileLibraryTargetGenerator.h cmake-2.6.1-new/Source/cmMakefileLibraryTargetGenerator.h
--- cmake-2.6.1/Source/cmMakefileLibraryTargetGenerator.h 2008-08-01 11:34:53.000000000 -0400
+++ cmake-2.6.1-new/Source/cmMakefileLibraryTargetGenerator.h 2008-08-27 11:38:44.000000000 -0400
@@ -41,6 +41,9 @@

// Store the computd framework version for OS X Frameworks.
std::string FrameworkVersion;
+
+ void AppendOSXVerFlag(std::string& flags, const char* lang,
+ const char* name, bool so);
};

#endif
diff -Nurd cmake-2.6.1/Source/cmTarget.cxx cmake-2.6.1-new/Source/cmTarget.cxx
--- cmake-2.6.1/Source/cmTarget.cxx 2008-08-01 11:34:53.000000000 -0400
+++ cmake-2.6.1-new/Source/cmTarget.cxx 2008-08-27 11:38:53.000000000 -0400
@@ -1759,19 +1759,32 @@
//----------------------------------------------------------------------------
void cmTarget::GetTargetVersion(int& major, int& minor)
{
+ int patch;
+ this->GetTargetVersion(false, major, minor, patch);
+}
+
+//----------------------------------------------------------------------------
+void cmTarget::GetTargetVersion(bool soversion,
+ int& major, int& minor, int& patch)
+{
// Set the default values.
major = 0;
minor = 0;
+ patch = 0;

- // Look for a VERSION property.
- if(const char* version = this->GetProperty("VERSION"))
+ // Look for a VERSION or SOVERSION property.
+ const char* prop = soversion? "SOVERSION" : "VERSION";
+ if(const char* version = this->GetProperty(prop))
{
// Try to parse the version number and store the results that were
// successfully parsed.
int parsed_major;
int parsed_minor;
- switch(sscanf(version, "%d.%d", &parsed_major, &parsed_minor))
+ int parsed_patch;
+ switch(sscanf(version, "%d.%d.%d",
+ &parsed_major, &parsed_minor, &parsed_patch))
{
+ case 3: patch = parsed_patch; // no break!
case 2: minor = parsed_minor; // no break!
case 1: major = parsed_major; // no break!
default: break;
diff -Nurd cmake-2.6.1/Source/cmTarget.h cmake-2.6.1-new/Source/cmTarget.h
--- cmake-2.6.1/Source/cmTarget.h 2008-08-01 11:34:53.000000000 -0400
+++ cmake-2.6.1-new/Source/cmTarget.h 2008-08-27 11:39:42.000000000 -0400
@@ -269,6 +269,11 @@
not set or cannot be parsed. */
void GetTargetVersion(int& major, int& minor);

+ /** Get the target major, minor, and patch version numbers
+ interpreted from the VERSION or SOVERSION property. Version 0
+ is returned if the property is not set or cannot be parsed. */
+ void GetTargetVersion(bool soversion, int& major, int& minor, int& patch);
+
/**
* Trace through the source files in this target and add al source files
* that they depend on, used by all generators