Commit 558a57a7 authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge in policy 0008 and cdash direct submission

parent e23aeb39
......@@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 6)
SET(CMake_VERSION_PATCH 1)
SET(CMake_VERSION_RC 13)
SET(CMake_VERSION_RC 14)
# CVS versions are odd, if this is an odd minor version
# then set the CMake_VERSION_DATE variable
IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
......
SET (CTEST_PROJECT_NAME "CMake")
SET (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
MACRO(SET_IF_NOT_SET var val)
IF(NOT DEFINED "${var}")
SET("${var}" "${val}")
ENDIF(NOT DEFINED "${var}")
ENDMACRO(SET_IF_NOT_SET)
SET_IF_NOT_SET(CTEST_DROP_METHOD "http")
IF(CTEST_DROP_METHOD STREQUAL "http")
SET (CTEST_DROP_SITE "public.kitware.com")
SET (CTEST_DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi")
SET (CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/cgi-bin/Submit-CMake-TestingResults.cgi")
ENDIF(CTEST_DROP_METHOD STREQUAL "http")
IF(CTEST_DROP_METHOD STREQUAL "xmlrpc")
SET (CTEST_DROP_SITE "http://www.na-mic.org:8081")
SET (CTEST_DROP_LOCATION "CMake")
SET (CTEST_TRIGGER_SITE "not used")
SET (COMPRESS_SUBMISSION ON)
ENDIF(CTEST_DROP_METHOD STREQUAL "xmlrpc")
set(CTEST_PROJECT_NAME "CMake")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
Changes in CMake 2.6.1 RC 14
- Change dashboard submission to go directly to CDash.
- Add policy CMP0008- Full-path libraries must be a valid library file name
Changes in CMake 2.6.1 RC 12
- More find locations for FindJNI.
- Fix bug with source files ending in .l and .l.cpp, causing cmake
......
# Dashboard is opened for submissions for a 24 hour period starting at
# the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
SET (NIGHTLY_START_TIME "21:00:00 EDT")
# Dart server to submit results (used by client)
IF(NOT DROP_METHOD)
SET(DROP_METHOD http)
ENDIF(NOT DROP_METHOD)
IF(DROP_METHOD MATCHES http)
SET (DROP_SITE "public.kitware.com")
SET (DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi")
ELSE(DROP_METHOD MATCHES http)
IF(DROP_METHOD MATCHES xmlrpc)
SET (DROP_SITE "http://www.na-mic.org:8081")
SET (DROP_LOCATION "CMake")
SET (COMPRESS_SUBMISSION ON)
ELSE(DROP_METHOD MATCHES xmlrpc)
SET (DROP_SITE "public.kitware.com")
SET (DROP_LOCATION "/incoming")
SET (DROP_SITE_USER "ftpuser")
SET (DROP_SITE_PASSWORD "public")
ENDIF(DROP_METHOD MATCHES xmlrpc)
ENDIF(DROP_METHOD MATCHES http)
SET (TRIGGER_SITE
"http://${DROP_SITE}/cgi-bin/Submit-CMake-TestingResults.cgi")
# Project Home Page
SET (PROJECT_URL "http://www.cmake.org")
# Dart server configuration
SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/cmake-rollup-dashboard.sh")
SET (CVS_WEB_URL "http://${DROP_SITE}/cgi-bin/viewcvs.cgi/")
SET (CVS_WEB_CVSROOT "CMake")
OPTION(BUILD_DOXYGEN "Build source documentation using doxygen" "Off")
SET (DOXYGEN_CONFIG "${PROJECT_BINARY_DIR}/doxygen.config" )
MARK_AS_ADVANCED(BUILD_DOXYGEN)
SET (USE_DOXYGEN "On")
SET (DOXYGEN_URL "${PROJECT_URL}/doc/nightly/html/" )
SET (USE_GNATS "On")
SET (GNATS_WEB_URL "${PROJECT_URL}/Bug/query.php?projects=2&status%5B%5D=1&status%5B%5D=2&status%5B%5D=3&status%5B%5D=4&status%5B%5D=6&op=doquery")
# Continuous email delivery variables
SET (CONTINUOUS_FROM "cmake-dashboard@public.kitware.com")
SET (SMTP_MAILHOST "public.kitware.com")
SET (CONTINUOUS_MONITOR_LIST "cmake-dashboard@public.kitware.com")
SET (CONTINUOUS_BASE_URL "${PROJECT_URL}/Testing")
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_TEST_FAILURES ON)
SET (DELIVER_BROKEN_BUILD_EMAIL "Continuous Nightly")
SET (EMAIL_FROM "cmake-dashboard@public.kitware.com")
SET (DARTBOARD_BASE_URL "${PROJECT_URL}/Testing")
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_CONFIGURE_FAILURES 1)
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_BUILD_ERRORS 1)
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_BUILD_WARNINGS 1)
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_TEST_NOT_RUNS 1)
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_TEST_FAILURES 1)
set(CTEST_PROJECT_NAME "CMake")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
......@@ -637,7 +637,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, cmTarget* tgt)
else
{
// This is a library or option specified by the user.
this->AddUserItem(item);
this->AddUserItem(item, true);
}
}
}
......@@ -1042,6 +1042,20 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item)
return;
}
// Full path libraries should specify a valid library file name.
// See documentation of CMP0008.
if(this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
(strstr(this->GlobalGenerator->GetName(), "Visual Studio") ||
strstr(this->GlobalGenerator->GetName(), "Xcode")))
{
std::string file = cmSystemTools::GetFilenameName(item);
if(!this->ExtractAnyLibraryName.find(file.c_str()))
{
this->HandleBadFullItem(item, file);
return;
}
}
// This is called to handle a link item that is a full path.
// If the target is not a static library make sure the link type is
// shared. This is because dynamic-mode linking can handle both
......@@ -1078,47 +1092,8 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item)
this->Items.push_back(Item(this->LibLinkFileFlag, false));
}
// Full path libraries should have an extension. CMake 2.4 would
// add the extension after splitting the file off of the directory.
// Some existing projects depended on this to build correctly
// because they left off the extension of an otherwise full-path
// library. This worked with CMake 2.4 but only for VS IDE builds
// because the file-level dependency added to the Makefile would not
// be found. Nevertheless, some projects have this mistake but work
// because they build only with the VS IDE. We need to support them
// here by adding the missing extension.
std::string final_item = item;
if(strstr(this->GlobalGenerator->GetName(), "Visual Studio") &&
this->Makefile->NeedBackwardsCompatibility(2,4) &&
!cmSystemTools::ComparePath(
cmSystemTools::GetFilenameLastExtension(item).c_str(),
this->LibLinkSuffix.c_str()))
{
// Issue the warning at most once.
std::string wid = "VSIDE-LINK-EXT-";
wid += item;
if(!this->Target->GetPropertyAsBool(wid.c_str()))
{
this->Target->SetProperty(wid.c_str(), "1");
cmOStringStream w;
w << "Target \"" << this->Target->GetName() << "\" links to "
<< "full-path item\n"
<< " " << item << "\n"
<< "which does not have the proper link extension \""
<< this->LibLinkSuffix << "\". "
<< "CMake is adding the missing extension because compatibility "
<< "with CMake 2.4 is currently enabled and this case worked "
<< "accidentally in that version. "
<< "The link extension should be added by the project developer.";
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
// Add the missing extension.
final_item += this->LibLinkSuffix;
}
// Now add the full path to the library.
this->Items.push_back(Item(final_item, true));
this->Items.push_back(Item(item, true));
}
//----------------------------------------------------------------------------
......@@ -1155,12 +1130,13 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item)
// directory then just report the file name without the directory
// portion. This will allow the system linker to locate the proper
// library for the architecture at link time.
this->AddUserItem(file);
this->AddUserItem(file, false);
return true;
}
//----------------------------------------------------------------------------
void cmComputeLinkInformation::AddUserItem(std::string const& item)
void cmComputeLinkInformation::AddUserItem(std::string const& item,
bool pathNotKnown)
{
// This is called to handle a link item that does not match a CMake
// target and is not a full path. We check here if it looks like a
......@@ -1250,7 +1226,10 @@ void cmComputeLinkInformation::AddUserItem(std::string const& item)
else
{
// This is a name specified by the user.
this->OldUserFlagItems.push_back(item);
if(pathNotKnown)
{
this->OldUserFlagItems.push_back(item);
}
// We must ask the linker to search for a library with this name.
// Restore the target link type since this item does not specify
......@@ -1373,12 +1352,65 @@ void cmComputeLinkInformation::AddSharedLibNoSOName(std::string const& item)
// runtime the dynamic linker will search for the library using the
// path instead of just the name.
std::string file = cmSystemTools::GetFilenameName(item);
this->AddUserItem(file);
this->AddUserItem(file, false);
// Make sure the link directory ordering will find the library.
this->OrderLinkerSearchPath->AddLinkLibrary(item);
}
//----------------------------------------------------------------------------
void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
std::string const& file)
{
// Tell the linker to search for the item and provide the proper
// path for it. Do not contribute to any CMP0003 warning (do not
// put in OldLinkDirItems or OldUserFlagItems).
this->AddUserItem(file, false);
this->OrderLinkerSearchPath->AddLinkLibrary(item);
// Produce any needed message.
switch(this->Target->GetPolicyStatusCMP0008())
{
case cmPolicies::WARN:
{
// Print the warning at most once for this item.
std::string wid = "CMP0008-WARNING-GIVEN-";
wid += item;
if(!this->CMakeInstance->GetPropertyAsBool(wid.c_str()))
{
this->CMakeInstance->SetProperty(wid.c_str(), "1");
cmOStringStream w;
w << (this->Makefile->GetPolicies()
->GetPolicyWarning(cmPolicies::CMP0008)) << "\n"
<< "Target \"" << this->Target->GetName() << "\" links to item\n"
<< " " << item << "\n"
<< "which is a full-path but not a valid library file name.";
this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace());
}
}
case cmPolicies::OLD:
// OLD behavior does not warn.
break;
case cmPolicies::NEW:
// NEW behavior will not get here.
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
{
cmOStringStream e;
e << (this->Makefile->GetPolicies()->
GetRequiredPolicyError(cmPolicies::CMP0008)) << "\n"
<< "Target \"" << this->Target->GetName() << "\" links to item\n"
<< " " << item << "\n"
<< "which is a full-path but not a valid library file name.";
this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
this->Target->GetBacktrace());
}
break;
}
}
//----------------------------------------------------------------------------
bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
{
......
......@@ -139,12 +139,13 @@ private:
void AddTargetItem(std::string const& item, cmTarget* target);
void AddFullItem(std::string const& item);
bool CheckImplicitDirItem(std::string const& item);
void AddUserItem(std::string const& item);
void AddUserItem(std::string const& item, bool pathNotKnown);
void AddDirectoryItem(std::string const& item);
void AddFrameworkItem(std::string const& item);
void DropDirectoryItem(std::string const& item);
bool CheckSharedLibNoSOName(std::string const& item);
void AddSharedLibNoSOName(std::string const& item);
void HandleBadFullItem(std::string const& item, std::string const& file);
// Framework info.
void ComputeFrameworkInfo();
......
......@@ -281,6 +281,32 @@ cmPolicies::cmPolicies()
"The NEW behavior for this policy is to correctly count empty "
"elements in a list. ",
2,6,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0008, "CMP0008",
"Libraries linked by full-path must have a valid library file name.",
"In CMake 2.4 and below it is possible to write code like\n"
" target_link_libraries(myexe /full/path/to/somelib)\n"
"where \"somelib\" is supposed to be a valid library file name "
"such as \"libsomelib.a\" or \"somelib.lib\". "
"For Makefile generators this produces an error at build time "
"because the dependency on the full path cannot be found. "
"For VS IDE and Xcode generators this used to work by accident because "
"CMake would always split off the library directory and ask the "
"linker to search for the library by name (-lsomelib or somelib.lib). "
"Despite the failure with Makefiles, some projects have code like this "
"and build only with VS and/or Xcode. "
"This version of CMake prefers to pass the full path directly to the "
"native build tool, which will fail in this case because it does "
"not name a valid library file."
"\n"
"This policy determines what to do with full paths that do not appear "
"to name a valid library file. "
"The OLD behavior for this policy is to split the library name from the "
"path and ask the linker to search for it. "
"The NEW behavior for this policy is to trust the given path and "
"pass it directly to the native build tool unchanged.",
2,6,1, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
......
......@@ -48,6 +48,7 @@ public:
CMP0005, // Definition value escaping
CMP0006, // BUNDLE install rules needed for MACOSX_BUNDLE targets
CMP0007, // list command handling of empty elements
CMP0008, // Full-path libraries must be a valid library file name
// Always the last entry. Useful mostly to avoid adding a comma
// the last policy when adding a new one.
......
......@@ -55,6 +55,7 @@ cmTarget::cmTarget()
this->Makefile = 0;
this->PolicyStatusCMP0003 = cmPolicies::WARN;
this->PolicyStatusCMP0004 = cmPolicies::WARN;
this->PolicyStatusCMP0008 = cmPolicies::WARN;
this->LinkLibrariesAnalyzed = false;
this->HaveInstallRule = false;
this->DLLPlatform = false;
......@@ -768,6 +769,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->Makefile->GetPolicyStatus(cmPolicies::CMP0003);
this->PolicyStatusCMP0004 =
this->Makefile->GetPolicyStatus(cmPolicies::CMP0004);
this->PolicyStatusCMP0008 =
this->Makefile->GetPolicyStatus(cmPolicies::CMP0008);
}
//----------------------------------------------------------------------------
......
......@@ -114,6 +114,10 @@ public:
cmPolicies::PolicyStatus GetPolicyStatusCMP0004() const
{ return this->PolicyStatusCMP0004; }
/** Get the status of policy CMP0008 when the target was created. */
cmPolicies::PolicyStatus GetPolicyStatusCMP0008() const
{ return this->PolicyStatusCMP0008; }
/**
* Get the list of the custom commands for this target
*/
......@@ -547,6 +551,7 @@ private:
// Policy status recorded when target was created.
cmPolicies::PolicyStatus PolicyStatusCMP0003;
cmPolicies::PolicyStatus PolicyStatusCMP0004;
cmPolicies::PolicyStatus PolicyStatusCMP0008;
// Internal representation details.
friend class cmTargetInternals;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment