Commit 224dde90 authored by Brad King's avatar Brad King

CMake 2.8.1-rc2

parent b6e42e3a
......@@ -329,7 +329,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 1)
SET(CMake_VERSION_RC 1)
SET(CMake_VERSION_RC 2)
# We use odd minor numbers for development versions.
# Use a date for the development patch level.
......
......@@ -16,7 +16,8 @@ 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)
set(CTEST_CDASH_VERSION "1.4")
set(CTEST_CDASH_VERSION "1.6")
set(CTEST_CDASH_QUERY_VERSION TRUE)
# use old trigger stuff so that cmake 2.4 and below will not
# get errors on trigger
......
Changes in CMake 2.8.1 RC 2
- CPack: Avoid deleting long PATH values with NSIS (#10257)
- CTest: Fix and test cost-based test scheduler
- CTest: Fix and test git updates for case of out-dated index
- CTest: Fix regression caused by fix for (#2336) in rc1
- CTest: Setup command-line dashboard support with Git
- FindCUDA: Improve docs, use -rpath on Apple, fix dependency scanning
- Fix OS X deployment-target and sysroot defaults (#9959,#9898,#10155)
- Recognize the Compaq Fortran compiler
Changes in CMake 2.8.1 RC 1
- Add "NMake Makefiles JOM" generator
- Add PathScale compiler support
......
......@@ -38,6 +38,7 @@ IF(CMAKE_C_COMPILER_ABI)
ENDIF(CMAKE_C_COMPILER_ABI)
SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
......@@ -39,6 +39,7 @@ IF(CMAKE_CXX_COMPILER_ABI)
ENDIF(CMAKE_CXX_COMPILER_ABI)
SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
......@@ -42,6 +42,11 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
ENDFOREACH(flags)
# If the compiler is still unknown, try to query its vendor.
IF(NOT CMAKE_${lang}_COMPILER_ID)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
ENDIF()
# if the format is unknown after all files have been checked, put "Unknown" in the cache
IF(NOT CMAKE_EXECUTABLE_FORMAT)
SET(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
......@@ -245,3 +250,38 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
PARENT_SCOPE)
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
#-----------------------------------------------------------------------------
# Function to query the compiler vendor.
# This uses a table with entries of the form
# list(APPEND CMAKE_${lang}_COMPILER_ID_VENDORS ${vendor})
# set(CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor} -some-vendor-flag)
# set(CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor} "Some Vendor Output")
# We try running the compiler with the flag for each vendor and
# matching its regular expression in the output.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
EXECUTE_PROCESS(
COMMAND ${CMAKE_${lang}_COMPILER}
${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
${flags}
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
OUTPUT_VARIABLE output ERROR_VARIABLE output
RESULT_VARIABLE result
)
IF("${output}" MATCHES "${regex}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"matched \"${regex}\":\n${output}")
SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
BREAK()
ELSE()
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"did not match \"${regex}\":\n${output}")
ENDIF()
ENDFOREACH()
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
......@@ -162,6 +162,11 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
"-fpp"
)
# Table of per-vendor compiler id flags with expected output.
LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
# Try to identify the compiler.
SET(CMAKE_Fortran_COMPILER_ID)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
......
......@@ -126,52 +126,39 @@ IF(BUILD_TESTING)
FIND_PROGRAM(SVNCOMMAND svn)
FIND_PROGRAM(BZRCOMMAND bzr)
FIND_PROGRAM(HGCOMMAND hg)
FIND_PROGRAM(GITCOMMAND git)
IF(NOT UPDATE_TYPE)
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
SET(UPDATE_TYPE cvs)
ELSE(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
SET(UPDATE_TYPE svn)
ELSE(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
SET(UPDATE_TYPE bzr)
ELSE(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
SET(UPDATE_TYPE hg)
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
ENDIF(NOT UPDATE_TYPE)
IF(NOT UPDATE_TYPE)
IF(NOT __CTEST_UPDATE_TYPE_COMPLAINED)
SET(__CTEST_UPDATE_TYPE_COMPLAINED 1 CACHE INTERNAL "Already complained about update type.")
MESSAGE(STATUS "CTest cannot determine repository type. Please set UPDATE_TYPE to 'cvs' or 'svn'. CTest update will not work.")
ENDIF(NOT __CTEST_UPDATE_TYPE_COMPLAINED)
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
SET(UPDATE_TYPE svn)
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
SET(UPDATE_TYPE bzr)
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
SET(UPDATE_TYPE hg)
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
SET(UPDATE_TYPE git)
ENDIF()
ENDIF(NOT UPDATE_TYPE)
STRING(TOLOWER "${UPDATE_TYPE}" _update_type)
IF("${_update_type}" STREQUAL "cvs")
SET(UPDATE_COMMAND "${CVSCOMMAND}")
SET(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
ELSE("${_update_type}" STREQUAL "cvs")
IF("${_update_type}" STREQUAL "svn")
SET(UPDATE_COMMAND "${SVNCOMMAND}")
SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
ELSE("${_update_type}" STREQUAL "svn")
IF("${_update_type}" STREQUAL "bzr")
SET(UPDATE_COMMAND "${BZRCOMMAND}")
SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
ELSE("${_update_type}" STREQUAL "bzr")
IF("${_update_type}" STREQUAL "hg")
SET(UPDATE_COMMAND "${HGCOMMAND}")
SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
ENDIF("${_update_type}" STREQUAL "hg")
ENDIF("${_update_type}" STREQUAL "bzr")
ENDIF("${_update_type}" STREQUAL "svn")
ENDIF("${_update_type}" STREQUAL "cvs")
ELSEIF("${_update_type}" STREQUAL "svn")
SET(UPDATE_COMMAND "${SVNCOMMAND}")
SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
ELSEIF("${_update_type}" STREQUAL "bzr")
SET(UPDATE_COMMAND "${BZRCOMMAND}")
SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
ELSEIF("${_update_type}" STREQUAL "hg")
SET(UPDATE_COMMAND "${HGCOMMAND}")
SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
ELSEIF("${_update_type}" STREQUAL "git")
SET(UPDATE_COMMAND "${GITCOMMAND}")
SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
ENDIF()
SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
......@@ -264,6 +251,7 @@ IF(BUILD_TESTING)
SVNCOMMAND
BZRCOMMAND
HGCOMMAND
GITCOMMAND
CVS_UPDATE_OPTIONS
SVN_UPDATE_OPTIONS
BZR_UPDATE_OPTIONS
......
......@@ -16,6 +16,7 @@ BuildName: @BUILDNAME@
# Submission information
IsCDash: @CTEST_DROP_SITE_CDASH@
CDashVersion: @CTEST_CDASH_VERSION@
QueryCDashVersion: @CTEST_CDASH_QUERY_VERSION@
DropSite: @DROP_SITE@
DropLocation: @DROP_LOCATION@
DropSiteUser: @DROP_SITE_USER@
......
......@@ -106,9 +106,12 @@
# specified. All of the non CUDA C files are compiled using the standard
# build rules specified by CMAKE and the cuda files are compiled to object
# files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is
# added automatically to include_directories(). Standard CMake target calls
# can be used on the target after calling this macro
# (e.g. set_target_properties and target_link_libraries).
# added automatically to include_directories(). Some standard CMake target
# calls can be used on the target after calling this macro
# (e.g. set_target_properties and target_link_libraries), but setting
# properties that adjust compilation flags will not affect code compiled by
# nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
# CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
#
# CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
# [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
......@@ -543,6 +546,14 @@ endmacro()
# CUDA_LIBRARIES
find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library")
set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
if(APPLE)
# We need to add the path to cudart to the linker using rpath, since the
# library name for the cuda libraries is prepended with @rpath.
get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
if(_cuda_path_to_cudart)
list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
endif()
endif()
# 1.1 toolkit on linux doesn't appear to have a separate library on
# some platforms.
......
......@@ -164,11 +164,18 @@ if(CUDA_VERSION VERSION_LESS "3.0")
cmake_policy(POP)
endif()
# nvcc doesn't define __CUDACC__ for some reason when generating dependency files. This
# can cause incorrect dependencies when #including files based on this macro which is
# defined in the generating passes of nvcc invokation. We will go ahead and manually
# define this for now until a future version fixes this bug.
set(CUDACC_DEFINE -D__CUDACC__)
# Generate the dependency file
cuda_execute_process(
"Generating dependency file: ${NVCC_generated_dependency_file}"
COMMAND "${CUDA_NVCC_EXECUTABLE}"
-M
${CUDACC_DEFINE}
"${source_file}"
-o "${NVCC_generated_dependency_file}"
${CCBIN}
......
......@@ -213,6 +213,15 @@ Function AddToPath
IfFileExists "$0\*.*" "" AddToPath_done
ReadEnvStr $1 PATH
; if the path is too long for a NSIS variable NSIS will return a 0
; length string. If we find that, then warn and skip any path
; modification as it will trash the existing path.
StrLen $2 $1
IntCmp $2 0 CheckPathLength_ShowPathWarning CheckPathLength_Done CheckPathLength_Done
CheckPathLength_ShowPathWarning:
Messagebox MB_OK|MB_ICONEXCLAMATION "Warning! PATH too long installer unable to modify PATH!"
Goto AddToPath_done
CheckPathLength_Done:
Push "$1;"
Push "$0;"
Call StrStr
......
include(Platform/Darwin-GNU)
__darwin_compiler_gnu(C)
cmake_gnu_has_isysroot(C)
cmake_gnu_set_osx_deployment_target_flag(C)
include(Platform/Darwin-GNU)
__darwin_compiler_gnu(CXX)
cmake_gnu_has_isysroot(CXX)
cmake_gnu_set_osx_deployment_target_flag(CXX)
......@@ -42,3 +42,23 @@ macro(cmake_gnu_has_isysroot lang)
endif()
endif()
endmacro()
macro(cmake_gnu_set_osx_deployment_target_flag lang)
if(NOT DEFINED CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG)
set(_doc "${lang} compiler supports OSX deployment target flag")
message(STATUS "Checking whether ${_doc}")
execute_process(
COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help"
OUTPUT_VARIABLE _gcc_help
ERROR_VARIABLE _gcc_help
)
if("${_gcc_help}" MATCHES "macosx-version-min")
message(STATUS "Checking whether ${_doc} - yes")
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=")
else()
message(STATUS "Checking whether ${_doc} - no")
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
endif()
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "SET(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")")
endif()
endmacro()
SET(APPLE 1)
# Darwin versions:
# 6.x == Mac OSX 10.2
# 7.x == Mac OSX 10.3
# 8.x == Mac OSX 10.4
# 9.x == Mac OSX 10.5
# 6.x == Mac OSX 10.2 (Jaguar)
# 7.x == Mac OSX 10.3 (Panther)
# 8.x == Mac OSX 10.4 (Tiger)
# 9.x == Mac OSX 10.5 (Leopard)
# 10.x == Mac OSX 10.6 (Snow Leopard)
STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}")
STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}")
......@@ -72,68 +73,73 @@ IF(NOT _CMAKE_OSX_SDKS)
ENDIF(CMAKE_XCODE_SELECT)
ENDIF(NOT _CMAKE_OSX_SDKS)
# Set CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT to the current version of OS X
EXECUTE_PROCESS(COMMAND sw_vers -productVersion OUTPUT_VARIABLE CURRENT_OSX_VERSION)
STRING(REGEX REPLACE "^.*(10)\\.([0-9]+)\\.*([0-9]+)*.*$" "\\1.\\2"
CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT ${CURRENT_OSX_VERSION})
EXECUTE_PROCESS(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE CURRENT_OSX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Set CMAKE_OSX_SYSROOT_DEFAULT based on CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT.
# This next block assumes that Apple will start being consistent with
# its SDK names from here on out...
IF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT GREATER "10.4")
SET(CMAKE_OSX_SYSROOT_DEFAULT
"${OSX_DEVELOPER_ROOT}/SDKs/MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT}.sdk")
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT GREATER "10.4")
#----------------------------------------------------------------------------
# _CURRENT_OSX_VERSION - as a two-component string: 10.5, 10.6, ...
#
STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
_CURRENT_OSX_VERSION "${CURRENT_OSX_VERSION}")
#----------------------------------------------------------------------------
# CMAKE_OSX_DEPLOYMENT_TARGET
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
IF(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
ENDIF(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
#----------------------------------------------------------------------------
# CMAKE_OSX_SYSROOT
# Environment variable set by the user overrides our default.
# Use the same environment variable that Xcode uses.
SET(ENV_SDKROOT "$ENV{SDKROOT}")
IF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT EQUAL "10.4")
# Set CMAKE_OSX_SYSROOT_DEFAULT based on _CURRENT_OSX_VERSION,
# accounting for the known specially named SDKs.
SET(CMAKE_OSX_SYSROOT_DEFAULT
"${OSX_DEVELOPER_ROOT}/SDKs/MacOSX${_CURRENT_OSX_VERSION}.sdk")
IF(_CURRENT_OSX_VERSION STREQUAL "10.4")
SET(CMAKE_OSX_SYSROOT_DEFAULT
"${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.4u.sdk")
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT EQUAL "10.4")
ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.4")
IF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT EQUAL "10.3")
IF(_CURRENT_OSX_VERSION STREQUAL "10.3")
SET(CMAKE_OSX_SYSROOT_DEFAULT
"${OSX_DEVELOPER_ROOT}/SDKs/MacOSX10.3.9.sdk")
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT EQUAL "10.3")
# Allow environment variables set by the user to override our defaults.
# Use the same environment variables that Xcode uses.
SET(ENV_MACOSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}")
SET(ENV_SDKROOT "$ENV{SDKROOT}")
# See if we need to override the default SDK or Deployment target with the
# environment variables
IF(NOT ENV_MACOSX_DEPLOYMENT_TARGET STREQUAL "")
SET(CMAKE_OSX_DEPLOYMENT_TARGET_VALUE ${ENV_MACOSX_DEPLOYMENT_TARGET})
ELSE(NOT ENV_MACOSX_DEPLOYMENT_TARGET STREQUAL "")
SET(CMAKE_OSX_DEPLOYMENT_TARGET_VALUE ${CMAKE_OSX_DEPLOYMENT_TARGET_DEFAULT})
ENDIF(NOT ENV_MACOSX_DEPLOYMENT_TARGET STREQUAL "")
ENDIF(_CURRENT_OSX_VERSION STREQUAL "10.3")
# Use environment or default as initial cache value:
IF(NOT ENV_SDKROOT STREQUAL "")
SET(CMAKE_OSX_SYSROOT_VALUE ${ENV_SDKROOT})
ELSE(NOT ENV_SDKROOT STREQUAL "")
SET(CMAKE_OSX_SYSROOT_VALUE ${CMAKE_OSX_SYSROOT_DEFAULT})
ENDIF(NOT ENV_SDKROOT STREQUAL "")
# Set cache variables - end user may change these during ccmake or cmake-gui configure.
IF(CURRENT_OSX_VERSION GREATER 10.3)
SET(CMAKE_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET_VALUE} CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
ENDIF(CURRENT_OSX_VERSION GREATER 10.3)
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT_VALUE} CACHE PATH
"The product will be built against the headers and libraries located inside the indicated SDK.")
#----------------------------------------------------------------------------
function(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
if (_deploy STREQUAL "")
if(_deploy STREQUAL "")
return()
endif()
string (REGEX REPLACE "(.*MacOSX*)(....)(.*\\.sdk)" "\\2" SDK ${_sdk_path})
if (_deploy GREATER SDK)
message (FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${_deploy}) is greater than CMAKE_OSX_SYSROOT SDK (${_sdk_path}). Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${SDK}")
endif (_deploy GREATER SDK)
endfunction(SanityCheckSDKAndDeployTarget _sdk_path _deploy)
if(_sdk_path STREQUAL "")
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET='${_deploy}' but CMAKE_OSX_SYSROOT is empty... - either set CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to empty")
endif()
string(REGEX REPLACE "(.*MacOSX*)(....)(.*\\.sdk)" "\\2" SDK "${_sdk_path}")
if(_deploy GREATER "${SDK}")
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET (${_deploy}) is greater than CMAKE_OSX_SYSROOT SDK (${_sdk_path}). Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${SDK} or lower")
endif()
endfunction(SanityCheckSDKAndDeployTarget)
#----------------------------------------------------------------------------
# Make sure the combination of SDK and Deployment Target are allowed
......
......@@ -276,12 +276,14 @@ private:
&& !this->CData.empty())
{
this->CurChange.Path.assign(&this->CData[0], this->CData.size());
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
this->Changes.push_back(this->CurChange);
}
else if(strcmp(name, "symlink") == 0 && !this->CData.empty())
{
// symlinks have an arobase at the end in the log
this->CurChange.Path.assign(&this->CData[0], this->CData.size()-1);
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
this->Changes.push_back(this->CurChange);
}
else if(strcmp(name, "committer") == 0 && !this->CData.empty())
......@@ -377,9 +379,10 @@ private:
return true;
}
void DoPath(char c0, char c1, char c2, std::string const& path)
void DoPath(char c0, char c1, char c2, std::string path)
{
if(path.empty()) return;
cmSystemTools::ConvertToUnixSlashes(path);
const std::string dir = cmSystemTools::GetFilenamePath(path);
const std::string name = cmSystemTools::GetFilenameName(path);
......@@ -488,9 +491,10 @@ private:
return true;
}
void DoPath(char c0, char c1, char c2, std::string const& path)
void DoPath(char c0, char c1, char c2, std::string path)
{
if(path.empty()) return;
cmSystemTools::ConvertToUnixSlashes(path);
if ( c0=='C' )
{
......
......@@ -132,7 +132,8 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
}
}
if (!multiConfig && !cmakeBuildTypeInOptions)
if (!multiConfig && !cmakeBuildTypeInOptions &&
!this->CTest->GetConfigType().empty())
{
cmakeConfigureCommand += " \"-DCMAKE_BUILD_TYPE:STRING=";
cmakeConfigureCommand += this->CTest->GetConfigType();
......
......@@ -409,10 +409,16 @@ void cmCTestGIT::LoadRevisions()
//----------------------------------------------------------------------------
void cmCTestGIT::LoadModifications()
{
// Use 'git diff-index' to get modified files.
const char* git = this->CommandLineTool.c_str();
const char* git_diff_index[] = {git, "diff-index", "-z", "HEAD", 0};
// Use 'git update-index' to refresh the index w.r.t. the work tree.
const char* git_update_index[] = {git, "update-index", "--refresh", 0};
OutputLogger ui_out(this->Log, "ui-out> ");
OutputLogger ui_err(this->Log, "ui-err> ");
this->RunChild(git_update_index, &ui_out, &ui_err);
// Use 'git diff-index' to get modified files.
const char* git_diff_index[] = {git, "diff-index", "-z", "HEAD", 0};
DiffParser out(this, "di-out> ");
OutputLogger err(this->Log, "di-err> ");
this->RunChild(git_diff_index, &out, &err);
......
......@@ -325,7 +325,7 @@ void cmCTestMultiProcessHandler::WriteCostData(int index, float cost)
std::string fname = this->CTest->GetBinaryDir()
+ "/Testing/Temporary/CTestCostData.txt";
std::fstream fout;
fout.open(fname.c_str(), std::ios::app);
fout.open(fname.c_str(), std::ios::out | std::ios::app);
fout << index << " " << cost << "\n";
fout.close();
}
......
......@@ -398,7 +398,7 @@ std::string cmCTest::GetCDashVersion()
std::string url = "http://";
url += this->GetCTestConfiguration("DropSite") + "/CDash/api/getversion.php";
int res = cmCTest::HTTPRequest(url, cmCTest::HTTP_GET, response);
int res = cmCTest::HTTPRequest(url, cmCTest::HTTP_GET, response, "", "", 3);
return res ? this->GetCTestConfiguration("CDashVersion") : response;
#else
......@@ -471,6 +471,10 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
return 0;
}
// call this so that the information is cached up front
// and not the first time EndTest is called.
this->ShouldCompressTestOutput();
if ( this->ProduceXML )
{
// Verify "Testing" directory exists:
......
......@@ -1784,6 +1784,10 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET");
std::string isysrootVar = std::string("CMAKE_") + lang + "_HAS_ISYSROOT";
bool hasIsysroot = this->Makefile->IsOn(isysrootVar.c_str());
std::string deploymentTargetFlagVar =
std::string("CMAKE_") + lang + "_OSX_DEPLOYMENT_TARGET_FLAG";
const char* deploymentTargetFlag =
this->Makefile->GetDefinition(deploymentTargetFlagVar.c_str());
bool flagsUsed = false;
if(!archs.empty() && sysroot && lang && (lang[0] =='C' || lang[0] == 'F'))
{
......@@ -1815,10 +1819,11 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
flags += sysroot;
}
if (deploymentTarget && *deploymentTarget &&
lang && (lang[0] =='C' || lang[0] == 'F'))
if (deploymentTargetFlag && *deploymentTargetFlag &&
deploymentTarget && *deploymentTarget)
{
flags += " -mmacosx-version-min=";
flags += " ";
flags += deploymentTargetFlag;
flags += deploymentTarget;
}
}
......
......@@ -1285,6 +1285,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log"
)
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestScheduler/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake"
@ONLY ESCAPE_QUOTES)
ADD_TEST(CTestTestScheduler ${CMAKE_CTEST_COMMAND}
-S "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake" -V
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/testOutput.log"
)
SET_TESTS_PROPERTIES(CTestTestScheduler PROPERTIES
PASS_REGULAR_EXPRESSION "Start 1.*Start 2.*Start 3.*Start 4.*Start 5.*Start 5.*Start 4.*Start 3.*Start 2.*Start 1")
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestSubdir/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake"
......
......@@ -26,6 +26,7 @@ AddCMakeTest(If "")
AddCMakeTest(String "")
AddCMakeTest(Math "")
AddCMakeTest(CMakeMinimumRequired "")
AddCMakeTest(CompilerIdVendor "")
if(HAVE_ELF_H)
AddCMakeTest(ELF "")
......@@ -46,11 +47,12 @@ AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}")
# by any previous configure, build or test steps.
#
if(do_cvs_tests)
string(REPLACE "\\" "/" ENV_HOME "$ENV{HOME}")
set(CheckSourceTree_PreArgs
"-DCMake_BINARY_DIR:PATH=${CMake_BINARY_DIR}"
"-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
"-DCVS_EXECUTABLE:STRING=${CVS_EXECUTABLE}"
"-DHOME:STRING=$ENV{HOME}"
"-DHOME:STRING=${ENV_HOME}"
)
AddCMakeTest(CheckSourceTree "${CheckSourceTree_PreArgs}")
endif(do_cvs_tests)
# This is not supposed to be included by user code, but we need to
# test it.
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
set(MY_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/CompilerIdVendor")
file(REMOVE_RECURSE ${MY_BINARY_DIR})
file(MAKE_DIRECTORY ${MY_BINARY_DIR})
set(CMAKE_MyLang_COMPILER ${CMAKE_COMMAND})
set(CMAKE_MyLang_COMPILER_ID_ARG1)
set(CMAKE_MyLang_COMPILER_ID_FLAGS_LIST)
set(CMAKE_MyLang_COMPILER_ID_DIR ${MY_BINARY_DIR})
file(WRITE "${MY_BINARY_DIR}/BogusVendor.cmake" "message(\"This is a BogusVendor compiler\")")
list(APPEND CMAKE_MyLang_COMPILER_ID_VENDORS BogusVendor)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_FLAGS_BogusVendor -P BogusVendor.cmake)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_REGEX_BogusVendor ThisDoesNotMatch_BogusVendor)
file(WRITE "${MY_BINARY_DIR}/MyVendor.cmake" "message(\"This is a MyVendor compiler\")")
list(APPEND CMAKE_MyLang_COMPILER_ID_VENDORS MyVendor)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_FLAGS_MyVendor -P MyVendor.cmake)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_REGEX_MyVendor MyVendor)
set(CMAKE_BINARY_DIR ${MY_BINARY_DIR})
cmake_determine_compiler_id_vendor(MyLang)
if("${CMAKE_MyLang_COMPILER_ID}" STREQUAL "MyVendor")
message(STATUS "Found MyVendor compiler id!")
else()
message(FATAL_ERROR "Did not find MyVendor compiler id: [${CMAKE_MyLang_COMPILER_ID}]")
endif()
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
PROJECT (CTestTestScheduler)
INCLUDE (CTest)
ADD_EXECUTABLE (Sleep sleep.c)
FOREACH (time RANGE 1 5)
ADD_TEST (TestSleep${time} Sleep ${time})
ENDFOREACH (time RANGE 1 5)
set(CTEST_PROJECT_NAME "CTestTestScheduler")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
set(CTEST_DROP_SITE_CDASH TRUE)
#if defined(_WIN32)
# include <windows.h>
#else
# include <unistd.h>
#endif
/* sleeps for 2n seconds, where n is the argument to the program */
int main(int argc, char** argv)
{
int time;
if(argc > 1)
{
time = 3 * atoi(argv[1]);
}
#if defined(_WIN32)
Sleep(time * 1000);
#else
sleep(time);
#endif
return 0;
}
CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
# Settings:
SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
SET(CTEST_SITE "@SITE@")
SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Scheduler")
SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestScheduler")
SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestScheduler")
SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
# Remove old cost data file if it exists
IF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
FILE(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
ENDIF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt")
CTEST_START(Experimental)
CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5)
# Run test set a second time to make sure they run in reverse order
CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5)
......@@ -6,6 +6,7 @@
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateCVS_DIR@")
set(UPDATE_NOT_GLOBAL 1)
set(UPDATE_MAYBE Updated{CTestConfig.cmake})
# Include code common to all update tests.