complex: Remove ancient unused ComplexRelativePaths test

This commit is contained in:
Brad King 2011-12-23 14:13:06 -05:00
parent 4e98500012
commit 6a7582124c
43 changed files with 4 additions and 2481 deletions

View File

@ -814,18 +814,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# --build-project ConvLibrary
# --test-command bartest)
# ADD_TEST(complexRelativePaths ${CMAKE_CTEST_COMMAND}
# --build-and-test
# "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths"
# "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths"
# --build-generator ${CMAKE_TEST_GENERATOR}
# --build-project complex
# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
# --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths/bin"
# --build-options -DCMAKE_USE_RELATIVE_PATHS:BOOL=ON
# --test-command complex)
ENDIF(NOT COMPILER_IS_COMO)
ADD_TEST(Example ${CMAKE_CTEST_COMMAND}

View File

@ -839,8 +839,7 @@ int main()
"FILENAME_VAR_PATH_NAME is not defined.");
#else
if((strcmp(FILENAME_VAR_PATH_NAME, "Complex") == 0) ||
(strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0) ||
(strcmp(FILENAME_VAR_PATH_NAME, "ComplexRelativePaths") == 0))
(strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0))
{
cmPassed("FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME);
}
@ -901,8 +900,7 @@ int main()
"PATH_VAR_NAME is not defined.");
#else
if((strcmp(PATH_VAR_NAME, "Complex") == 0) ||
(strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0) ||
(strcmp(PATH_VAR_NAME, "ComplexRelativePaths") == 0))
(strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0))
{
cmPassed("PATH_VAR_NAME == ", PATH_VAR_NAME);
}

View File

@ -839,8 +839,7 @@ int main()
"FILENAME_VAR_PATH_NAME is not defined.");
#else
if((strcmp(FILENAME_VAR_PATH_NAME, "Complex") == 0) ||
(strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0) ||
(strcmp(FILENAME_VAR_PATH_NAME, "ComplexRelativePaths") == 0))
(strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0))
{
cmPassed("FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME);
}
@ -901,8 +900,7 @@ int main()
"PATH_VAR_NAME is not defined.");
#else
if((strcmp(PATH_VAR_NAME, "Complex") == 0) ||
(strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0) ||
(strcmp(PATH_VAR_NAME, "ComplexRelativePaths") == 0))
(strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0))
{
cmPassed("PATH_VAR_NAME == ", PATH_VAR_NAME);
}

File diff suppressed because one or more lines are too long

View File

@ -1,34 +0,0 @@
# This is the CMakeCache file.
# For build in directory: d:/build/kitware/cmake/CMake-nmake/Tests/Complex
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a varible in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//A var.
CACHE_TEST_VAR1:STRING=foo
//A var.
CACHE_TEST_VAR2:FILEPATH=bar
//A var.
CACHE_TEST_VAR3:BOOL=1
//A var.
CACHE_TEST_VAR_EXCLUDED:BOOL=1
########################
# INTERNAL cache entries
########################
//A var.
CACHE_TEST_VAR_INTERNAL:INTERNAL=bar

View File

@ -1,7 +0,0 @@
// Include code from a header that should not be compiled separately.
#include "A.hh"
int main()
{
return A();
}

View File

@ -1,4 +0,0 @@
// This header should not be compiled directly but through inclusion
// in A.cxx through A.hh.
extern int A();
int A() { return 10; }

View File

@ -1,2 +0,0 @@
// This header should not be compiled directly but through inclusion in A.cxx
#include "A.h"

View File

@ -1 +0,0 @@
This file should not be compiled!

View File

@ -1,183 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 1.3)
#
# Create exe.
#
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
IF(COMPLEX_TEST_CMAKELIB)
# Link to CMake lib
LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source)
LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source/kwsys)
LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmexpat)
LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmzlib)
# prefer the new curl if it is around
IF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0)
LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0/lib)
ENDIF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0)
IF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl)
LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmcurl)
ENDIF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl)
LINK_DIRECTORIES(
${Complex_BINARY_DIR}/../../Utilities/cmlibarchive/libarchive
${Complex_BINARY_DIR}/../../Utilities/cmbzip2
)
ENDIF(COMPLEX_TEST_CMAKELIB)
# Create an imported target for if(TARGET) test below.
ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED)
# Test if(TARGET) command.
IF(NOT TARGET CMakeTestLibrary)
MESSAGE(FATAL_ERROR "IF(NOT TARGET CMakeTestLibrary) returned true!")
ENDIF(NOT TARGET CMakeTestLibrary)
IF(NOT TARGET ExeImportedTarget)
MESSAGE(FATAL_ERROR "IF(NOT TARGET ExeImportedTarget) returned true!")
ENDIF(NOT TARGET ExeImportedTarget)
IF(TARGET LibImportedTarget)
MESSAGE(FATAL_ERROR "IF(TARGET LibImportedTarget) returned true!")
ENDIF(TARGET LibImportedTarget)
IF(TARGET NotATarget)
MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!")
ENDIF(TARGET NotATarget)
# Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
LINK_LIBRARIES(${COMPLEX_LIBS})
# Test forcing a .cxx file to not build.
SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES
HEADER_FILE_ONLY 1)
ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt)
ADD_EXECUTABLE(complex complex testcflags.c )
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx)
IF(COMPLEX_TEST_CMAKELIB)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmlibarchive cmbzip2 cmcurl)
ENDIF(COMPLEX_TEST_CMAKELIB)
IF (UNIX)
TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS})
ELSE(UNIX)
IF (NOT BORLAND)
IF(NOT MINGW)
TARGET_LINK_LIBRARIES(complex rpcrt4.lib)
ENDIF(NOT MINGW)
ENDIF(NOT BORLAND)
ENDIF (UNIX)
# Test linking to static lib when a shared lib has the same name.
IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC)
TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic)
ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
# can we get the path to a source file
GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION)
IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
ADD_DEFINITIONS(-DCMAKE_FOUND_ACXX)
ENDIF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
# get the directory parent
GET_DIRECTORY_PROPERTY(P_VALUE PARENT_DIRECTORY)
IF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
ADD_DEFINITIONS(-DCMAKE_FOUND_PARENT)
ENDIF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}")
# get the stack of listfiles
INCLUDE(Included.cmake)
IF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
ADD_DEFINITIONS(-DCMAKE_FOUND_LISTFILE_STACK)
ENDIF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake")
# Test add/remove definitions.
ADD_DEFINITIONS(
-DCOMPLEX_DEFINED_PRE
-DCOMPLEX_DEFINED
-DCOMPLEX_DEFINED_POST
-DCOMPLEX_DEFINED
)
REMOVE_DEFINITIONS(-DCOMPLEX_DEFINED)
# Test pre-build/pre-link/post-build rules for an executable.
ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD
COMMAND ${CREATE_FILE_EXE}
ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt")
ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD
COMMAND ${CREATE_FILE_EXE}
ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt")
ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD
COMMAND ${CREATE_FILE_EXE}
ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt")
ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy
"${Complex_BINARY_DIR}/Executable/postbuild.txt"
"${Complex_BINARY_DIR}/Executable/postbuild2.txt")
SET_SOURCE_FILES_PROPERTIES(complex
COMPILE_FLAGS
"-DFILE_HAS_EXTRA_COMPILE_FLAGS"
#" -DFILE_DEFINE_STRING=\\\"hello\\\""
OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
)
SET_TARGET_PROPERTIES(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG")
ADD_CUSTOM_COMMAND(
TARGET complex
SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
OUTPUTS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
DEPENDS ${CMAKE_COMMAND}
)
# Test creating an executable that is not built by default.
ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx)
TARGET_LINK_LIBRARIES(notInAllExe notInAllLib)
# Test user-value flag mapping for the VS IDE.
IF(MSVC)
SET_TARGET_PROPERTIES(notInAllExe PROPERTIES
LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT")
ENDIF(MSVC)
# Test creating a custom target that builds not-in-all targets.
ADD_CUSTOM_TARGET(notInAllCustom)
ADD_DEPENDENCIES(notInAllCustom notInAllExe)
#
# Output the files required by 'complex' to a file.
#
# This test has been moved to the 'required' subdir so that it
# has no side-effects on the current Makefile (duplicated source file
# due to source list expansion done twice).
#
ADD_SUBDIRECTORY(Temp)
IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
ADD_EXECUTABLE(testSystemDir testSystemDir.cxx)
SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
#
# Extra coverage.Not used.
#
INSTALL_TARGETS(/tmp complex)
INSTALL_PROGRAMS(/tmp complex)
CONFIGURE_FILE(
${Complex_SOURCE_DIR}/Executable/cmVersion.h.in
${Complex_BINARY_DIR}/cmVersion.h)
SOURCE_GROUP(A_GROUP ".cxx")
SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx")
SOURCE_GROUP(C_GROUP FILES complex.cxx)
FILE(WRITE ${Complex_BINARY_DIR}/A/libA.a "test")
FILE(WRITE ${Complex_BINARY_DIR}/A/libC.a "test")
FILE(WRITE ${Complex_BINARY_DIR}/B/libB.a "test")
FILE(WRITE ${Complex_BINARY_DIR}/B/libA.a "test")
FILE(WRITE ${Complex_BINARY_DIR}/C/libC.a "test")
FILE(WRITE ${Complex_BINARY_DIR}/C/libB.a "test")

View File

@ -1,2 +0,0 @@
GET_DIRECTORY_PROPERTY(LF_VALUE LISTFILE_STACK)

View File

@ -1,4 +0,0 @@
int NameConflictTest1()
{
return 0;
}

View File

@ -1,4 +0,0 @@
int NameConflictTest2()
{
return 0;
}

View File

@ -1,8 +0,0 @@
#
# Output the files required by 'complex' to a file.
# The 'complex' executable will then test if this file exists and remove it.
# The contents of this file is not tested (absolute paths).
#
OUTPUT_REQUIRED_FILES(
${Complex_SOURCE_DIR}/Executable/complex.cxx
${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt)

View File

@ -1 +0,0 @@
#define CMAKE_MINIMUM_REQUIRED_VERSION "${CMAKE_MINIMUM_REQUIRED_VERSION}"

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
#if 0
#include "cmMissingHeader.h"
#endif
int main(int , char**)
{
return 0;
}

View File

@ -1 +0,0 @@
#error "This file should not be compiled."

View File

@ -1,10 +0,0 @@
extern int notInAllLibFunc();
int main()
{
return notInAllLibFunc();
}
#if 1
# error "This target should not be compiled by ALL."
#endif

View File

@ -1,3 +0,0 @@
#include <testSystemDir.h>
int main() { return foo(); }

View File

@ -1,26 +0,0 @@
#include <string.h>
int TestTargetCompileFlags(char* m)
{
#ifndef COMPLEX_TARGET_FLAG
strcpy(m, "CMAKE SET_TARGET_PROPERTIES COMPILE_FLAGS did not work");
return 0;
#endif
strcpy(m, "CMAKE SET_TARGET_PROPERTIES COMPILE_FLAGS worked");
return 1;
}
int TestCFlags(char* m)
{
/* TEST_CXX_FLAGS should not be defined in a c file */
#ifdef TEST_CXX_FLAGS
strcpy(m, "CMake CMAKE_CXX_FLAGS (TEST_CXX_FLAGS) found in c file.");
return 0;
#endif
/* TEST_C_FLAGS should be defined in a c file */
#ifndef TEST_C_FLAGS
strcpy(m, "CMake CMAKE_C_FLAGS (TEST_C_FLAGS) not found in c file.");
return 0;
#endif
return 1;
}

View File

@ -1,141 +0,0 @@
REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN)
#
# Small utility used to create file
# UTILITY_SOURCE is used for coverage and for getting the exact name
# of the executable.
#
UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
ADD_EXECUTABLE(create_file create_file.cxx)
SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".")
#
# Create static library
# SOURCE_FILES_REMOVE is used for Coverage. empty.h is included for coverage
#
AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
SET(LibrarySources ${LibrarySources}
file2
empty
create_file.cxx
GENERATED
nonexisting_file)
REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file)
ADD_LIBRARY(CMakeTestLibrary ${LibrarySources})
IF(WIN32)
IF(NOT CYGWIN)
IF(NOT BORLAND)
IF(NOT MINGW)
TARGET_LINK_LIBRARIES(CMakeTestLibrary
debug
user32.lib)
TARGET_LINK_LIBRARIES(CMakeTestLibrary
optimized
kernel32.lib)
ENDIF(NOT MINGW)
ENDIF(NOT BORLAND)
ENDIF(NOT CYGWIN)
ENDIF(WIN32)
#
# Create shared library
#
SET(SharedLibrarySources sharedFile)
ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
DEFINE_PROPERTY(
TARGET PROPERTY FOO
BRIEF_DOCS "a test property"
FULL_DOCS "A simple etst proerty that means nothign and is used for nothing"
)
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
IF(NOT BEOS AND NOT WIN32) # No libm on BeOS.
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
ENDIF(NOT BEOS AND NOT WIN32)
GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
IF(${FOO_BAR_VAR} MATCHES "BAR")
ELSE(${FOO_BAR_VAR} MATCHES "BAR")
MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
ENDIF(${FOO_BAR_VAR} MATCHES "BAR")
# Create static and shared lib of same name.
IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c)
ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c)
SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared
PROPERTIES OUTPUT_NAME CMakeTestLink)
ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
#
# Attach pre-build/pre-link/post-build custom-commands to the lib.
# Each runs ${CREATE_FILE_EXE} which will create a file.
# The 'complex' executable will then test if this file exists and remove it.
#
ADD_DEPENDENCIES(CMakeTestLibraryShared create_file)
MESSAGE("complex bin dir is ${Complex_BINARY_DIR}")
ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD
COMMAND ${CREATE_FILE_EXE}
ARGS "${Complex_BINARY_DIR}/Library/prebuild.txt")
ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD
COMMAND ${CREATE_FILE_EXE}
ARGS "${Complex_BINARY_DIR}/Library/prelink.txt")
ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
COMMAND ${CREATE_FILE_EXE}
ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt")
ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy
"${Complex_BINARY_DIR}/Library/postbuild.txt"
"${Complex_BINARY_DIR}/Library/postbuild2.txt")
#
# Add a custom target.
# It runs ${CREATE_FILE_EXE} which will create a file.
# The 'complex' executable will then test if this file exists and remove it.
#
ADD_CUSTOM_TARGET(custom_target1
ALL
${CREATE_FILE_EXE}
"${Complex_BINARY_DIR}/Library/custom_target1.txt")
ADD_DEPENDENCIES(custom_target1 create_file)
#
# Extra coverage
#
SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1)
INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h)
INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h)
# Test creating a library that is not built by default.
ADD_LIBRARY(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx)
# Create an imported target for if(TARGET) test in Executable dir.
# That test should not see this target.
ADD_LIBRARY(LibImportedTarget UNKNOWN IMPORTED)
# Test generation of preprocessed sources.
IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
# Skip running this part of the test on certain platforms
# until they are fixed.
SET(MAYBE_ALL ALL)
LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT)
IF(ARCH_COUNT GREATER 1)
# OSX does not support preprocessing more than one architecture.
SET(MAYBE_ALL)
ENDIF(ARCH_COUNT GREATER 1)
# Custom target to try preprocessing invocation.
ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL}
COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)

View File

@ -1,4 +0,0 @@
int file1()
{
return 1;
}

View File

@ -1 +0,0 @@
int file1();

View File

@ -1,2 +0,0 @@
// Purposely leave off the return type to create a warning.
foo() { return 0; }

View File

@ -1,8 +0,0 @@
int TestLinkGetType()
{
#ifdef CMakeTestLinkShared_EXPORTS
return 0;
#else
return 1;
#endif
}

View File

@ -1,28 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
if (argc < 2)
{
fprintf(stderr, "Missing name of file to create.\n");
return EXIT_FAILURE;
}
FILE *stream = fopen(argv[1], "w");
if(stream == NULL)
{
fprintf(stderr, "Unable to open %s for writing!\n", argv[1]);
return EXIT_FAILURE;
}
if(fclose(stream))
{
fprintf(stderr, "Unable to close %s!\n", argv[1]);
return EXIT_FAILURE;
}
fprintf(stdout, ">> Creating %s!\n", argv[1]);
return EXIT_SUCCESS;
}

View File

@ -1,10 +0,0 @@
#include <string.h>
#ifdef CMAKE_IS_REALLY_FUN
This is a problem. Looks like REMOVE_DEFINITION does not work
#endif
int file2()
{
return 1;
}

View File

@ -1 +0,0 @@
int file2();

View File

@ -1,6 +0,0 @@
#include "moduleFile.h"
int ModuleFunction()
{
return 1;
}

View File

@ -1,12 +0,0 @@
#if defined(_WIN32) || defined(WIN32) /* Win32 version */
#ifdef CMakeTestModule_EXPORTS
# define CMakeTest_EXPORT __declspec(dllexport)
#else
# define CMakeTest_EXPORT __declspec(dllimport)
#endif
#else
/* unix needs nothing */
#define CMakeTest_EXPORT
#endif
CMakeTest_EXPORT int ModuleFunction();

View File

@ -1,5 +0,0 @@
int notInAllLibFunc() { return 0; }
#if 1
# error "This target should not be compiled by ALL."
#endif

View File

@ -1,6 +0,0 @@
#include "sharedFile.h"
int sharedFunction()
{
return 1;
}

View File

@ -1,12 +0,0 @@
#if defined(_WIN32) || defined(WIN32) /* Win32 version */
#ifdef CMakeTestLibraryShared_EXPORTS
# define CMakeTest_EXPORT __declspec(dllexport)
#else
# define CMakeTest_EXPORT __declspec(dllimport)
#endif
#else
/* unix needs nothing */
#define CMakeTest_EXPORT
#endif
CMakeTest_EXPORT int sharedFunction();

View File

@ -1,13 +0,0 @@
#include "testConly.h"
#include <stdio.h>
int CsharedFunction()
{
#ifndef TEST_C_FLAGS
printf("TEST_C_FLAGS failed\n");
return 0;
#else
printf("Passed: TEST_C_FLAGS passed\n");
#endif
return 1;
}

View File

@ -1,13 +0,0 @@
#if defined(_WIN32) || defined(WIN32) /* Win32 version */
#ifdef CMakeTestCLibraryShared_EXPORTS
# define CMakeTest_EXPORT __declspec(dllexport)
#else
# define CMakeTest_EXPORT __declspec(dllimport)
#endif
#else
/* unix needs nothing */
#define CMakeTest_EXPORT
#endif
CMakeTest_EXPORT int CsharedFunction();

View File

@ -1,7 +0,0 @@
SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
FILE(READ ${TEST_FILE} CONTENTS)
IF("${CONTENTS}" MATCHES "Unable to close")
MESSAGE(STATUS "${TEST_FILE} created successfully!")
ELSE("${CONTENTS}" MATCHES "Unable to close")
MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!")
ENDIF("${CONTENTS}" MATCHES "Unable to close")

View File

@ -1,198 +0,0 @@
#
# Test SET
#
SET (ZERO_VAR 0)
SET (ZERO_VAR2 0)
IF(ZERO_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED)
ELSE(ZERO_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED)
ENDIF(ZERO_VAR)
SET(ONE_VAR 1)
SET(ONE_VAR2 1)
SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
#
# Test VARIABLE_REQUIRES
#
VARIABLE_REQUIRES(ONE_VAR
ONE_VAR_IS_DEFINED ONE_VAR)
#
# Test various IF/ELSE combinations
#
IF(NOT ZERO_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT)
ELSE(NOT ZERO_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT)
ENDIF(NOT ZERO_VAR)
IF(NOT ONE_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT2)
ELSE(NOT ONE_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT2)
ENDIF(NOT ONE_VAR)
IF(ONE_VAR AND ONE_VAR2)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND)
ELSE(ONE_VAR AND ONE_VAR2)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND)
ENDIF(ONE_VAR AND ONE_VAR2)
IF(ONE_VAR AND ZERO_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND2)
ELSE(ONE_VAR AND ZERO_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND2)
ENDIF(ONE_VAR AND ZERO_VAR)
IF(ZERO_VAR OR ONE_VAR2)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR)
ELSE(ZERO_VAR OR ONE_VAR2)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR)
ENDIF(ZERO_VAR OR ONE_VAR2)
IF(ZERO_VAR OR ZERO_VAR2)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR2)
ELSE(ZERO_VAR OR ZERO_VAR2)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR2)
ENDIF(ZERO_VAR OR ZERO_VAR2)
IF(STRING_VAR MATCHES "^CMake")
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES)
ELSE(STRING_VAR MATCHES "^CMake")
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES)
ENDIF(STRING_VAR MATCHES "^CMake")
IF(STRING_VAR MATCHES "^foo")
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES2)
ELSE(STRING_VAR MATCHES "^foo")
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES2)
ENDIF(STRING_VAR MATCHES "^foo")
IF(COMMAND "IF")
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND)
ELSE(COMMAND "IF")
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND)
ENDIF(COMMAND "IF")
IF(COMMAND "ROQUEFORT")
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND2)
ELSE(COMMAND "ROQUEFORT")
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND2)
ENDIF(COMMAND "ROQUEFORT")
IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS)
ELSE(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS)
ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
IF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS2)
ELSE(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS2)
ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
IF (IS_DIRECTORY ${Complex_SOURCE_DIR})
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY)
ENDIF (IS_DIRECTORY ${Complex_SOURCE_DIR})
IF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY2)
ENDIF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake)
SET (SNUM1_VAR "1")
SET (SNUM2_VAR "2")
SET (SNUM3_VAR "1")
IF (SNUM1_VAR LESS SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS)
ELSE (SNUM1_VAR LESS SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS)
ENDIF (SNUM1_VAR LESS SNUM2_VAR)
IF (SNUM2_VAR LESS SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS2)
ELSE (SNUM2_VAR LESS SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS2)
ENDIF (SNUM2_VAR LESS SNUM1_VAR)
IF (SNUM2_VAR GREATER SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER)
ELSE (SNUM2_VAR GREATER SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER)
ENDIF (SNUM2_VAR GREATER SNUM1_VAR)
IF (SNUM2_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
ELSE (SNUM2_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
ENDIF (SNUM2_VAR EQUAL SNUM1_VAR)
IF (SNUM3_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
ELSE (SNUM3_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
ENDIF (SNUM3_VAR EQUAL SNUM1_VAR)
IF (SNUM1_VAR GREATER SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2)
ELSE (SNUM1_VAR GREATER SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2)
ENDIF (SNUM1_VAR GREATER SNUM2_VAR)
SET (SSTR1_VAR "abc")
SET (SSTR2_VAR "bcd")
IF (SSTR1_VAR STRLESS SSTR2_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS)
ELSE (SSTR1_VAR STRLESS SSTR2_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS)
ENDIF (SSTR1_VAR STRLESS SSTR2_VAR)
IF (SSTR2_VAR STRLESS SSTR1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS2)
ELSE (SSTR2_VAR STRLESS SSTR1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS2)
ENDIF (SSTR2_VAR STRLESS SSTR1_VAR)
IF (SSTR2_VAR STRGREATER SSTR1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER)
ELSE (SSTR2_VAR STRGREATER SSTR1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER)
ENDIF (SSTR2_VAR STRGREATER SSTR1_VAR)
IF (SSTR1_VAR STRGREATER SSTR2_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER2)
ELSE (SSTR1_VAR STRGREATER SSTR2_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER2)
ENDIF (SSTR1_VAR STRGREATER SSTR2_VAR)
#
# Test FOREACH
#
FOREACH (INDEX 1 2)
SET(FOREACH_VAR${INDEX} "VALUE${INDEX}")
ENDFOREACH(INDEX)
SET(FOREACH_CONCAT "")
FOREACH (INDEX a;b;c;d;e;f;g)
SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}")
ENDFOREACH(INDEX)
#
# Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#
FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR})
GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH)
GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME)
GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME)
GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT)
GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE)
FIND_PATH(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR})
GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME)

View File

@ -1,87 +0,0 @@
// Test SET, VARIABLE_REQUIRES
#cmakedefine ONE_VAR
#cmakedefine ONE_VAR_IS_DEFINED
#cmakedefine ZERO_VAR
#cmakedefine COMPLEX_TEST_CMAKELIB
#define STRING_VAR "${STRING_VAR}"
// Test FOREACH
#define FOREACH_VAR1 "${FOREACH_VAR1}"
#define FOREACH_VAR2 "${FOREACH_VAR2}"
#define FOREACH_CONCAT "${FOREACH_CONCAT}"
// Test WHILE
#define WHILE_VALUE ${while_var}
// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations
#define FILENAME_VAR_PATH_NAME "${FILENAME_VAR_PATH_NAME}"
#define FILENAME_VAR_NAME "${FILENAME_VAR_NAME}"
#define FILENAME_VAR_EXT "${FILENAME_VAR_EXT}"
#define FILENAME_VAR_NAME_WE "${FILENAME_VAR_NAME_WE}"
#define PATH_VAR_NAME "${PATH_VAR_NAME}"
// Test LOAD_CACHE
#define CACHE_TEST_VAR1 "${CACHE_TEST_VAR1}"
#define CACHE_TEST_VAR2 "${CACHE_TEST_VAR2}"
#define CACHE_TEST_VAR3 "${CACHE_TEST_VAR3}"
#cmakedefine CACHE_TEST_VAR_EXCLUDED
#define CACHE_TEST_VAR_INTERNAL "${CACHE_TEST_VAR_INTERNAL}"
// Test internal CMake vars from C++ flags
#cmakedefine CMAKE_NO_STD_NAMESPACE
#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS
#cmakedefine CMAKE_NO_ANSI_STRING_STREAM
#cmakedefine CMAKE_NO_ANSI_FOR_SCOPE
#cmakedefine01 SHOULD_BE_ZERO
#cmakedefine01 SHOULD_BE_ONE
// Needed to check for files
#define BINARY_DIR "${Complex_BINARY_DIR}"
// Test FIND_LIBRARY
#define FIND_DUMMY_LIB "${FIND_DUMMY_LIB}"
// Test SET_SOURCE_FILES_PROPERTIES
#cmakedefine FILE_HAS_ABSTRACT
#cmakedefine FILE_HAS_WRAP_EXCLUDE
#define FILE_COMPILE_FLAGS "${FILE_COMPILE_FLAGS}"
#define TEST_SEP "${TEST_SEP}"
// Test registry read
#if defined(_WIN32) && !defined(__CYGWIN__)
#define REGISTRY_TEST_PATH "${REGISTRY_TEST_PATH}"
#endif
// Test Remove command
#define REMOVE_STRING "${REMOVE_STRING}"
// Test IF inside FOREACH
#cmakedefine IF_INSIDE_FOREACH_THEN_EXECUTED
#cmakedefine IF_INSIDE_FOREACH_ELSE_EXECUTED
// Test SET CACHE FORCE
#cmakedefine FORCE_TEST
#define CMAKE_GENERATOR "${CMAKE_GENERATOR}"
#define CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_MODULE_PREFIX}"
#define CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_MODULE_SUFFIX}"
// test elseif
#cmakedefine ELSEIF_RESULT
// test parenthesis in conditionals
#cmakedefine CONDITIONAL_PARENTHESES

View File

@ -1 +0,0 @@
#define STRING_WITH_QUOTES "${STRING_WITH_QUOTES}"

View File

@ -1 +0,0 @@
#define GENERATED_HEADER_INCLUDED