commit
1307deacd9
@ -0,0 +1,115 @@
|
||||
# CMakeVerifyManifest.cmake
|
||||
#
|
||||
# This script is used to verify that embeded manifests and
|
||||
# side by side manifests for a project match. To run this
|
||||
# script, cd to a directory and run the script with cmake -P.
|
||||
# On the command line you can pass in versions that are OK even
|
||||
# if not found in the .manifest files. For example,
|
||||
# cmake -Dallow_versions=8.0.50608.0 -PCmakeVerifyManifest.cmake
|
||||
# could be used to allow an embeded manifest of 8.0.50608.0
|
||||
# to be used in a project even if that version was not found
|
||||
# in the .manifest file.
|
||||
|
||||
# This script first recursively globs *.manifest files from
|
||||
# the current directory. Then globs *.exe and *.dll. Each
|
||||
# .exe and .dll is scanned for embeded manifests and the versions
|
||||
# of CRT are compared to those found in the .manifest files
|
||||
# from the first glob.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2008-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
|
||||
# crt_version:
|
||||
# function to extract the CRT version from a file
|
||||
# this can be passed a .exe, .dll, or a .manifest file
|
||||
# it will put the list of versions found into the variable
|
||||
# specified by list_var
|
||||
function(crt_version file list_var)
|
||||
file(STRINGS "${file}" strings REGEX "Microsoft.VC...CRT" NEWLINE_CONSUME)
|
||||
foreach(s ${strings})
|
||||
set(has_match 1)
|
||||
string(REGEX
|
||||
REPLACE ".*<assembly.*\"Microsoft.VC...CRT\".*version=\"([^\"]*)\".*</assembly>.*$" "\\1"
|
||||
version "${s}")
|
||||
if(NOT "${version}" STREQUAL "")
|
||||
list(APPEND version_list ${version})
|
||||
else()
|
||||
message(FATAL_ERROR "Parse error could not find version in [${s}]")
|
||||
endif()
|
||||
endforeach(s)
|
||||
if(NOT DEFINED has_match)
|
||||
message("Information: no embeded manifest in: ${file}")
|
||||
return()
|
||||
endif()
|
||||
list(APPEND version_list ${${list_var}})
|
||||
list(REMOVE_DUPLICATES version_list)
|
||||
if(version_list)
|
||||
set(${list_var} ${version_list} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction(crt_version)
|
||||
set(fatal_error FALSE)
|
||||
|
||||
# check_version:
|
||||
#
|
||||
# test a file against the shipped manifest versions
|
||||
# for a directory
|
||||
function(check_version file manifest_versions)
|
||||
set(manifest_versions ${manifest_versions} ${allow_versions})
|
||||
# collect versions for a given file
|
||||
crt_version(${file} file_versions)
|
||||
# see if the versions
|
||||
foreach(ver ${file_versions})
|
||||
list(FIND manifest_versions "${ver}" found_version)
|
||||
if("${found_version}" EQUAL -1)
|
||||
message("ERROR: ${file} uses ${ver} not found in shipped manifests:[${manifest_versions}].")
|
||||
set(fatal_error TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endforeach(ver)
|
||||
list(LENGTH file_versions len)
|
||||
if(${len} GREATER 1)
|
||||
message("WARNING: found more than one version of MICROSOFT.VC80.CRT referenced in ${file}: [${file_versions}]")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# collect up the versions of CRT that are shipped
|
||||
# in .manifest files
|
||||
set(manifest_version_list )
|
||||
file(GLOB_RECURSE manifest_files "*.manifest")
|
||||
foreach(f ${manifest_files})
|
||||
crt_version("${f}" manifest_version_list)
|
||||
endforeach(f)
|
||||
list(LENGTH manifest_version_list LEN)
|
||||
if(LEN EQUAL 0)
|
||||
message(FATAL_ERROR "No .manifest files found, no version check can be done.")
|
||||
endif()
|
||||
message("Versions found in ${manifest_files}: ${manifest_version_list}")
|
||||
if(DEFINED allow_versions)
|
||||
message("Extra versions allowed: ${allow_versions}")
|
||||
endif()
|
||||
|
||||
# now find all .exe and .dll files
|
||||
# and call check_version on each of them
|
||||
file(GLOB_RECURSE exe_files "*.exe")
|
||||
file(GLOB_RECURSE dll_files "*.dll")
|
||||
set(exe_files ${exe_files} ${dll_files})
|
||||
foreach(f ${exe_files})
|
||||
check_version(${f} "${manifest_version_list}")
|
||||
endforeach()
|
||||
|
||||
# report a fatal error if there were any so that cmake will return
|
||||
# a non zero value
|
||||
if(fatal_error)
|
||||
message(FATAL_ERROR "This distribution embeds dll "
|
||||
" versions that it does not ship, and may not work on other machines.")
|
||||
endif()
|
@ -0,0 +1,7 @@
|
||||
set(CMAKE_Fortran_FLAGS_INIT "")
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
|
||||
set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
|
||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
|
||||
set(CMAKE_Fortran_MODDIR_FLAG "-fmod=")
|
||||
set(CMAKE_Fortran_VERBOSE_FLAG "-v")
|
@ -0,0 +1,37 @@
|
||||
/*============================================================================
|
||||
CMake - Cross Platform Makefile Generator
|
||||
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
||||
|
||||
Distributed under the OSI-approved BSD License (the "License");
|
||||
see accompanying file Copyright.txt for details.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the License for more information.
|
||||
============================================================================*/
|
||||
#include "cmGlobalVisualStudio10Win64Generator.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmake.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator()
|
||||
{
|
||||
this->PlatformName = "x64";
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmGlobalVisualStudio10Win64Generator
|
||||
::GetDocumentation(cmDocumentationEntry& entry) const
|
||||
{
|
||||
entry.Name = this->GetName();
|
||||
entry.Brief = "Generates Visual Studio 10 Win64 project files.";
|
||||
entry.Full = "";
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmGlobalVisualStudio10Win64Generator::EnableLanguage(
|
||||
std::vector<std::string> const& lang, cmMakefile *mf, bool optional)
|
||||
{
|
||||
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
|
||||
cmGlobalVisualStudio10Generator::EnableLanguage(lang, mf, optional);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*============================================================================
|
||||
CMake - Cross Platform Makefile Generator
|
||||
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
||||
|
||||
Distributed under the OSI-approved BSD License (the "License");
|
||||
see accompanying file Copyright.txt for details.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the License for more information.
|
||||
============================================================================*/
|
||||
#ifndef cmGlobalVisualStudio10Win64Generator_h
|
||||
#define cmGlobalVisualStudio10Win64Generator_h
|
||||
|
||||
#include "cmGlobalVisualStudio10Generator.h"
|
||||
|
||||
class cmGlobalVisualStudio10Win64Generator :
|
||||
public cmGlobalVisualStudio10Generator
|
||||
{
|
||||
public:
|
||||
cmGlobalVisualStudio10Win64Generator();
|
||||
static cmGlobalGenerator* New() {
|
||||
return new cmGlobalVisualStudio10Win64Generator; }
|
||||
|
||||
///! Get the name for the generator.
|
||||
virtual const char* GetName() const {
|
||||
return cmGlobalVisualStudio10Win64Generator::GetActualName();}
|
||||
static const char* GetActualName() {return "Visual Studio 10 Win64";}
|
||||
|
||||
/** Get the documentation entry for this generator. */
|
||||
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
|
||||
|
||||
virtual void EnableLanguage(std::vector<std::string>const& languages,
|
||||
cmMakefile *, bool optional);
|
||||
};
|
||||
#endif
|
@ -0,0 +1,95 @@
|
||||
if(NOT DEFINED CMake_SOURCE_DIR)
|
||||
message(FATAL_ERROR "CMake_SOURCE_DIR not defined")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED dir)
|
||||
message(FATAL_ERROR "dir not defined")
|
||||
endif()
|
||||
|
||||
# Analyze 'cmake --help' output for list of available generators:
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${dir})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --help
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE stdout
|
||||
ERROR_VARIABLE stderr
|
||||
WORKING_DIRECTORY ${dir})
|
||||
|
||||
string(REPLACE ";" "\\;" stdout "${stdout}")
|
||||
string(REPLACE "\n" "E;" stdout "${stdout}")
|
||||
|
||||
set(collecting 0)
|
||||
set(generators)
|
||||
foreach(eline ${stdout})
|
||||
string(REGEX REPLACE "^(.*)E$" "\\1" line "${eline}")
|
||||
if(collecting AND NOT line STREQUAL "")
|
||||
if(line MATCHES "=")
|
||||
string(REGEX REPLACE "^ (.+)= (.*)$" "\\1" gen "${line}")
|
||||
if(gen MATCHES "[A-Za-z]")
|
||||
string(REGEX REPLACE "^(.*[^ ]) +$" "\\1" gen "${gen}")
|
||||
if(gen)
|
||||
set(generators ${generators} ${gen})
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
if(line MATCHES "^ [A-Za-z0-9]")
|
||||
string(REGEX REPLACE "^ (.+)$" "\\1" gen "${line}")
|
||||
string(REGEX REPLACE "^(.*[^ ]) +$" "\\1" gen "${gen}")
|
||||
if(gen)
|
||||
set(generators ${generators} ${gen})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(line STREQUAL "The following generators are available on this platform:")
|
||||
set(collecting 1)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Also call with one non-existent generator:
|
||||
#
|
||||
set(generators ${generators} "BOGUS_CMAKE_GENERATOR")
|
||||
|
||||
# Call cmake with -G on each available generator. We do not care if this
|
||||
# succeeds or not. We expect it *not* to succeed if the underlying packaging
|
||||
# tools are not installed on the system... This test is here simply to add
|
||||
# coverage for the various cmake generators, even/especially to test ones
|
||||
# where the tools are not installed.
|
||||
#
|
||||
message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
|
||||
|
||||
message(STATUS "CMake generators='${generators}'")
|
||||
|
||||
# First setup a source tree to run CMake on.
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMake_SOURCE_DIR}/Tests/CTestTest/SmallAndFast
|
||||
${dir}/Source
|
||||
)
|
||||
|
||||
foreach(g ${generators})
|
||||
message(STATUS "cmake -G \"${g}\" ..")
|
||||
|
||||
# Create a binary directory for each generator:
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
${dir}/Source/${g}
|
||||
)
|
||||
|
||||
# Run cmake:
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -G ${g} ..
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE stdout
|
||||
ERROR_VARIABLE stderr
|
||||
WORKING_DIRECTORY ${dir}/Source/${g}
|
||||
)
|
||||
|
||||
message(STATUS "result='${result}'")
|
||||
message(STATUS "stdout='${stdout}'")
|
||||
message(STATUS "stderr='${stderr}'")
|
||||
message(STATUS "")
|
||||
endforeach()
|
||||
|
||||
message(STATUS "CMake generators='${generators}'")
|
||||
message(STATUS "CMAKE_COMMAND='${CMAKE_COMMAND}'")
|
@ -0,0 +1,79 @@
|
||||
if(NOT DEFINED CMake_SOURCE_DIR)
|
||||
message(FATAL_ERROR "CMake_SOURCE_DIR not defined")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED dir)
|
||||
message(FATAL_ERROR "dir not defined")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED gen)
|
||||
message(FATAL_ERROR "gen not defined")
|
||||
endif()
|
||||
|
||||
message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
|
||||
|
||||
# First setup a source tree to run CMake on.
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMake_SOURCE_DIR}/Tests/CTestTest/SmallAndFast
|
||||
${dir}/Source
|
||||
)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
${dir}/Build
|
||||
)
|
||||
|
||||
function(RunCMakeWithArgs)
|
||||
message(STATUS "info: running cmake with ARGN='${ARGN}'")
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} ${ARGN}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE stdout
|
||||
ERROR_VARIABLE stderr
|
||||
WORKING_DIRECTORY ${dir}/Build
|
||||
)
|
||||
|
||||
message(STATUS "result='${result}'")
|
||||
message(STATUS "stdout='${stdout}'")
|
||||
message(STATUS "stderr='${stderr}'")
|
||||
message(STATUS "")
|
||||
endfunction()
|
||||
|
||||
# Run cmake once with no errors to get a good build tree:
|
||||
#
|
||||
RunCMakeWithArgs(-G ${gen} ../Source)
|
||||
|
||||
# Run cmake with args that produce some sort of problem to cover the error
|
||||
# cases in cmake.cxx...
|
||||
#
|
||||
# (These are not good examples of cmake command lines. Do not copy and
|
||||
# paste them elsewhere and expect them to work... See the cmake
|
||||
# documentation or other real examples of usage instead.)
|
||||
#
|
||||
RunCMakeWithArgs()
|
||||
RunCMakeWithArgs(-C)
|
||||
RunCMakeWithArgs(-C nosuchcachefile.txt)
|
||||
RunCMakeWithArgs(--check-stamp-file nostampfile)
|
||||
RunCMakeWithArgs(--check-stamp-list nostamplist)
|
||||
RunCMakeWithArgs(nosuchsubdir/CMakeCache.txt)
|
||||
RunCMakeWithArgs(nosuchsubdir/CMakeLists.txt)
|
||||
RunCMakeWithArgs(-D)
|
||||
RunCMakeWithArgs(--debug-output .)
|
||||
RunCMakeWithArgs(--debug-trycompile .)
|
||||
RunCMakeWithArgs(-E)
|
||||
RunCMakeWithArgs(-E create_symlink)
|
||||
RunCMakeWithArgs(-E echo_append)
|
||||
RunCMakeWithArgs(-E rename)
|
||||
RunCMakeWithArgs(-E touch_nocreate)
|
||||
RunCMakeWithArgs(-G)
|
||||
RunCMakeWithArgs(--graphviz= ../Source)
|
||||
RunCMakeWithArgs(--graphviz=g.dot .)
|
||||
RunCMakeWithArgs(-P)
|
||||
RunCMakeWithArgs(-P nosuchscriptfile.cmake)
|
||||
RunCMakeWithArgs(--trace .)
|
||||
RunCMakeWithArgs(-U)
|
||||
RunCMakeWithArgs(-U nosuchvariable .)
|
||||
RunCMakeWithArgs(-V)
|
||||
RunCMakeWithArgs(-V .)
|
||||
RunCMakeWithArgs(-Wno-dev .)
|
||||
RunCMakeWithArgs(-Wdev .)
|
@ -0,0 +1,165 @@
|
||||
if(NOT DEFINED CMake_SOURCE_DIR)
|
||||
message(FATAL_ERROR "CMake_SOURCE_DIR not defined")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED dir)
|
||||
message(FATAL_ERROR "dir not defined")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED gen)
|
||||
message(FATAL_ERROR "gen not defined")
|
||||
endif()
|
||||
|
||||
# Call cmake once to get a baseline/reference output build tree: "Build".
|
||||
# Then call cmake N more times, each time making a copy of the entire
|
||||
# build tree after cmake is done configuring/generating. At the end,
|
||||
# analyze the diffs in the generated build trees. Expect no diffs.
|
||||
#
|
||||
message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
|
||||
|
||||
set(N 7)
|
||||
|
||||
# First setup source and binary trees:
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
|
||||
${dir}/Source
|
||||
)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
|
||||
${dir}/Build
|
||||
)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMake_SOURCE_DIR}/Tests/CTestTest/SmallAndFast
|
||||
${dir}/Source
|
||||
)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
${dir}/Build
|
||||
)
|
||||
|
||||
# Patch SmallAndFast to build a .cxx executable too:
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
|
||||
${dir}/Source/echoargs.c
|
||||
${dir}/Source/echoargs.cxx
|
||||
)
|
||||
file(APPEND "${dir}/Source/CMakeLists.txt" "\nadd_executable(echoargsCXX echoargs.cxx)\n")
|
||||
|
||||
# Loop N times, saving a copy of the configured/generated build tree each time:
|
||||
#
|
||||
foreach(i RANGE 1 ${N})
|
||||
# Equivalent sequence of shell commands:
|
||||
#
|
||||
message(STATUS "${i}: cd Build && cmake -G \"${gen}\" ../Source && cd .. && cp -r Build b${i}")
|
||||
|
||||
# Run cmake:
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -G ${gen} ../Source
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE stdout
|
||||
ERROR_VARIABLE stderr
|
||||
WORKING_DIRECTORY ${dir}/Build
|
||||
)
|
||||
|
||||
message(STATUS "result='${result}'")
|
||||
message(STATUS "stdout='${stdout}'")
|
||||
message(STATUS "stderr='${stderr}'")
|
||||
message(STATUS "")
|
||||
|
||||
# Save this iteration of the Build directory:
|
||||
#
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
|
||||
${dir}/b${i}
|
||||
)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${dir}/Build
|
||||
${dir}/b${i}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE stdout
|
||||
ERROR_VARIABLE stderr
|
||||
)
|
||||
|
||||
message(STATUS "result='${result}'")
|
||||
message(STATUS "stdout='${stdout}'")
|
||||
message(STATUS "stderr='${stderr}'")
|
||||
message(STATUS "")
|
||||
endforeach()
|
||||
|
||||
|
||||
# Function to analyze diffs between two directories.
|
||||
# Set DIFF_EXECUTABLE before calling if 'diff' is available.
|
||||
#
|
||||
function(analyze_directory_diffs d1 d2 diff_count_var)
|
||||
set(diffs 0)
|
||||
|
||||
message(STATUS "Analyzing directory diffs between:")
|
||||
message(STATUS " d1='${d1}'")
|
||||
message(STATUS " d2='${d2}'")
|
||||
|
||||
if(NOT "${d1}" STREQUAL "" AND NOT "${d2}" STREQUAL "")
|
||||
message(STATUS "info: analyzing directories")
|
||||
|
||||
file(GLOB_RECURSE files1 RELATIVE "${d1}" "${d1}/*")
|
||||
file(GLOB_RECURSE files2 RELATIVE "${d2}" "${d2}/*")
|
||||
|
||||
if("${files1}" STREQUAL "${files2}")
|
||||
message(STATUS "info: file lists the same")
|
||||
#message(STATUS " files='${files1}'")
|
||||
|
||||
foreach(f ${files1})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E compare_files
|
||||
${d1}/${f}
|
||||
${d2}/${f}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE stdout
|
||||
ERROR_VARIABLE stderr
|
||||
)
|
||||
if(result STREQUAL 0)
|
||||
#message(STATUS "info: file '${f}' the same")
|
||||
else()
|
||||
math(EXPR diffs "${diffs} + 1")
|
||||
message(STATUS "warning: file '${f}' differs from d1 to d2")
|
||||
file(READ "${d1}/${f}" f1contents)
|
||||
message(STATUS "contents of file '${d1}/${f}'
|
||||
[===[${f1contents}]===]")
|
||||
file(READ "${d2}/${f}" f2contents)
|
||||
message(STATUS "contents of file '${d2}/${f}'
|
||||
[===[${f2contents}]===]")
|
||||
if(DIFF_EXECUTABLE)
|
||||
message(STATUS "diff of files '${d1}/${f}' '${d2}/${f}'")
|
||||
message(STATUS "[====[")
|
||||
execute_process(COMMAND ${DIFF_EXECUTABLE} "${d1}/${f}" "${d2}/${f}")
|
||||
message(STATUS "]====]")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
math(EXPR diffs "${diffs} + 1")
|
||||
message(STATUS "warning: file *lists* differ - some files exist in d1/not-d2 or not-d1/d2...")
|
||||
message(STATUS " files1='${files1}'")
|
||||
message(STATUS " files2='${files2}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(${diff_count_var} ${diffs} PARENT_SCOPE)
|
||||
endfunction(analyze_directory_diffs)
|
||||
|
||||
|
||||
# Analyze diffs between b1:b2, b2:b3, b3:b4, b4:b5 ... bN-1:bN.
|
||||
# Expect no diffs.
|
||||
#
|
||||
find_program(DIFF_EXECUTABLE diff)
|
||||
set(total_diffs 0)
|
||||
|
||||
foreach(i RANGE 2 ${N})
|
||||
math(EXPR prev "${i} - 1")
|
||||
set(count 0)
|
||||
analyze_directory_diffs(${dir}/b${prev} ${dir}/b${i} count)
|
||||
message(STATUS "diff count='${count}'")
|
||||
message(STATUS "")
|
||||
math(EXPR total_diffs "${total_diffs} + ${count}")
|
||||
endforeach()
|
||||
|
||||
message(STATUS "CMAKE_COMMAND='${CMAKE_COMMAND}'")
|
||||
message(STATUS "total_diffs='${total_diffs}'")
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,48 @@
|
||||
set(names
|
||||
elf32lsb.bin
|
||||
elf32msb.bin
|
||||
elf64lsb.bin
|
||||
elf64msb.bin
|
||||
)
|
||||
|
||||
# Prepare binaries on which to operate.
|
||||
set(in "@CMAKE_CURRENT_SOURCE_DIR@/ELF")
|
||||
set(out "@CMAKE_CURRENT_BINARY_DIR@/ELF-Out")
|
||||
file(REMOVE_RECURSE "${out}")
|
||||
file(MAKE_DIRECTORY "${out}")
|
||||
foreach(f ${names})
|
||||
file(COPY ${in}/${f} DESTINATION ${out})
|
||||
list(APPEND files "${out}/${f}")
|
||||
endforeach()
|
||||
|
||||
foreach(f ${files})
|
||||
# Check for the initial RPATH.
|
||||
file(RPATH_CHECK FILE "${f}" RPATH "/sample/rpath")
|
||||
if(NOT EXISTS "${f}")
|
||||
message(FATAL_ERROR "RPATH_CHECK removed ${f}")
|
||||
endif()
|
||||
|
||||
# Change the RPATH.
|
||||
file(RPATH_CHANGE FILE "${f}"
|
||||
OLD_RPATH "/sample/rpath"
|
||||
NEW_RPATH "/rpath/sample")
|
||||
set(rpath)
|
||||
file(STRINGS "${f}" rpath REGEX "/rpath/sample" LIMIT_COUNT 1)
|
||||
if(NOT rpath)
|
||||
message(FATAL_ERROR "RPATH not changed in ${f}")
|
||||
endif()
|
||||
|
||||
# Remove the RPATH.
|
||||
file(RPATH_REMOVE FILE "${f}")
|
||||
set(rpath)
|
||||
file(STRINGS "${f}" rpath REGEX "/rpath/sample" LIMIT_COUNT 1)
|
||||
if(rpath)
|
||||
message(FATAL_ERROR "RPATH not removed from ${f}")
|
||||
endif()
|
||||
|
||||
# Check again...this should remove the file.
|
||||
file(RPATH_CHECK FILE "${f}" RPATH "/sample/rpath")
|
||||
if(EXISTS "${f}")
|
||||
message(FATAL_ERROR "RPATH_CHECK did not remove ${f}")
|
||||
endif()
|
||||
endforeach()
|
@ -0,0 +1,207 @@
|
||||
message(STATUS "testname='${testname}'")
|
||||
|
||||
if(testname STREQUAL empty) # fail
|
||||
file()
|
||||
|
||||
elseif(testname STREQUAL bogus) # fail
|
||||
file(BOGUS ffff)
|
||||
|
||||
elseif(testname STREQUAL different_not_enough_args) # fail
|
||||
file(DIFFERENT ffff)
|
||||
|
||||
elseif(testname STREQUAL download_not_enough_args) # fail
|
||||
file(DOWNLOAD ffff)
|
||||
|
||||
elseif(testname STREQUAL read_not_enough_args) # fail
|
||||
file(READ ffff)
|
||||
|
||||
elseif(testname STREQUAL rpath_check_not_enough_args) # fail
|
||||
file(RPATH_CHECK ffff)
|
||||
|
||||
elseif(testname STREQUAL rpath_remove_not_enough_args) # fail
|
||||
file(RPATH_REMOVE ffff)
|
||||
|
||||
elseif(testname STREQUAL strings_not_enough_args) # fail
|
||||
file(STRINGS ffff)
|
||||
|
||||
elseif(testname STREQUAL to_native_path_not_enough_args) # fail
|
||||
file(TO_NATIVE_PATH ffff)
|
||||
|
||||
elseif(testname STREQUAL read_with_offset) # pass
|
||||
file(READ ${CMAKE_CURRENT_LIST_FILE} v OFFSET 42 LIMIT 30)
|
||||
message("v='${v}'")
|
||||
|
||||
elseif(testname STREQUAL strings_bad_length_minimum) # fail
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v LENGTH_MINIMUM bogus)
|
||||
|
||||
elseif(testname STREQUAL strings_bad_length_maximum) # fail
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v LENGTH_MAXIMUM bogus)
|
||||
|
||||
elseif(testname STREQUAL strings_bad_limit_count) # fail
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v LIMIT_COUNT bogus)
|
||||
|
||||
elseif(testname STREQUAL strings_bad_limit_input) # fail
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v LIMIT_INPUT bogus)
|
||||
|
||||
elseif(testname STREQUAL strings_bad_limit_output) # fail
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v LIMIT_OUTPUT bogus)
|
||||
|
||||
elseif(testname STREQUAL strings_bad_regex) # fail
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v REGEX "(")
|
||||
|
||||
elseif(testname STREQUAL strings_unknown_arg) # fail
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v BOGUS)
|
||||
|
||||
elseif(testname STREQUAL strings_bad_filename) # fail
|
||||
file(STRINGS ffff v LIMIT_COUNT 10)
|
||||
|
||||
elseif(testname STREQUAL strings_use_limit_count) # pass
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v LIMIT_COUNT 10)
|
||||
message("v='${v}'")
|
||||
|
||||
elseif(testname STREQUAL strings_use_no_hex_conversion) # pass
|
||||
file(STRINGS ${CMAKE_CURRENT_LIST_FILE} v NO_HEX_CONVERSION)
|
||||
message("v='${v}'")
|
||||
|
||||
elseif(testname STREQUAL glob_recurse_follow_symlinks_no_expression) # fail
|
||||
file(GLOB_RECURSE v FOLLOW_SYMLINKS)
|
||||
|
||||
elseif(testname STREQUAL glob_recurse_relative_no_directory) # fail
|
||||
file(GLOB_RECURSE v RELATIVE)
|
||||
|
||||
elseif(testname STREQUAL glob_recurse_relative_no_expression) # fail
|
||||
file(GLOB_RECURSE v RELATIVE dddd)
|
||||
|
||||
elseif(testname STREQUAL glob_non_full_path) # pass
|
||||
file(GLOB_RECURSE v ffff*.*)
|
||||
message("v='${v}'")
|
||||
|
||||
elseif(testname STREQUAL make_directory_non_full_path) # pass
|
||||
file(MAKE_DIRECTORY FileTestScriptDDDD)
|
||||
if(NOT EXISTS FileTestScriptDDDD)
|
||||
message(FATAL_ERROR "error: non-full-path MAKE_DIRECTORY failed")
|
||||
endif()
|
||||
file(REMOVE_RECURSE FileTestScriptDDDD)
|
||||
if(EXISTS FileTestScriptDDDD)
|
||||
message(FATAL_ERROR "error: non-full-path REMOVE_RECURSE failed")
|
||||
endif()
|
||||
|
||||
elseif(testname STREQUAL different_no_variable) # fail
|
||||
file(DIFFERENT FILES)
|
||||
|
||||
elseif(testname STREQUAL different_no_files) # fail
|
||||
file(DIFFERENT v FILES)
|
||||
|
||||
elseif(testname STREQUAL different_unknown_arg) # fail
|
||||
file(DIFFERENT v FILES ffffLHS ffffRHS BOGUS)
|
||||
|
||||
elseif(testname STREQUAL different_different) # pass
|
||||
file(DIFFERENT v FILES ffffLHS ffffRHS)
|
||||
message("v='${v}'")
|
||||
|
||||
elseif(testname STREQUAL different_same) # pass
|
||||
file(DIFFERENT v FILES
|
||||
${CMAKE_CURRENT_LIST_FILE} ${CMAKE_CURRENT_LIST_FILE})
|
||||
message("v='${v}'")
|
||||
|
||||
elseif(testname STREQUAL rpath_change_unknown_arg) # fail
|
||||
file(RPATH_CHANGE BOGUS)
|
||||
|
||||
elseif(testname STREQUAL rpath_change_bad_file) # fail
|
||||
file(RPATH_CHANGE FILE)
|
||||
|
||||
elseif(testname STREQUAL rpath_change_bad_old_rpath) # fail
|
||||
file(RPATH_CHANGE FILE ffff OLD_RPATH)
|
||||
|
||||
elseif(testname STREQUAL rpath_change_bad_new_rpath) # fail
|
||||
file(RPATH_CHANGE FILE ffff OLD_RPATH rrrr NEW_RPATH)
|
||||
|
||||
elseif(testname STREQUAL rpath_change_file_does_not_exist) # fail
|
||||
file(RPATH_CHANGE FILE ffff OLD_RPATH rrrr NEW_RPATH RRRR)
|
||||
|
||||
elseif(testname STREQUAL rpath_change_file_is_not_executable) # fail
|
||||
file(RPATH_CHANGE FILE ${CMAKE_CURRENT_LIST_FILE}
|
||||
OLD_RPATH rrrr NEW_RPATH RRRR)
|
||||
|
||||
elseif(testname STREQUAL rpath_remove_unknown_arg) # fail
|
||||
file(RPATH_REMOVE BOGUS)
|
||||
|
||||
elseif(testname STREQUAL rpath_remove_bad_file) # fail
|
||||
file(RPATH_REMOVE FILE)
|
||||
|
||||
elseif(testname STREQUAL rpath_remove_file_does_not_exist) # fail
|
||||
file(RPATH_REMOVE FILE ffff)
|
||||
|
||||
#elseif(testname STREQUAL rpath_remove_file_is_not_executable) # fail
|
||||
# file(RPATH_REMOVE FILE ${CMAKE_CURRENT_LIST_FILE})
|
||||
|
||||
elseif(testname STREQUAL rpath_check_unknown_arg) # fail
|
||||
file(RPATH_CHECK BOGUS)
|
||||
|
||||
elseif(testname STREQUAL rpath_check_bad_file) # fail
|
||||
file(RPATH_CHECK FILE)
|
||||
|
||||
elseif(testname STREQUAL rpath_check_bad_rpath) # fail
|
||||
file(RPATH_CHECK FILE ffff RPATH)
|
||||
|
||||
elseif(testname STREQUAL rpath_check_file_does_not_exist) # pass
|
||||
file(RPATH_CHECK FILE ffff RPATH rrrr)
|
||||
|
||||
elseif(testname STREQUAL rpath_check_file_is_not_executable) # pass
|
||||
file(WRITE ffff_rpath_check "")
|
||||
|
||||
if(NOT EXISTS ffff_rpath_check)
|
||||
message(FATAL_ERROR "error: non-full-path WRITE failed")
|
||||
endif()
|
||||
|
||||
file(RPATH_CHECK FILE ffff_rpath_check RPATH rrrr)
|
||||
# careful: if the file does not have the given RPATH, it is deleted...
|
||||
|
||||
if(EXISTS ffff_rpath_check)
|
||||
message(FATAL_ERROR "error: non-full-path RPATH_CHECK failed")
|
||||
endif()
|
||||
|
||||
elseif(testname STREQUAL relative_path_wrong_number_of_args) # fail
|
||||
file(RELATIVE_PATH v dir)
|
||||
|
||||
elseif(testname STREQUAL relative_path_non_full_path_dir) # fail
|
||||
file(RELATIVE_PATH v dir file)
|
||||
|
||||
elseif(testname STREQUAL relative_path_non_full_path_file) # fail
|
||||
file(RELATIVE_PATH v /dir file)
|
||||
|
||||
elseif(testname STREQUAL rename_wrong_number_of_args) # fail
|
||||
file(RENAME ffff)
|
||||
|
||||
elseif(testname STREQUAL rename_input_file_does_not_exist) # fail
|
||||
file(RENAME ffff FFFFGGGG)
|
||||
|
||||
elseif(testname STREQUAL to_native_path) # pass
|
||||
file(TO_NATIVE_PATH /a/b/c\;/d/e/f:/g/h/i v)
|
||||
message("v='${v}'")
|
||||
|
||||
elseif(testname STREQUAL download_wrong_number_of_args) # fail
|
||||
file(DOWNLOAD zzzz://bogus/ffff)
|
||||
|
||||
elseif(testname STREQUAL download_file_with_no_path) # fail
|
||||
file(DOWNLOAD zzzz://bogus/ffff ffff)
|
||||
|
||||
elseif(testname STREQUAL download_missing_time) # fail
|
||||
file(DOWNLOAD zzzz://bogus/ffff ./ffff TIMEOUT)
|
||||
|
||||
elseif(testname STREQUAL download_missing_log_var) # fail
|
||||
file(DOWNLOAD zzzz://bogus/ffff ./ffff TIMEOUT 2 LOG)
|
||||
|
||||
elseif(testname STREQUAL download_missing_status_var) # fail
|
||||
file(DOWNLOAD zzzz://bogus/ffff ./ffff TIMEOUT 2 LOG l STATUS)
|
||||
|
||||
elseif(testname STREQUAL download_with_bogus_protocol) # pass
|
||||
file(DOWNLOAD zzzz://bogus/ffff ./ffff TIMEOUT 2 LOG l STATUS s)
|
||||
file(REMOVE ./ffff)
|
||||
message("l='${l}'")
|
||||
message("s='${s}'")
|
||||
|
||||
else() # fail
|
||||
message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'")
|
||||
|
||||
endif()
|
@ -0,0 +1,158 @@
|
||||
# Prepare variable definitions.
|
||||
set(VAR_UNDEFINED)
|
||||
set(VAR_PATH /some/path/to/a/file.txt)
|
||||
set(FALSE_NAMES OFF NO FALSE N FOO-NOTFOUND IGNORE Off No False Ignore off n no false ignore)
|
||||
set(TRUE_NAMES ON YES TRUE Y On Yes True on yes true y)
|
||||
foreach(_arg "" 0 1 2 ${TRUE_NAMES} ${FALSE_NAMES})
|
||||
set(VAR_${_arg} "${_arg}")
|
||||
endforeach()
|
||||
|
||||
macro(test_vars _old)
|
||||
# Variables set to false or not set.
|
||||
foreach(_var "" 0 ${FALSE_NAMES} UNDEFINED)
|
||||
if(VAR_${_var})
|
||||
message(FATAL_ERROR "${_old}if(VAR_${_var}) is true!")
|
||||
else()
|
||||
message(STATUS "${_old}if(VAR_${_var}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT VAR_${_var})
|
||||
message(STATUS "${_old}if(NOT VAR_${_var}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "${_old}if(NOT VAR_${_var}) is false!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Variables set to true.
|
||||
foreach(_var 1 2 ${TRUE_NAMES} PATH)
|
||||
if(VAR_${_var})
|
||||
message(STATUS "${_old}if(VAR_${_var}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "${_old}if(VAR_${_var}) is false!")
|
||||
endif()
|
||||
|
||||
if(NOT VAR_${_var})
|
||||
message(FATAL_ERROR "${_old}if(NOT VAR_${_var}) is true!")
|
||||
else()
|
||||
message(STATUS "${_old}if(NOT VAR_${_var}) is false")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Test the OLD behavior of CMP0012.
|
||||
cmake_policy(SET CMP0012 OLD)
|
||||
|
||||
# False constants not recognized (still false).
|
||||
foreach(_false "" ${FALSE_NAMES})
|
||||
if("${_false}")
|
||||
message(FATAL_ERROR "OLD if(${_false}) is true!")
|
||||
else()
|
||||
message(STATUS "OLD if(${_false}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT "${_false}")
|
||||
message(STATUS "OLD if(NOT ${_false}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "OLD if(NOT ${_false}) is false!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# True constants not recognized.
|
||||
foreach(_false ${TRUE_NAMES})
|
||||
if(${_false})
|
||||
message(FATAL_ERROR "OLD if(${_false}) is true!")
|
||||
else()
|
||||
message(STATUS "OLD if(${_false}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT ${_false})
|
||||
message(STATUS "OLD if(NOT ${_false}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "OLD if(NOT ${_false}) is false!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Numbers not recognized properly.
|
||||
foreach(_num 2 -2 2.0 -2.0 2x -2x)
|
||||
if(${_num})
|
||||
message(FATAL_ERROR "OLD if(${_num}) is true!")
|
||||
else()
|
||||
message(STATUS "OLD if(${_num}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT ${_num})
|
||||
message(FATAL_ERROR "OLD if(NOT ${_num}) is true!")
|
||||
else()
|
||||
message(STATUS "OLD if(NOT ${_num}) is false")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
test_vars("OLD ")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Test the NEW behavior of CMP0012.
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
|
||||
# Test false constants.
|
||||
foreach(_false "" 0 ${FALSE_NAMES})
|
||||
if("${_false}")
|
||||
message(FATAL_ERROR "if(${_false}) is true!")
|
||||
else()
|
||||
message(STATUS "if(${_false}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT "${_false}")
|
||||
message(STATUS "if(NOT ${_false}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "if(NOT ${_false}) is false!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Test true constants.
|
||||
foreach(_true 1 ${TRUE_NAMES})
|
||||
if(${_true})
|
||||
message(STATUS "if(${_true}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "if(${_true}) is false!")
|
||||
endif()
|
||||
|
||||
if(NOT ${_true})
|
||||
message(FATAL_ERROR "if(NOT ${_true}) is true!")
|
||||
else()
|
||||
message(STATUS "if(NOT ${_true}) is false")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Numbers recognized properly.
|
||||
foreach(_num 2 -2 2.0 -2.0)
|
||||
if(${_num})
|
||||
message(STATUS "if(${_num}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "if(${_num}) is false!")
|
||||
endif()
|
||||
|
||||
if(NOT ${_num})
|
||||
message(FATAL_ERROR "if(NOT ${_num}) is true!")
|
||||
else()
|
||||
message(STATUS "if(NOT ${_num}) is false")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Bad numbers not recognized.
|
||||
foreach(_bad 2x -2x)
|
||||
if(${_bad})
|
||||
message(FATAL_ERROR "if(${_bad}) is true!")
|
||||
else()
|
||||
message(STATUS "if(${_bad}) is false")
|
||||
endif()
|
||||
|
||||
if(NOT ${_bad})
|
||||
message(STATUS "if(NOT ${_bad}) is true")
|
||||
else()
|
||||
message(FATAL_ERROR "if(NOT ${_bad}) is false!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
test_vars("")
|
@ -0,0 +1,5 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(CPackTestAllGenerators)
|
||||
add_subdirectory(../CTestTest/SmallAndFast SmallAndFast)
|
||||
install(FILES RunCPack.cmake DESTINATION .)
|
||||
include(CPack)
|
@ -0,0 +1,55 @@
|
||||
if(NOT DEFINED cpack)
|
||||
message(FATAL_ERROR "cpack not defined")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED dir)
|
||||
message(FATAL_ERROR "dir not defined")
|
||||
endif()
|
||||
|
||||
# Analyze 'cpack --help' output for list of available generators:
|
||||
#
|
||||
execute_process(COMMAND ${cpack} --help
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE stdout
|
||||
ERROR_VARIABLE stderr
|
||||
WORKING_DIRECTORY ${dir})
|
||||
|
||||
string(REPLACE ";" "\\;" stdout "${stdout}")
|
||||
string(REPLACE "\n" "E;" stdout "${stdout}")
|
||||
|
||||
set(collecting 0)
|
||||
set(generators)
|
||||
foreach(eline ${stdout})
|
||||
string(REGEX REPLACE "^(.*)E$" "\\1" line "${eline}")
|
||||
if(collecting AND NOT line STREQUAL "")
|
||||
string(REGEX REPLACE "^ ([^ ]+) += (.*)$" "\\1" gen "${line}")
|
||||
string(REGEX REPLACE "^ ([^ ]+) += (.*)$" "\\2" doc "${line}")
|
||||
set(generators ${generators} ${gen})
|
||||
endif()
|
||||
if(line STREQUAL "Generators")
|
||||
set(collecting 1)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Call cpack with -G on each available generator. We do not care if this
|
||||
# succeeds or not. We expect it *not* to succeed if the underlying packaging
|
||||
# tools are not installed on the system... This test is here simply to add
|
||||
# coverage for the various cpack generators, even/especially to test ones
|
||||
# where the tools are not installed.
|
||||
#
|
||||
message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
|
||||
|
||||
message(STATUS "CPack generators='${generators}'")
|
||||
|
||||
foreach(g ${generators})
|
||||
message(STATUS "Calling cpack -G ${g}...")
|
||||
execute_process(COMMAND ${cpack} -G ${g}
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_VARIABLE stdout
|
||||
ERROR_VARIABLE stderr
|
||||
WORKING_DIRECTORY ${dir})
|
||||
message(STATUS "result='${result}'")
|
||||
message(STATUS "stdout='${stdout}'")
|
||||
message(STATUS "stderr='${stderr}'")
|
||||
message(STATUS "")
|
||||
endforeach()
|
@ -0,0 +1 @@
|
||||
garbage - obviously this should not compile as is
|
@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
unsigned int i = 0; // "i<argc" should produce a "signed/unsigned comparison" warning
|
||||
for (; i<argc; ++i)
|
||||
{
|
||||
fprintf(stdout, "%s\n", argv[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
|
||||
# CTestConfig.cmake settings:
|
||||
set(CTEST_PROJECT_NAME "SmallAndFast")
|
||||
|
||||
# Intentionally leave out other upload-related CTestConfig.cmake settings
|
||||
# so that the ctest_submit call below fails with an error message...
|
||||
#
|
||||
set(CTEST_DROP_METHOD "@drop_method@")
|
||||
|
||||
# Settings:
|
||||
SET(CTEST_USE_LAUNCHERS 1)
|
||||
|
||||
# Emit these compiler warnings:
|
||||
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -Wall")
|
||||
|
||||
SET(CTEST_SITE "@SITE@")
|
||||
SET(CTEST_BUILD_NAME "CTestTestLaunchers-@drop_method@")
|
||||
|
||||
SET(CTEST_SOURCE_DIRECTORY "@source@")
|
||||
SET(CTEST_BINARY_DIRECTORY "@build@")
|
||||
SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
|
||||
SET(CTEST_CMAKE_GENERATOR "@CMAKE_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})
|
||||
|
||||
CTEST_START(Experimental)
|
||||
|
||||
# explicitly do not use CTEST_UPDATE - avoid network activity
|
||||
|
||||
CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}"
|
||||
OPTIONS "-DCTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS};-DSAF_INTENTIONAL_COMPILE_ERROR:BOOL=ON;-DSAF_INTENTIONAL_COMPILE_WARNING:BOOL=ON"
|
||||
RETURN_VALUE res)
|
||||
CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
|
||||
CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
|
||||
CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
|
||||
CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" @ctest_coverage_labels_args@ RETURN_VALUE res)
|
||||
|
||||
# ok to call ctest_submit - still avoids network activity because there is
|
||||
# not a valid drop location given above...
|
||||
CTEST_SUBMIT(RETURN_VALUE res)
|
@ -0,0 +1,2 @@
|
||||
SET(CTEST_RUN_CURRENT_SCRIPT 0)
|
||||
MESSAGE("hello world")
|
@ -0,0 +1,2 @@
|
||||
SET(CTEST_RUN_CURRENT_SCRIPT 0)
|
||||
CTEST_RUN_SCRIPT("CTestTestRunScript/hello.cmake" RETURN_VALUE res RETURN_VALUE)
|
@ -0,0 +1,11 @@
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
PROJECT(CTestTestSubdir)
|
||||
|
||||
SET(DART_ROOT "" CACHE STRING "" FORCE)
|
||||
ENABLE_TESTING()
|
||||
INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
|
||||
|
||||
GET_FILENAME_COMPONENT(CTEST_COMMAND "${CMAKE_COMMAND}" PATH)
|
||||
SET(CTEST_COMMAND "${CTEST_COMMAND}/ctest")
|
||||
|
||||
ADD_SUBDIRECTORY(subdir)
|
@ -0,0 +1,7 @@
|
||||
set(CTEST_PROJECT_NAME "CTestTestSubdir")
|
||||
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)
|
@ -0,0 +1,2 @@
|
||||
ADD_EXECUTABLE (main main.c)
|
||||
ADD_TEST (TestMain main)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue