diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-01-17 15:21:45 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-01-17 15:21:45 (GMT) |
commit | 9891260a6dab66c9ea44b5c2e244f3128625baf5 (patch) | |
tree | 930651e4383fe1d904cc9c493bd859cb97b530af /Tests | |
parent | 2694ad76c538333d3ff45613bd1201f97af003cd (diff) | |
download | CMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.zip CMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.tar.gz CMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.tar.bz2 |
ENH: add support for watcom wmake and wcl386
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Complex/Executable/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/Complex/Executable/complex.cxx | 121 | ||||
-rw-r--r-- | Tests/Complex/cmTestConfigure.h.in | 1 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/Executable/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/Executable/complex.cxx | 121 | ||||
-rw-r--r-- | Tests/ComplexOneConfig/cmTestConfigure.h.in | 1 | ||||
-rw-r--r-- | Tests/ComplexRelativePaths/Executable/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/ComplexRelativePaths/Executable/complex.cxx | 121 | ||||
-rw-r--r-- | Tests/ComplexRelativePaths/cmTestConfigure.h.in | 1 | ||||
-rw-r--r-- | Tests/LoadCommand/CMakeCommands/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/LoadCommand/CMakeCommands/cmTestCommand.c | 10 | ||||
-rw-r--r-- | Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c | 10 | ||||
-rw-r--r-- | Tests/SubDir/AnotherSubdir/pair_int.int.c | 6 | ||||
-rw-r--r-- | Tests/SubDir/CMakeLists.txt | 37 | ||||
-rw-r--r-- | Tests/SubDir/ThirdSubDir/pair_int.int1.c | 6 | ||||
-rw-r--r-- | Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c | 6 |
17 files changed, 293 insertions, 177 deletions
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index e3e11ea..78ed587 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -19,7 +19,10 @@ LINK_LIBRARIES(${COMPLEX_LIBS}) ADD_EXECUTABLE(A A.cxx) ADD_EXECUTABLE(complex complex testcflags.c) ADD_EXECUTABLE(complex.file complex.file.cxx) -TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) +IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) +ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + IF (UNIX) TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) ELSE(UNIX) diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 9fac9ab..06af8ec 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -8,19 +8,44 @@ extern "C" { #include "testConly.h" } +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR #include "cmStandardIncludes.h" #include "cmSystemTools.h" #include "cmDynamicLoader.h" #include "cmSystemTools.h" #include "cmOrderLinkDirectories.h" #include "cmGeneratedFileStream.h" +#else +#include <vector> +#include <string> +#include <iostream> +#include <string.h> +#endif + int cm_passed = 0; int cm_failed = 0; +// ====================================================================== + +void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") +{ + std::cout << "FAILED: " << Message << m2 << m3 << "\n"; + cm_failed++; +} + +// ====================================================================== + +void cmPassed(const char* Message, const char* m2="") +{ + std::cout << "Passed: " << Message << m2 << "\n"; + cm_passed++; +} #ifndef CMAKE_IS_REALLY_FUN This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work #endif + +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // Here is a stupid function that tries to use std::string methods // so that the dec cxx compiler will instantiate the stuff that // we are using from the CMakeLib library.... @@ -99,43 +124,6 @@ bool TestLibraryOrder(bool shouldFail) return ret; } -void ForceStringUse() -{ - std::vector<std::string> v; - std::vector<std::string> v2; - v = v2; - std::string cachetest = CACHE_TEST_VAR_INTERNAL; - v.push_back(cachetest); - v2 = v; - std::string x(5,'x'); - char buff[5]; - x.copy(buff, 1, 0); - x[0] = 'a'; - std::string::size_type pos = 0; - x.replace(pos, pos, pos, 'x'); - std::string copy = cachetest; - cachetest.find("bar"); - cachetest.rfind("bar"); - copy.append(cachetest); - copy = cachetest.substr(0, cachetest.size()); -} - -// ====================================================================== - -void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") -{ - std::cout << "FAILED: " << Message << m2 << m3 << "\n"; - cm_failed++; -} - -// ====================================================================== - -void cmPassed(const char* Message, const char* m2="") -{ - std::cout << "Passed: " << Message << m2 << "\n"; - cm_passed++; -} - // ====================================================================== void TestAndRemoveFile(const char* filename) @@ -258,6 +246,30 @@ void TestCMGeneratedFileSTream() cmSystemTools::RemoveFile(file2tmp.c_str()); cmSystemTools::RemoveFile(file3tmp.c_str()); } +#endif + +void ForceStringUse() +{ + std::vector<std::string> v; + std::vector<std::string> v2; + v = v2; + std::string cachetest = CACHE_TEST_VAR_INTERNAL; + v.push_back(cachetest); + v2 = v; + std::string x(5,'x'); + char buff[5]; + x.copy(buff, 1, 0); + x[0] = 'a'; + std::string::size_type pos = 0; + x.replace(pos, pos, pos, 'x'); + std::string copy = cachetest; + cachetest.find("bar"); + cachetest.rfind("bar"); + copy.append(cachetest); + copy = cachetest.substr(0, cachetest.size()); +} + + // defined in testcflags.c extern "C" int TestCFlags(char* m); @@ -273,6 +285,7 @@ int main() #endif std::string exe = lib; +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // Test a single character executable to test a: in makefiles exe += "A"; exe += cmSystemTools::GetExecutableExtension(); @@ -352,6 +365,20 @@ int main() cmPassed("Call to C sharedFunction from shared library worked."); } + // ---------------------------------------------------------------------- + // Test cmSystemTools::UpperCase + std::string str = "abc"; + std::string strupper = "ABC"; + if(cmSystemTools::UpperCase(str) == strupper) + { + cmPassed("cmSystemTools::UpperCase is working"); + } + else + { + cmFailed("cmSystemTools::UpperCase is working"); + } +#endif + if(file1() != 1) { cmFailed("Call to file1 function from library failed."); @@ -926,6 +953,7 @@ int main() } #endif +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // ---------------------------------------------------------------------- // Some pre-build/pre-link/post-build custom-commands have been // attached to the lib (see Library/). @@ -955,7 +983,7 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt"); - + // ---------------------------------------------------------------------- // A directory has been created. @@ -971,6 +999,7 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); +#endif // ---------------------------------------------------------------------- // Test FIND_LIBRARY @@ -1088,19 +1117,6 @@ int main() // ---------------------------------------------------------------------- - // Test cmSystemTools::UpperCase - std::string str = "abc"; - std::string strupper = "ABC"; - if(cmSystemTools::UpperCase(str) == strupper) - { - cmPassed("cmSystemTools::UpperCase is working"); - } - else - { - cmFailed("cmSystemTools::UpperCase is working"); - } - - // ---------------------------------------------------------------------- // Test if IF command inside a FOREACH works. #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) cmPassed("IF inside a FOREACH block works"); @@ -1135,6 +1151,7 @@ int main() cmPassed("CMake SET CACHE FORCE"); #endif +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // first run with shouldFail = true, this will // run with A B C as set by the CMakeList.txt file. if(!TestLibraryOrder(true)) @@ -1156,9 +1173,9 @@ int main() { cmFailed("CMake cmOrderLinkDirectories failed."); } - // Test the generated file stream. TestCMGeneratedFileSTream(); +#endif // ---------------------------------------------------------------------- // Summary diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index eadd2f0..f2017ab 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -4,6 +4,7 @@ #cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ZERO_VAR +#cmakedefine CMAKE_TEST_DIFFERENT_GENERATOR #define STRING_VAR "${STRING_VAR}" // Test FOREACH diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index e3e11ea..78ed587 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -19,7 +19,10 @@ LINK_LIBRARIES(${COMPLEX_LIBS}) ADD_EXECUTABLE(A A.cxx) ADD_EXECUTABLE(complex complex testcflags.c) ADD_EXECUTABLE(complex.file complex.file.cxx) -TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) +IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) +ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + IF (UNIX) TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) ELSE(UNIX) diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 9fac9ab..06af8ec 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -8,19 +8,44 @@ extern "C" { #include "testConly.h" } +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR #include "cmStandardIncludes.h" #include "cmSystemTools.h" #include "cmDynamicLoader.h" #include "cmSystemTools.h" #include "cmOrderLinkDirectories.h" #include "cmGeneratedFileStream.h" +#else +#include <vector> +#include <string> +#include <iostream> +#include <string.h> +#endif + int cm_passed = 0; int cm_failed = 0; +// ====================================================================== + +void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") +{ + std::cout << "FAILED: " << Message << m2 << m3 << "\n"; + cm_failed++; +} + +// ====================================================================== + +void cmPassed(const char* Message, const char* m2="") +{ + std::cout << "Passed: " << Message << m2 << "\n"; + cm_passed++; +} #ifndef CMAKE_IS_REALLY_FUN This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work #endif + +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // Here is a stupid function that tries to use std::string methods // so that the dec cxx compiler will instantiate the stuff that // we are using from the CMakeLib library.... @@ -99,43 +124,6 @@ bool TestLibraryOrder(bool shouldFail) return ret; } -void ForceStringUse() -{ - std::vector<std::string> v; - std::vector<std::string> v2; - v = v2; - std::string cachetest = CACHE_TEST_VAR_INTERNAL; - v.push_back(cachetest); - v2 = v; - std::string x(5,'x'); - char buff[5]; - x.copy(buff, 1, 0); - x[0] = 'a'; - std::string::size_type pos = 0; - x.replace(pos, pos, pos, 'x'); - std::string copy = cachetest; - cachetest.find("bar"); - cachetest.rfind("bar"); - copy.append(cachetest); - copy = cachetest.substr(0, cachetest.size()); -} - -// ====================================================================== - -void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") -{ - std::cout << "FAILED: " << Message << m2 << m3 << "\n"; - cm_failed++; -} - -// ====================================================================== - -void cmPassed(const char* Message, const char* m2="") -{ - std::cout << "Passed: " << Message << m2 << "\n"; - cm_passed++; -} - // ====================================================================== void TestAndRemoveFile(const char* filename) @@ -258,6 +246,30 @@ void TestCMGeneratedFileSTream() cmSystemTools::RemoveFile(file2tmp.c_str()); cmSystemTools::RemoveFile(file3tmp.c_str()); } +#endif + +void ForceStringUse() +{ + std::vector<std::string> v; + std::vector<std::string> v2; + v = v2; + std::string cachetest = CACHE_TEST_VAR_INTERNAL; + v.push_back(cachetest); + v2 = v; + std::string x(5,'x'); + char buff[5]; + x.copy(buff, 1, 0); + x[0] = 'a'; + std::string::size_type pos = 0; + x.replace(pos, pos, pos, 'x'); + std::string copy = cachetest; + cachetest.find("bar"); + cachetest.rfind("bar"); + copy.append(cachetest); + copy = cachetest.substr(0, cachetest.size()); +} + + // defined in testcflags.c extern "C" int TestCFlags(char* m); @@ -273,6 +285,7 @@ int main() #endif std::string exe = lib; +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // Test a single character executable to test a: in makefiles exe += "A"; exe += cmSystemTools::GetExecutableExtension(); @@ -352,6 +365,20 @@ int main() cmPassed("Call to C sharedFunction from shared library worked."); } + // ---------------------------------------------------------------------- + // Test cmSystemTools::UpperCase + std::string str = "abc"; + std::string strupper = "ABC"; + if(cmSystemTools::UpperCase(str) == strupper) + { + cmPassed("cmSystemTools::UpperCase is working"); + } + else + { + cmFailed("cmSystemTools::UpperCase is working"); + } +#endif + if(file1() != 1) { cmFailed("Call to file1 function from library failed."); @@ -926,6 +953,7 @@ int main() } #endif +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // ---------------------------------------------------------------------- // Some pre-build/pre-link/post-build custom-commands have been // attached to the lib (see Library/). @@ -955,7 +983,7 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt"); - + // ---------------------------------------------------------------------- // A directory has been created. @@ -971,6 +999,7 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); +#endif // ---------------------------------------------------------------------- // Test FIND_LIBRARY @@ -1088,19 +1117,6 @@ int main() // ---------------------------------------------------------------------- - // Test cmSystemTools::UpperCase - std::string str = "abc"; - std::string strupper = "ABC"; - if(cmSystemTools::UpperCase(str) == strupper) - { - cmPassed("cmSystemTools::UpperCase is working"); - } - else - { - cmFailed("cmSystemTools::UpperCase is working"); - } - - // ---------------------------------------------------------------------- // Test if IF command inside a FOREACH works. #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) cmPassed("IF inside a FOREACH block works"); @@ -1135,6 +1151,7 @@ int main() cmPassed("CMake SET CACHE FORCE"); #endif +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // first run with shouldFail = true, this will // run with A B C as set by the CMakeList.txt file. if(!TestLibraryOrder(true)) @@ -1156,9 +1173,9 @@ int main() { cmFailed("CMake cmOrderLinkDirectories failed."); } - // Test the generated file stream. TestCMGeneratedFileSTream(); +#endif // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in index eadd2f0..f2017ab 100644 --- a/Tests/ComplexOneConfig/cmTestConfigure.h.in +++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in @@ -4,6 +4,7 @@ #cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ZERO_VAR +#cmakedefine CMAKE_TEST_DIFFERENT_GENERATOR #define STRING_VAR "${STRING_VAR}" // Test FOREACH diff --git a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt index e3e11ea..78ed587 100644 --- a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt @@ -19,7 +19,10 @@ LINK_LIBRARIES(${COMPLEX_LIBS}) ADD_EXECUTABLE(A A.cxx) ADD_EXECUTABLE(complex complex testcflags.c) ADD_EXECUTABLE(complex.file complex.file.cxx) -TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) +IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) +ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + IF (UNIX) TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) ELSE(UNIX) diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index 9fac9ab..06af8ec 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -8,19 +8,44 @@ extern "C" { #include "testConly.h" } +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR #include "cmStandardIncludes.h" #include "cmSystemTools.h" #include "cmDynamicLoader.h" #include "cmSystemTools.h" #include "cmOrderLinkDirectories.h" #include "cmGeneratedFileStream.h" +#else +#include <vector> +#include <string> +#include <iostream> +#include <string.h> +#endif + int cm_passed = 0; int cm_failed = 0; +// ====================================================================== + +void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") +{ + std::cout << "FAILED: " << Message << m2 << m3 << "\n"; + cm_failed++; +} + +// ====================================================================== + +void cmPassed(const char* Message, const char* m2="") +{ + std::cout << "Passed: " << Message << m2 << "\n"; + cm_passed++; +} #ifndef CMAKE_IS_REALLY_FUN This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work #endif + +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // Here is a stupid function that tries to use std::string methods // so that the dec cxx compiler will instantiate the stuff that // we are using from the CMakeLib library.... @@ -99,43 +124,6 @@ bool TestLibraryOrder(bool shouldFail) return ret; } -void ForceStringUse() -{ - std::vector<std::string> v; - std::vector<std::string> v2; - v = v2; - std::string cachetest = CACHE_TEST_VAR_INTERNAL; - v.push_back(cachetest); - v2 = v; - std::string x(5,'x'); - char buff[5]; - x.copy(buff, 1, 0); - x[0] = 'a'; - std::string::size_type pos = 0; - x.replace(pos, pos, pos, 'x'); - std::string copy = cachetest; - cachetest.find("bar"); - cachetest.rfind("bar"); - copy.append(cachetest); - copy = cachetest.substr(0, cachetest.size()); -} - -// ====================================================================== - -void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") -{ - std::cout << "FAILED: " << Message << m2 << m3 << "\n"; - cm_failed++; -} - -// ====================================================================== - -void cmPassed(const char* Message, const char* m2="") -{ - std::cout << "Passed: " << Message << m2 << "\n"; - cm_passed++; -} - // ====================================================================== void TestAndRemoveFile(const char* filename) @@ -258,6 +246,30 @@ void TestCMGeneratedFileSTream() cmSystemTools::RemoveFile(file2tmp.c_str()); cmSystemTools::RemoveFile(file3tmp.c_str()); } +#endif + +void ForceStringUse() +{ + std::vector<std::string> v; + std::vector<std::string> v2; + v = v2; + std::string cachetest = CACHE_TEST_VAR_INTERNAL; + v.push_back(cachetest); + v2 = v; + std::string x(5,'x'); + char buff[5]; + x.copy(buff, 1, 0); + x[0] = 'a'; + std::string::size_type pos = 0; + x.replace(pos, pos, pos, 'x'); + std::string copy = cachetest; + cachetest.find("bar"); + cachetest.rfind("bar"); + copy.append(cachetest); + copy = cachetest.substr(0, cachetest.size()); +} + + // defined in testcflags.c extern "C" int TestCFlags(char* m); @@ -273,6 +285,7 @@ int main() #endif std::string exe = lib; +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // Test a single character executable to test a: in makefiles exe += "A"; exe += cmSystemTools::GetExecutableExtension(); @@ -352,6 +365,20 @@ int main() cmPassed("Call to C sharedFunction from shared library worked."); } + // ---------------------------------------------------------------------- + // Test cmSystemTools::UpperCase + std::string str = "abc"; + std::string strupper = "ABC"; + if(cmSystemTools::UpperCase(str) == strupper) + { + cmPassed("cmSystemTools::UpperCase is working"); + } + else + { + cmFailed("cmSystemTools::UpperCase is working"); + } +#endif + if(file1() != 1) { cmFailed("Call to file1 function from library failed."); @@ -926,6 +953,7 @@ int main() } #endif +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // ---------------------------------------------------------------------- // Some pre-build/pre-link/post-build custom-commands have been // attached to the lib (see Library/). @@ -955,7 +983,7 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt"); - + // ---------------------------------------------------------------------- // A directory has been created. @@ -971,6 +999,7 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); +#endif // ---------------------------------------------------------------------- // Test FIND_LIBRARY @@ -1088,19 +1117,6 @@ int main() // ---------------------------------------------------------------------- - // Test cmSystemTools::UpperCase - std::string str = "abc"; - std::string strupper = "ABC"; - if(cmSystemTools::UpperCase(str) == strupper) - { - cmPassed("cmSystemTools::UpperCase is working"); - } - else - { - cmFailed("cmSystemTools::UpperCase is working"); - } - - // ---------------------------------------------------------------------- // Test if IF command inside a FOREACH works. #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) cmPassed("IF inside a FOREACH block works"); @@ -1135,6 +1151,7 @@ int main() cmPassed("CMake SET CACHE FORCE"); #endif +#ifndef CMAKE_TEST_DIFFERENT_GENERATOR // first run with shouldFail = true, this will // run with A B C as set by the CMakeList.txt file. if(!TestLibraryOrder(true)) @@ -1156,9 +1173,9 @@ int main() { cmFailed("CMake cmOrderLinkDirectories failed."); } - // Test the generated file stream. TestCMGeneratedFileSTream(); +#endif // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexRelativePaths/cmTestConfigure.h.in b/Tests/ComplexRelativePaths/cmTestConfigure.h.in index eadd2f0..f2017ab 100644 --- a/Tests/ComplexRelativePaths/cmTestConfigure.h.in +++ b/Tests/ComplexRelativePaths/cmTestConfigure.h.in @@ -4,6 +4,7 @@ #cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ZERO_VAR +#cmakedefine CMAKE_TEST_DIFFERENT_GENERATOR #define STRING_VAR "${STRING_VAR}" // Test FOREACH diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt index c5112c7..55b6b8b 100644 --- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt @@ -6,8 +6,13 @@ ENDIF (MUDSLIDE_TYPE MATCHES MUCHO) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") - +IF(WATCOM) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +ENDIF(WATCOM) INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) +IF(WATCOM) + TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib) +ENDIF(WATCOM) diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c index 5ca9b33..bd36b5c 100644 --- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c +++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c @@ -10,9 +10,8 @@ typedef struct char** Argv; } cmVTKWrapTclData; - /* do almost everything in the initial pass */ -static int InitialPass(void *inf, void *mf, int argc, char *argv[]) +static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) { char* file; char* str; @@ -134,7 +133,7 @@ static int InitialPass(void *inf, void *mf, int argc, char *argv[]) return 1; } -static void FinalPass(void *inf, void *mf) +static void CCONV FinalPass(void *inf, void *mf) { cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; /* get our client data from initial pass */ @@ -146,8 +145,7 @@ static void FinalPass(void *inf, void *mf) fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n"); } } - -static void Destructor(void *inf) +static void CCONV Destructor(void *inf) { cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; /* get our client data from initial pass */ @@ -157,7 +155,7 @@ static void Destructor(void *inf) } #ifdef MUCHO_MUDSLIDE -void CM_PLUGIN_EXPORT CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo *info) +void CM_PLUGIN_EXPORT CCONV CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo *info) { info->InitialPass = InitialPass; info->FinalPass = FinalPass; diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt index c5112c7..55b6b8b 100644 --- a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt @@ -6,8 +6,13 @@ ENDIF (MUDSLIDE_TYPE MATCHES MUCHO) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") - +IF(WATCOM) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +ENDIF(WATCOM) INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) +IF(WATCOM) + TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib) +ENDIF(WATCOM) diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c index 5ca9b33..bd36b5c 100644 --- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c +++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c @@ -10,9 +10,8 @@ typedef struct char** Argv; } cmVTKWrapTclData; - /* do almost everything in the initial pass */ -static int InitialPass(void *inf, void *mf, int argc, char *argv[]) +static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) { char* file; char* str; @@ -134,7 +133,7 @@ static int InitialPass(void *inf, void *mf, int argc, char *argv[]) return 1; } -static void FinalPass(void *inf, void *mf) +static void CCONV FinalPass(void *inf, void *mf) { cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; /* get our client data from initial pass */ @@ -146,8 +145,7 @@ static void FinalPass(void *inf, void *mf) fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n"); } } - -static void Destructor(void *inf) +static void CCONV Destructor(void *inf) { cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; /* get our client data from initial pass */ @@ -157,7 +155,7 @@ static void Destructor(void *inf) } #ifdef MUCHO_MUDSLIDE -void CM_PLUGIN_EXPORT CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo *info) +void CM_PLUGIN_EXPORT CCONV CMAKE_TEST_COMMANDInit(cmLoadedCommandInfo *info) { info->InitialPass = InitialPass; info->FinalPass = FinalPass; diff --git a/Tests/SubDir/AnotherSubdir/pair_int.int.c b/Tests/SubDir/AnotherSubdir/pair_int.int.c new file mode 100644 index 0000000..b7a6237 --- /dev/null +++ b/Tests/SubDir/AnotherSubdir/pair_int.int.c @@ -0,0 +1,6 @@ +#include <stdio.h> + +void pair_stuff() +{ + printf("Placeholder for a strange file in subdirectory\n"); +} diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt index 5cf8859..b0f9f62 100644 --- a/Tests/SubDir/CMakeLists.txt +++ b/Tests/SubDir/CMakeLists.txt @@ -1,16 +1,45 @@ PROJECT(SUBDIR) SUBDIRS(Executable EXCLUDE_FROM_ALL Examples) WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") +#WATCOM WMAKE does not support + in the name of a file! +IF(WATCOM) + SET(PLUS_NAME_FILES + AnotherSubdir/pair_int.int.c + vcl_algorithm_vcl_pair_double.foo.c) +ELSE(WATCOM) + SET(PLUS_NAME_FILES + AnotherSubdir/pair+int.int.c + vcl_algorithm+vcl_pair+double.foo.c) +ENDIF(WATCOM) ADD_EXECUTABLE(TestFromSubdir AnotherSubdir/testfromsubdir.c AnotherSubdir/secondone - AnotherSubdir/pair+int.int.c - vcl_algorithm+vcl_pair+double.foo.c + ${PLUS_NAME_FILES} ) AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES) -SET(SOURCES ${SOURCES} - vcl_algorithm+vcl_pair+double.foo.c) +IF(WATCOM) + FOREACH(f ${SOURCES}) + IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + SET(SOURCES2 ${f} ${SOURCES2}) + ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + ENDFOREACH(f) + SET(SOURCES ${SOURCES2}) + SET(SOURCES ${SOURCES} + vcl_algorithm_vcl_pair_double.foo.c) +ELSE(WATCOM) + FOREACH(f ${SOURCES}) + IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + SET(SOURCES2 ${f} ${SOURCES2}) + MESSAGE("${f}") + ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + ENDFOREACH(f) + SET(SOURCES ${SOURCES2}) + SET(SOURCES ${SOURCES} + vcl_algorithm+vcl_pair+double.foo.c) +ENDIF(WATCOM) MESSAGE("Sources: ${SOURCES}") ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES}) diff --git a/Tests/SubDir/ThirdSubDir/pair_int.int1.c b/Tests/SubDir/ThirdSubDir/pair_int.int1.c new file mode 100644 index 0000000..b7a6237 --- /dev/null +++ b/Tests/SubDir/ThirdSubDir/pair_int.int1.c @@ -0,0 +1,6 @@ +#include <stdio.h> + +void pair_stuff() +{ + printf("Placeholder for a strange file in subdirectory\n"); +} diff --git a/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c b/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c new file mode 100644 index 0000000..a0c60f7 --- /dev/null +++ b/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c @@ -0,0 +1,6 @@ +#include <stdio.h> + +void vcl_stuff() +{ + printf("Placeholder for a file with strange name\n"); +} |