Commit d2715cae authored by Brad King's avatar Brad King

CMake 2.8.0-rc7

parent 29ebc97c
......@@ -316,7 +316,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 0)
SET(CMake_VERSION_RC 6)
SET(CMake_VERSION_RC 7)
# We use odd minor numbers for development versions.
# Use a date for the development patch level.
......
Changes in CMake 2.8.0 RC 7
- Partially sync FindQt4 with KDE version
- Improve implementation of fix for #9090
- Fix CTest infinite loop when test executable could not be found
- Fix #9833: Document ctest --help-command
- FindCUDA: Fix -fPIC from being used on executable object files
- Fix #9654: %files section in spec file should not list directories
- Fix #9851: Better STRING(RANDOM) seeding
- Fix double bootstrap build for in source builds
- Fix CTest to use allowed value for valgrind --num-callers
- Remove non-language implicit link dependencies
- Implement LINK_FLAGS_<CONFIG> property on Xcode
Changes in CMake 2.8.0 RC 6
- Sync FindQt4 with KDE version
- Partially sync FindQt4 with KDE version
- Fix #9090: Teach CTest subdirs() command to handle absolute paths
- Fix CTest bug that could start a test twice
......
......@@ -17,7 +17,7 @@
# code.
function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
set(implicit_libs "")
set(implicit_libs_tmp "")
set(implicit_dirs_tmp)
set(log "")
......@@ -53,11 +53,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
elseif("${arg}" MATCHES "^-l[^:]")
# Unix library.
string(REGEX REPLACE "^-l" "" lib "${arg}")
list(APPEND implicit_libs ${lib})
list(APPEND implicit_libs_tmp ${lib})
set(log "${log} arg [${arg}] ==> lib [${lib}]\n")
elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.a$")
# Unix library full path.
list(APPEND implicit_libs ${arg})
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> lib [${arg}]\n")
elseif("${arg}" MATCHES "^-Y(P,)?")
# Sun search path.
......@@ -67,11 +67,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
set(log "${log} arg [${arg}] ==> dirs [${dirs}]\n")
elseif("${arg}" MATCHES "^-l:")
# HP named library.
list(APPEND implicit_libs ${arg})
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> lib [${arg}]\n")
elseif("${arg}" MATCHES "^-z(all|default|weak)extract")
# Link editor option.
list(APPEND implicit_libs ${arg})
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> opt [${arg}]\n")
else()
set(log "${log} arg [${arg}] ==> ignore\n")
......@@ -90,6 +90,17 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
endif()
endforeach()
# Cleanup list of libraries and flags.
# We remove items that are not language-specific.
set(implicit_libs "")
foreach(lib IN LISTS implicit_libs_tmp)
if("${lib}" MATCHES "^(crt.*\\.o|gcc.*|System.*)$")
set(log "${log} remove lib [${lib}]\n")
else()
list(APPEND implicit_libs "${lib}")
endif()
endforeach()
# Cleanup list of directories.
set(implicit_dirs "")
foreach(d IN LISTS implicit_dirs_tmp)
......
......@@ -277,8 +277,13 @@ SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
# neither escaping (as below) nor putting quotes around the path seem to help
#STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
# Use files tree to construct files command (spec file)
EXECUTE_PROCESS(COMMAND find -type f
COMMAND sed {s/\\.//}
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec")
IF(CPACK_RPM_USER_BINARY_SPECFILE)
# User may have specified SPECFILE just use it
......@@ -326,6 +331,8 @@ ${CPACK_RPM_PACKAGE_DESCRIPTION}
# generated by CMake RPM generator
# we skip the _prepn _build and _install
# steps because CPack does that for us
# WE MUST NOT DO ANYTHING in those steps because they
# may fail for non-privileged user
#p prep
#p build
......@@ -338,9 +345,11 @@ ${CPACK_RPM_PACKAGE_DESCRIPTION}
%defattr(-,root,root,-)
#p dir %{prefix}
#p {prefix}/*
/*
${CPACK_RPM_INSTALL_FILES}
%changelog
* Sat Oct 03 2009 Kami <cmoidavid@gmail.com>
Update to handle more precisely the files section
* Mon Oct 03 2008 Erk <eric.noulard@gmail.com>
Update generator to handle optional dependencies using Requires
Update DEBUG output typos.
......
......@@ -161,10 +161,6 @@
# cuda file to Visual Studio it knows that this file produces an object file
# and will link in the resulting object file automatically.
#
# This script also looks at optional arguments STATIC, SHARED, or MODULE to
# override the behavior specified by the value of the CMake variable
# BUILD_SHARED_LIBS. See BUILD_SHARED_LIBS below for more details.
#
# This script will also generate a separate cmake script that is used at
# build time to invoke nvcc. This is for serveral reasons.
#
......@@ -181,13 +177,13 @@
# make the build rule dependent on the file, the output files will be
# regenerated when the options change.
#
# In addition, on some systems special flags are added for building objects
# intended for shared libraries. FindCUDA make use of the CMake variable
# BUILD_SHARED_LIBS and the usual STATIC, SHARED, and MODULE arguments to
# determine if these flags should be used. Please set BUILD_SHARED_LIBS or
# pass in STATIC, SHARED, or MODULE according to how the objects are to be
# used before calling CUDA_ADD_LIBRARY. A preprocessor macro,
# <target_name>_EXPORTS is defined when BUILD_SHARED_LIBS is defined.
# This script also looks at optional arguments STATIC, SHARED, or MODULE to
# determine when to target the object compilation for a shared library.
# BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
# CUDA_ADD_LIBRARY. On some systems special flags are added for building
# objects intended for shared libraries. A preprocessor macro,
# <target_name>_EXPORTS is defined when a shared library compilation is
# detected.
#
# Flags passed into add_definitions with -D or /D are passed along to nvcc.
#
......@@ -755,6 +751,27 @@ function(CUDA_ADD_CUDA_INCLUDE_ONCE)
endif()
endfunction()
function(CUDA_BUILD_SHARED_LIBRARY shared_flag)
set(cmake_args ${ARGN})
# If SHARED, MODULE, or STATIC aren't already in the list of arguments, then
# add SHARED or STATIC based on the value of BUILD_SHARED_LIBS.
list(FIND cmake_args SHARED _cuda_found_SHARED)
list(FIND cmake_args MODULE _cuda_found_MODULE)
list(FIND cmake_args STATIC _cuda_found_STATIC)
if( _cuda_found_SHARED GREATER -1 OR
_cuda_found_MODULE GREATER -1 OR
_cuda_found_STATIC GREATER -1)
set(_cuda_build_shared_libs)
else()
if (BUILD_SHARED_LIBS)
set(_cuda_build_shared_libs SHARED)
else()
set(_cuda_build_shared_libs STATIC)
endif()
endif()
set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE)
endfunction()
##############################################################################
# This helper macro populates the following variables and setups up custom
# commands and targets to invoke the nvcc compiler to generate C or PTX source
......@@ -847,8 +864,9 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${ARGN})
CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options})
# Figure out if we are building a shared library. Default the value of BUILD_SHARED_LIBS.
set(_cuda_build_shared_libs ${BUILD_SHARED_LIBS})
# Figure out if we are building a shared library. BUILD_SHARED_LIBS is
# respected in CUDA_ADD_LIBRARY.
set(_cuda_build_shared_libs FALSE)
# SHARED, MODULE
list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED)
list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE)
......@@ -866,6 +884,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# If we are setting up code for a shared library, then we need to add extra flags for
# compiling objects for shared libraries.
set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS})
else()
set(CUDA_HOST_SHARED_FLAGS)
endif()
# Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We
# always need to set the SHARED_FLAGS, though.
......@@ -1083,8 +1103,10 @@ macro(CUDA_ADD_LIBRARY cuda_target)
# Separate the sources from the options
CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN})
CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN})
# Create custom commands and targets for each file.
CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} ${_cmake_options}
CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources}
${_cmake_options} ${_cuda_shared_flag}
OPTIONS ${_options} )
# Add the library.
......
......@@ -643,7 +643,7 @@ IF (QT4_QMAKE_FOUND)
)
# Set QT_QTASSISTANT_INCLUDE_DIR
FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QAssistantClient
FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
PATHS
${QT_HEADERS_DIR}/QtAssistant
${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
......
......@@ -462,7 +462,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
if ( !this->MemoryTesterOptions.size() )
{
this->MemoryTesterOptions = "-q --tool=memcheck --leak-check=yes "
"--show-reachable=yes --workaround-gcc296-bugs=yes --num-callers=100";
"--show-reachable=yes --workaround-gcc296-bugs=yes --num-callers=50";
}
if ( this->CTest->GetCTestConfiguration(
"MemoryCheckSuppressionFile").size() )
......
......@@ -97,6 +97,8 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
else
{
this->Completed++;
this->TestFinishMap[test] = true;
this->TestRunningMap[test] = false;
this->RunningCount -= GetProcessorsUsed(test);
testRun->EndTest(this->Completed, this->Total, false);
this->Failed->push_back(this->Properties[test]->Name);
......
......@@ -82,17 +82,20 @@ bool cmCTestSubdirCommand
for ( it = args.begin(); it != args.end(); ++ it )
{
cmSystemTools::ChangeDirectory(cwd.c_str());
std::string fname = cwd;
fname += "/";
fname += *it;
std::string fname;
//sanity check on relative path; if not, try absolute path
if ( !cmSystemTools::FileIsDirectory(fname.c_str()))
if(cmSystemTools::FileIsFullPath(it->c_str()))
{
fname = *it;
}
else
{
fname = cwd;
fname += "/";
fname += *it;
}
if ( !cmSystemTools::FileExists(fname.c_str()) )
if ( !cmSystemTools::FileIsDirectory(fname.c_str()) )
{
// No subdirectory? So what...
continue;
......
......@@ -1521,6 +1521,16 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
extraLinkOptions += " ";
extraLinkOptions += targetLinkFlags;
}
if(configName && *configName)
{
std::string linkFlagsVar = "LINK_FLAGS_";
linkFlagsVar += cmSystemTools::UpperCase(configName);
if(const char* linkFlags = target.GetProperty(linkFlagsVar.c_str()))
{
extraLinkOptions += " ";
extraLinkOptions += linkFlags;
}
}
// Get the product name components.
std::string pnprefix;
......
......@@ -18,7 +18,7 @@
// include configure generated header to define CMAKE_NO_ANSI_STREAM_HEADERS,
// CMAKE_NO_STD_NAMESPACE, and other macros.
#include "cmConfigure.h"
#include <cmConfigure.h>
#include <cmsys/Configure.hxx>
#ifdef _MSC_VER
......
......@@ -700,6 +700,9 @@ bool cmStringCommand
return false;
}
static bool seeded = false;
bool force_seed = false;
int seed = (int) time(NULL);
int length = 5;
const char cmStringCommandDefaultAlphabet[] = "qwertyuiopasdfghjklzxcvbnm"
"QWERTYUIOPASDFGHJKLZXCVBNM"
......@@ -723,6 +726,12 @@ bool cmStringCommand
++i;
alphabet = args[i];
}
else if ( args[i] == "RANDOM_SEED" )
{
++i;
seed = atoi(args[i].c_str());
force_seed = true;
}
}
}
if ( !alphabet.size() )
......@@ -744,7 +753,13 @@ bool cmStringCommand
const std::string& variableName = args[args.size()-1];
std::vector<char> result;
srand((int)time(NULL));
if (!seeded || force_seed)
{
seeded = true;
srand(seed);
}
const char* alphaPtr = alphabet.c_str();
int cc;
for ( cc = 0; cc < length; cc ++ )
......
......@@ -89,7 +89,7 @@ public:
" string(SUBSTRING <string> <begin> <length> <output variable>)\n"
" string(STRIP <string> <output variable>)\n"
" string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]\n"
" <output variable>)\n"
" [RANDOM_SEED <seed>] <output variable>)\n"
"REGEX MATCH will match the regular expression once and store the "
"match in the output variable.\n"
"REGEX MATCHALL will match the regular expression as many times as "
......@@ -115,7 +115,8 @@ public:
"RANDOM will return a random string of given length consisting of "
"characters from the given alphabet. Default length is 5 "
"characters and default alphabet is all numbers and upper and "
"lower case letters.\n"
"lower case letters. If an integer RANDOM_SEED is given, its "
"value will be used to seed the random number generator.\n"
"The following characters have special meaning in regular expressions:\n"
" ^ Matches at beginning of a line\n"
" $ Matches at end of a line\n"
......
......@@ -212,6 +212,13 @@ static const char * cmDocumentationOptions[][3] =
"This option allows performing the same CTest action (such as test) "
"multiple times and submit all stages to the same dashboard (Dart2 "
"required). Each execution requires different index." },
{"--help-command <cmd> [<file>]", "Show help for a single command and exit.",
"Prints the help for the command to stdout or to the specified file." },
{"--help-command-list [<file>]", "List available commands and exit.",
"Prints the list of all available listfile commands to stdout or the "
"specified file." },
{"--help-commands [<file>]", "Print help for all commands and exit.",
"Prints the help for all commands to stdout or to the specified file." },
{0,0,0}
};
......
......@@ -1198,6 +1198,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
-S "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake" -V
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/testOutput.log"
)
#make sure all 3 subdirs were added
SET_TESTS_PROPERTIES(CTestTestSubdir PROPERTIES
PASS_REGULAR_EXPRESSION "0 tests failed out of 3")
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestTimeout/test.cmake.in"
......
......@@ -182,6 +182,14 @@ elseif(testname STREQUAL random_with_various_alphabets) # pass
string(RANDOM LENGTH 1 ALPHABET "Q" v)
message(STATUS "v='${v}'")
# seed values -- 2 same, then 1 different
string(RANDOM LENGTH 32 ALPHABET "ACGT" RANDOM_SEED 987654 v)
message(STATUS "v='${v}'")
string(RANDOM LENGTH 32 ALPHABET "ACGT" RANDOM_SEED 987654 v)
message(STATUS "v='${v}'")
string(RANDOM LENGTH 32 ALPHABET "ACGT" RANDOM_SEED 876543 v)
message(STATUS "v='${v}'")
# alphabet of many colors - use all the crazy keyboard characters
string(RANDOM LENGTH 78 ALPHABET "~`!@#$%^&*()_-+={}[]\\|:\\;'\",.<>/?" v)
message(STATUS "v='${v}'")
......
......@@ -9,3 +9,5 @@ GET_FILENAME_COMPONENT(CTEST_COMMAND "${CMAKE_COMMAND}" PATH)
SET(CTEST_COMMAND "${CTEST_COMMAND}/ctest")
ADD_SUBDIRECTORY(subdir)
SUBDIRS(subdir2)
SUBDIRS("${CTestTestSubdir_SOURCE_DIR}/subdir3")
ADD_EXECUTABLE (main main.c)
ADD_TEST (TestMain main)
ADD_TEST (TestMain1 main)
ADD_EXECUTABLE (main2 main.c)
ADD_TEST (TestMain2 main2)
int main(void)
{
return 0;
}
ADD_EXECUTABLE (main3 main.c)
ADD_TEST (TestMain3 main3)
int main(void)
{
return 0;
}
......@@ -1316,9 +1316,9 @@ if [ "x${cmake_cxx_flags}" != "x" ]; then
fi
cmake_c_flags_String="-DKWSYS_STRING_C"
cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \
-I`cmake_escape \"${cmake_bootstrap_dir}\"`"
cmake_cxx_flags="${cmake_cxx_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \
-I`cmake_escape \"${cmake_bootstrap_dir}\"`"
echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
......
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