diff options
Diffstat (limited to 'Tests')
49 files changed, 305 insertions, 151 deletions
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt index e1d8966..47ccbdc 100644 --- a/Tests/AliasTarget/CMakeLists.txt +++ b/Tests/AliasTarget/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 2.8.11) +cmake_policy(SET CMP0054 NEW) project(AliasTarget) set(CMAKE_CXX_STANDARD 98) @@ -10,6 +11,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") endif () +# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") + set(CMAKE_CXX_STANDARD 11) +endif() + add_library(foo SHARED empty.cpp) add_library(PREFIX::Foo ALIAS foo) add_library(Another::Alias ALIAS foo) diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 36987de..9b48b14 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -42,7 +42,7 @@ list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}") list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1") -if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^6789]|[6789][0-9])") +if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^789]|[789][0-9])") set(TEST_MULTI3 1) list(APPEND _cmake_options "-DTEST_MULTI3=1") endif() @@ -304,9 +304,6 @@ message("Run result: ${runResult} Output: \"${out}\"") if("${out}" STREQUAL "HEADER_STRING: ninja changed ") message("Worked!") -elseif(CMAKE_GENERATOR STREQUAL "Visual Studio 6") - # Tolerate failure because VS 6 does not seem to recompile ninjadep.cpp - # when the "dir/header.h" it includes changes. else() message(SEND_ERROR "Project did not rebuild properly. Output[${out}]\n" " expected [HEADER_STRING: ninja changed]") diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index ba493cb..76ea5b4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -624,8 +624,8 @@ if(BUILD_TESTING) endif() # test for correct sub-project generation - # not implemented in VS 6, VS 7.0, Xcode, or Ninja - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio [67]$|Xcode|Ninja") + # not implemented in VS 7.0, Xcode, or Ninja + if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 7$|Xcode|Ninja") # run cmake and configure all of SubProject # but only build the independent executable car add_test(SubProject ${CMAKE_CTEST_COMMAND} @@ -1371,6 +1371,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindJsonCpp) endif() + if(CMake_TEST_FindLTTngUST) + add_subdirectory(FindLTTngUST) + endif() + if(CMake_TEST_FindOpenSSL) add_subdirectory(FindOpenSSL) endif() @@ -1740,7 +1744,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(MSVC) ADD_TEST_MACRO(ForceInclude foo) ADD_TEST_MACRO(PDBDirectoryAndName myexe) - ADD_TEST_MACRO(PrecompiledHeader foo) + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + ADD_TEST_MACRO(PrecompiledHeader foo) + endif() endif() if(MSVC OR "${CMAKE_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles") @@ -1869,7 +1875,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() if(MSVC AND NOT MSVC_VERSION LESS 1310 - AND NOT CMAKE_GENERATOR MATCHES "Visual Studio [67]( |$)" + AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7( |$)" AND (NOT CMAKE_GENERATOR MATCHES "Visual Studio [89]( |$)" OR CMAKE_SIZEOF_VOID_P EQUAL 4) ) @@ -1881,7 +1887,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ADD_TEST_MACRO(SBCS SBCS) endif() - if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [6789]( |$)" + if(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio [789]( |$)" AND NOT CMAKE_GENERATOR_TOOLSET) ADD_TEST_MACRO(VSWindowsFormsResx VSWindowsFormsResx) endif() @@ -1910,7 +1916,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(CMake_TEST_DEVENV) # The test (and tested property) works with .sln files, so it's skipped when: - # * Using VS6, which doesn't use .sln files # * cmake --build is set up to use MSBuild, since the MSBuild invocation does not use the .sln file set(_last_test "") foreach(config ${CMAKE_CONFIGURATION_TYPES}) diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 26683b1..8f842d6 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -81,7 +81,7 @@ endmacro() # reported. foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG - HSPELL ICOTOOL JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG + HSPELL ICOTOOL JASPER LIBLZMA LIBXML2 LIBXSLT LTTNGUST PERL PKG_CONFIG PostgreSQL TIFF ZLIB) check_version_string(${VTEST} ${VTEST}_VERSION_STRING) endforeach() diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt index 13d1b01..1d8afbf 100644 --- a/Tests/CompileDefinitions/CMakeLists.txt +++ b/Tests/CompileDefinitions/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required(VERSION 2.8) project(CompileDefinitions) -if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 6") - add_definitions(-DNO_SPACES_IN_DEFINE_VALUES) - set(NO_SPACES_IN_DEFINE_VALUES 1) -endif() - # Use compile flags to tell executables which config is built # without depending on the compile definitions functionality. foreach(c DEBUG RELEASE RELWITHDEBINFO MINSIZEREL) diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 9251ff3..83ca7f4 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -2,6 +2,7 @@ # A more complex test case # cmake_minimum_required(VERSION 2.4) +cmake_policy(SET CMP0054 NEW) project (Complex) # Test that renaming a built-in works when configured multiple times. @@ -438,6 +439,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") endif () +# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") + set(CMAKE_CXX_STANDARD 11) +endif() + # # Create the libs and the main exe # diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 3b73e70..2d92809 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -2,6 +2,7 @@ # A more complex test case # cmake_minimum_required(VERSION 2.4) +cmake_policy(SET CMP0054 NEW) project (Complex) # Try setting a new policy. The IF test is for coverage. @@ -401,6 +402,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") endif () +# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") + set(CMAKE_CXX_STANDARD 11) +endif() + # # Create the libs and the main exe # diff --git a/Tests/CustomCommand/wrapper.cxx b/Tests/CustomCommand/wrapper.cxx index 93cb079..97912de 100644 --- a/Tests/CustomCommand/wrapper.cxx +++ b/Tests/CustomCommand/wrapper.cxx @@ -16,18 +16,12 @@ int main(int argc, char *argv[]) fprintf(fp,"int wrapped_help() { return 5; }\n"); fclose(fp); #ifdef CMAKE_INTDIR - /* The VS6 IDE passes a leading ".\\" in its variable expansion. */ -# if defined(_MSC_VER) && _MSC_VER == 1200 -# define CFG_DIR ".\\" CMAKE_INTDIR -# else -# define CFG_DIR CMAKE_INTDIR -# endif const char* cfg = (argc >= 4)? argv[3] : ""; - if(strcmp(cfg, CFG_DIR) != 0) + if(strcmp(cfg, CMAKE_INTDIR) != 0) { fprintf(stderr, "Did not receive expected configuration argument:\n" - " expected [" CFG_DIR "]\n" + " expected [" CMAKE_INTDIR "]\n" " received [%s]\n", cfg); return 1; } diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index c2ecb0b..f504c7b 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -79,12 +79,6 @@ set_property(TARGET testLib7 PROPERTY OUTPUT_NAME_DEBUG testLib7D-$<CONFIG>) set_property(TARGET testLib7 PROPERTY OUTPUT_NAME_RELEASE testLib7R-$<CONFIG>) set_property(TARGET testLib7 PROPERTY OUTPUT_NAME testLib7-$<CONFIG>) -# Work-around: Visual Studio 6 does not support per-target object files. -set(VS6) -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - set(VS6 1) -endif() - # Test using the target_link_libraries command to set the # LINK_INTERFACE_LIBRARIES* properties. We construct two libraries # providing the same two symbols. In each library one of the symbols @@ -93,8 +87,8 @@ endif() # configuration in which it is built. If the proper library is not # used via the link interface the import test will fail to link. add_library(testLib4lib STATIC testLib4lib.c) -add_library(testLib4libdbg STATIC testLib4libopt.c testLib4libdbg${VS6}.c) -add_library(testLib4libopt STATIC testLib4libdbg.c testLib4libopt${VS6}.c) +add_library(testLib4libdbg STATIC testLib4libopt.c testLib4libdbg.c) +add_library(testLib4libopt STATIC testLib4libdbg.c testLib4libopt.c) set_property(TARGET testLib4libdbg PROPERTY COMPILE_DEFINITIONS LIB_DBG) set_property(TARGET testLib4libopt PROPERTY COMPILE_DEFINITIONS LIB_OPT) target_link_libraries(testLib4 diff --git a/Tests/ExportImport/Export/testLib4libdbg1.c b/Tests/ExportImport/Export/testLib4libdbg1.c deleted file mode 100644 index cc56cf9..0000000 --- a/Tests/ExportImport/Export/testLib4libdbg1.c +++ /dev/null @@ -1 +0,0 @@ -#include "testLib4libdbg.c" diff --git a/Tests/ExportImport/Export/testLib4libopt1.c b/Tests/ExportImport/Export/testLib4libopt1.c deleted file mode 100644 index d9b5587..0000000 --- a/Tests/ExportImport/Export/testLib4libopt1.c +++ /dev/null @@ -1 +0,0 @@ -#include "testLib4libopt.c" diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt index e1a67db..17f1630 100644 --- a/Tests/ExternalProjectLocal/CMakeLists.txt +++ b/Tests/ExternalProjectLocal/CMakeLists.txt @@ -23,18 +23,6 @@ set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) if(NOT DEFINED can_build_tutorial_step5) set(can_build_tutorial_step5 1) - # Tutorial Step5 cannot build correctly using Visual Studio 6 - # on Windows 98 if the path of its build tree exceeds 72 - # characters in length... So don't attempt to build it - # in a long path on Win98: - # - if(CMAKE_SYSTEM STREQUAL "Windows-4.10") - string(LENGTH "${binary_base}/TutorialStep5-Local" n) - if(n GREATER 72) - set(can_build_tutorial_step5 0) - endif() - endif() - # The ExternalProject builds of Tutorial Step5 cannot be built # correctly 2nd and later times in an in-source build... # (because the CMakeCache.txt from the real in-source build of diff --git a/Tests/ExternalProjectSubdir/CMakeLists.txt b/Tests/ExternalProjectSubdir/CMakeLists.txt index e65087a..3a67ea0 100644 --- a/Tests/ExternalProjectSubdir/CMakeLists.txt +++ b/Tests/ExternalProjectSubdir/CMakeLists.txt @@ -3,11 +3,8 @@ project(ExternalProjectSubdir NONE) include(ExternalProject) # Remove the custom target output to be sure it runs in an -# incremental test. Skip this on VS 6 because it sometimes -# re-runs CMake after the custom command runs. -if(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 6") - file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt) -endif() +# incremental test. +file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt) add_custom_target(PreSubdir1 COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/PreSubdir1.txt diff --git a/Tests/FindLTTngUST/CMakeLists.txt b/Tests/FindLTTngUST/CMakeLists.txt new file mode 100644 index 0000000..c9c471d --- /dev/null +++ b/Tests/FindLTTngUST/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindLTTngUST.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindLTTngUST/Test" + "${CMake_BINARY_DIR}/Tests/FindLTTngUST/Test" + ${build_generator_args} + --build-project TestFindLTTngUST + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindLTTngUST/Test/CMakeLists.txt b/Tests/FindLTTngUST/Test/CMakeLists.txt new file mode 100644 index 0000000..e5bd9f3 --- /dev/null +++ b/Tests/FindLTTngUST/Test/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.5) +project(TestFindLTTngUST C) +include(CTest) + +find_package(LTTngUST REQUIRED) + +add_definitions(-DCMAKE_EXPECTED_LTTNGUST_VERSION="${LTTNGUST_VERSION_STRING}") +add_definitions(-DCMAKE_LTTNGUST_HAS_TRACEF="${LTTNGUST_HAS_TRACEF}") +add_definitions(-DCMAKE_LTTNGUST_HAS_TRACELOG="${LTTNGUST_HAS_TRACELOG}") + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt LTTng::UST) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${LTTNGUST_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${LTTNGUST_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindLTTngUST/Test/main.c b/Tests/FindLTTngUST/Test/main.c new file mode 100644 index 0000000..ac775a0 --- /dev/null +++ b/Tests/FindLTTngUST/Test/main.c @@ -0,0 +1,31 @@ +#include <assert.h> +#include <string.h> +#include <stdio.h> +#include <lttng/ust-version.h> + +#ifdef CMAKE_LTTNGUST_HAS_TRACEF +#include <lttng/tracef.h> +#endif + +#ifdef CMAKE_LTTNGUST_HAS_TRACELOG +#include <lttng/tracelog.h> +#endif + +int main(void) +{ + char lttng_version_string[16]; + + snprintf(lttng_version_string, 16, "%u.%u.%u", LTTNG_UST_MAJOR_VERSION, + LTTNG_UST_MINOR_VERSION, LTTNG_UST_PATCHLEVEL_VERSION); + assert(!strcmp(lttng_version_string, CMAKE_EXPECTED_LTTNGUST_VERSION)); + +#ifdef CMAKE_LTTNGUST_HAS_TRACEF + tracef("calling tracef()! %d %s", -23, CMAKE_EXPECTED_LTTNGUST_VERSION); +#endif + +#ifdef CMAKE_LTTNGUST_HAS_TRACELOG + tracelog(TRACE_WARNING, "calling tracelog()! %d", 17); +#endif + + return 0; +} diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt index 7fce330..8b94ca7 100644 --- a/Tests/Module/GenerateExportHeader/CMakeLists.txt +++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) +cmake_policy(SET CMP0054 NEW) project(GenerateExportHeader) @@ -66,6 +67,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") endif () +# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") + set(CMAKE_CXX_STANDARD 11) +endif() + add_subdirectory(lib_shared_and_static) add_compiler_export_flags() @@ -107,7 +114,10 @@ add_executable(GenerateExportHeader exportheader_test.cpp) target_link_libraries(GenerateExportHeader ${link_libraries}) if (WIN32 OR CYGWIN) - if(MSVC AND COMPILER_HAS_DEPRECATED) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") + set(_platform Win32-Clang) + elseif(MSVC AND COMPILER_HAS_DEPRECATED) set(_platform Win32) elseif((MINGW OR CYGWIN) AND COMPILER_HAS_DEPRECATED) set(_platform MinGW) diff --git a/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h new file mode 100644 index 0000000..d376631 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libshared_export.h @@ -0,0 +1,41 @@ + +#ifndef LIBSHARED_EXPORT_H +#define LIBSHARED_EXPORT_H + +#ifdef LIBSHARED_STATIC_DEFINE +# define LIBSHARED_EXPORT +# define LIBSHARED_NO_EXPORT +#else +# ifndef LIBSHARED_EXPORT +# ifdef libshared_EXPORTS + /* We are building this library */ +# define LIBSHARED_EXPORT __declspec(dllexport) +# else + /* We are using this library */ +# define LIBSHARED_EXPORT __declspec(dllimport) +# endif +# endif + +# ifndef LIBSHARED_NO_EXPORT +# define LIBSHARED_NO_EXPORT +# endif +#endif + +#ifndef LIBSHARED_DEPRECATED +# define LIBSHARED_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef LIBSHARED_DEPRECATED_EXPORT +# define LIBSHARED_DEPRECATED_EXPORT LIBSHARED_EXPORT LIBSHARED_DEPRECATED +#endif + +#ifndef LIBSHARED_DEPRECATED_NO_EXPORT +# define LIBSHARED_DEPRECATED_NO_EXPORT LIBSHARED_NO_EXPORT LIBSHARED_DEPRECATED +#endif + +#define DEFINE_NO_DEPRECATED 0 +#if DEFINE_NO_DEPRECATED +# define LIBSHARED_NO_DEPRECATED +#endif + +#endif diff --git a/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h new file mode 100644 index 0000000..fd021e9 --- /dev/null +++ b/Tests/Module/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h @@ -0,0 +1,41 @@ + +#ifndef LIBSTATIC_EXPORT_H +#define LIBSTATIC_EXPORT_H + +#ifdef LIBSTATIC_STATIC_DEFINE +# define LIBSTATIC_EXPORT +# define LIBSTATIC_NO_EXPORT +#else +# ifndef LIBSTATIC_EXPORT +# ifdef libstatic_EXPORTS + /* We are building this library */ +# define LIBSTATIC_EXPORT +# else + /* We are using this library */ +# define LIBSTATIC_EXPORT +# endif +# endif + +# ifndef LIBSTATIC_NO_EXPORT +# define LIBSTATIC_NO_EXPORT +# endif +#endif + +#ifndef LIBSTATIC_DEPRECATED +# define LIBSTATIC_DEPRECATED __attribute__ ((__deprecated__)) +#endif + +#ifndef LIBSTATIC_DEPRECATED_EXPORT +# define LIBSTATIC_DEPRECATED_EXPORT LIBSTATIC_EXPORT LIBSTATIC_DEPRECATED +#endif + +#ifndef LIBSTATIC_DEPRECATED_NO_EXPORT +# define LIBSTATIC_DEPRECATED_NO_EXPORT LIBSTATIC_NO_EXPORT LIBSTATIC_DEPRECATED +#endif + +#define DEFINE_NO_DEPRECATED 0 +#if DEFINE_NO_DEPRECATED +# define LIBSTATIC_NO_DEPRECATED +#endif + +#endif diff --git a/Tests/ObjectLibrary/A/CMakeLists.txt b/Tests/ObjectLibrary/A/CMakeLists.txt index c24c5ed..188fd64 100644 --- a/Tests/ObjectLibrary/A/CMakeLists.txt +++ b/Tests/ObjectLibrary/A/CMakeLists.txt @@ -12,11 +12,8 @@ add_custom_command( ) # Remove the custom command output to be sure it runs in an -# incremental test. Skip this on VS 6 because it sometimes -# re-runs CMake after the custom command runs. -if(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 6") - file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/a.cmake) -endif() +# incremental test. +file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/a.cmake) add_custom_command( OUTPUT a.cmake COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/a.cmake diff --git a/Tests/ObjectLibrary/B/CMakeLists.txt b/Tests/ObjectLibrary/B/CMakeLists.txt index 2158084..ecace4f 100644 --- a/Tests/ObjectLibrary/B/CMakeLists.txt +++ b/Tests/ObjectLibrary/B/CMakeLists.txt @@ -1,8 +1,4 @@ project(ObjectLibraryB C) -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - # VS 6 generator does not use per-target object locations. - set(vs6 _vs6) -endif() # Add -fPIC so objects can be used in shared libraries. set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -11,7 +7,7 @@ add_library(B OBJECT b1.c b2.c) target_include_directories(B PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_compile_definitions(B PUBLIC B_DEF) -add_library(Bexport OBJECT b1${vs6}.c b2${vs6}.c) +add_library(Bexport OBJECT b1.c b2.c) set_property(TARGET Bexport PROPERTY COMPILE_DEFINITIONS Bexport) target_include_directories(Bexport PRIVATE $<TARGET_PROPERTY:B,INTERFACE_INCLUDE_DIRECTORIES>) target_compile_definitions(Bexport PRIVATE $<TARGET_PROPERTY:B,INTERFACE_COMPILE_DEFINITIONS>) diff --git a/Tests/ObjectLibrary/B/b1_vs6.c b/Tests/ObjectLibrary/B/b1_vs6.c deleted file mode 100644 index b606e10..0000000 --- a/Tests/ObjectLibrary/B/b1_vs6.c +++ /dev/null @@ -1 +0,0 @@ -#include "b1.c" diff --git a/Tests/ObjectLibrary/B/b2_vs6.c b/Tests/ObjectLibrary/B/b2_vs6.c deleted file mode 100644 index d96a43e..0000000 --- a/Tests/ObjectLibrary/B/b2_vs6.c +++ /dev/null @@ -1 +0,0 @@ -#include "b2.c" diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt index e9f553e..e3476df 100644 --- a/Tests/ObjectLibrary/CMakeLists.txt +++ b/Tests/ObjectLibrary/CMakeLists.txt @@ -16,8 +16,8 @@ add_custom_command(TARGET UseCshared POST_BUILD COMMAND ${CMAKE_COMMAND} -P ${CM add_executable(UseCinternal main.c c.c $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>) -if("${CMAKE_GENERATOR}" MATCHES "^Visual Studio (6|7|7 .NET 2003)$") - # VS 6 and 7 generators do not add objects as sources so we need a +if("${CMAKE_GENERATOR}" MATCHES "^Visual Studio (7|7 .NET 2003)$") + # VS 7 generators do not add objects as sources so we need a # dummy object to convince the IDE to build the targets below. set(dummy dummy.obj) # In MinGW: gcc -c dummy.c -o dummy.obj elseif("${CMAKE_GENERATOR}" MATCHES "Xcode") diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt index 180f9fe..2fb894e 100644 --- a/Tests/PDBDirectoryAndName/CMakeLists.txt +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 2.8) +cmake_policy(SET CMP0054 NEW) project(PDBDirectoryAndName C) # Make sure the proper compiler is in use. @@ -62,14 +63,17 @@ list(APPEND my_targets myexe2) target_link_libraries(myexe2 mylibA mylibD) -#----------------------------------------------------------------------------- -# Check that PDB files actually appear where expected. -# The PDB_NAME and PDB_OUTPUT_DIRECTORY options do not work in VS 6. -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - return() +# Clang/C2 does not produce pdb files for static libraries +if (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND + CMAKE_C_SIMULATE_ID STREQUAL "MSVC") + list(REMOVE_ITEM my_targets mylibB mylibD) endif() + +#----------------------------------------------------------------------------- +# Check that PDB files actually appear where expected. + set(pdbs "") foreach(t ${my_targets}) get_property(pdb_name TARGET ${t} PROPERTY PDB_NAME) diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index 2b7bac1..49ff317 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required (VERSION 2.6) +cmake_policy(SET CMP0054 NEW) project(Plugin) # Test per-target output directory properties. @@ -34,6 +35,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA") endif () +# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") + set(CMAKE_CXX_STANDARD 11) +endif() + # Create an executable that exports an API for use by plugins. add_executable(example_exe src/example_exe.cxx) set_target_properties(example_exe PROPERTIES diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt index 98bdd88..a804538 100644 --- a/Tests/PrecompiledHeader/CMakeLists.txt +++ b/Tests/PrecompiledHeader/CMakeLists.txt @@ -17,14 +17,8 @@ else() file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH) endif() -# The VS6 IDE does not support renaming .pch files with /Fp. -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - set(PCH_USE_INCLUDE_DIR 1) - set(PCH_FILE) -else() - set(PCH_USE_INCLUDE_DIR 0) - set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"") -endif() +set(PCH_USE_INCLUDE_DIR 0) +set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"") # Choose between an explicit include path and using /I during # precompilation. The /I form is used to test that the PCH is diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 15e2aca..b930f56 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -10,9 +10,6 @@ project(Preprocess) if("${CMAKE_GENERATOR}" MATCHES "Xcode") set(PP_XCODE 1) endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - set(PP_VS6 1) -endif() if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") set(PP_UMAKE 1) endif() @@ -60,20 +57,15 @@ if(NOT BORLAND AND NOT PP_VS70) set(SEMICOLON "\;") endif() -if(NOT PP_VS6) - # VS 6 IDE: spaces and '"', '$', or ';' - # The project parser cannot handle spaces if there are quotes. - # Since we test passing in a quoted string, we cannot have spaces. - set(STRING_EXTRA "${STRING_EXTRA} ") +set(STRING_EXTRA "${STRING_EXTRA} ") - if(NOT PP_BORLAND AND NOT PP_WATCOM) - # Borland, WMake: multiple spaces - # The make tool seems to remove extra whitespace from inside - # quoted strings when passing to the compiler. It does not have - # trouble passing to other tools, and the compiler may be directly - # invoked from the command line. - set(STRING_EXTRA "${STRING_EXTRA} ") - endif() +if(NOT PP_BORLAND AND NOT PP_WATCOM) + # Borland, WMake: multiple spaces + # The make tool seems to remove extra whitespace from inside + # quoted strings when passing to the compiler. It does not have + # trouble passing to other tools, and the compiler may be directly + # invoked from the command line. + set(STRING_EXTRA "${STRING_EXTRA} ") endif() if(NOT PP_VS) @@ -201,14 +193,10 @@ endif() set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DPREPROCESS_DEBUG") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DPREPROCESS_DEBUG") -# Inform the test if it built from Xcode or VS6 IDE. +# Inform the test if it built from Xcode. if(PP_XCODE) set(PREPROCESS_XCODE 1) endif() -if(PP_VS6) - set(PREPROCESS_VS6 1) - set(VS6 _vs6) -endif() # Test old-style definitions. add_definitions(-DOLD_DEF -DOLD_EXPR=2) @@ -220,7 +208,7 @@ if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}") message(SEND_ERROR "add_definitions not converted to directory property!") endif() -add_executable(Preprocess preprocess.c preprocess${VS6}.cxx) +add_executable(Preprocess preprocess.c preprocess.cxx) set(FILE_PATH "${Preprocess_SOURCE_DIR}/file_def.h") set(TARGET_PATH "${Preprocess_SOURCE_DIR}/target_def.h") @@ -236,17 +224,14 @@ foreach(c "" "_DEBUG" "_RELEASE") PROPERTY COMPILE_DEFINITIONS${c} "TARGET_DEF${c}" ) set_property( - SOURCE preprocess.c preprocess${VS6}.cxx + SOURCE preprocess.c preprocess.cxx PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${c}" ) endforeach() # Add definitions with values. -if(NOT PREPROCESS_VS6) - # The path might have spaces, which VS6 does not support. - set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"") - set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"") -endif() +set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"") +set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"") set_property( TARGET Preprocess APPEND PROPERTY COMPILE_DEFINITIONS @@ -255,7 +240,7 @@ set_property( ${DEF_TARGET_PATH} ) set_property( - SOURCE preprocess.c preprocess${VS6}.cxx + SOURCE preprocess.c preprocess.cxx APPEND PROPERTY COMPILE_DEFINITIONS "FILE_STRING=\"${STRING_VALUE}${SEMICOLON}\"" "FILE_EXPR=${EXPR}" diff --git a/Tests/Preprocess/preprocess.h.in b/Tests/Preprocess/preprocess.h.in index 3e1c7a0..e058a58 100644 --- a/Tests/Preprocess/preprocess.h.in +++ b/Tests/Preprocess/preprocess.h.in @@ -2,12 +2,6 @@ #define STRING_VALUE "@STRING_VALUE@" #define EXPR @EXPR@ #cmakedefine PREPROCESS_XCODE -#cmakedefine PREPROCESS_VS6 - -#ifdef PREPROCESS_VS6 -# define FILE_PATH "@FILE_PATH@" -# define TARGET_PATH "@TARGET_PATH@" -#endif /* Declarations and macros shared by all sources. */ #define TO_STRING(x) TO_STRING0(x) diff --git a/Tests/Preprocess/preprocess_vs6.cxx b/Tests/Preprocess/preprocess_vs6.cxx deleted file mode 100644 index 9df89f6..0000000 --- a/Tests/Preprocess/preprocess_vs6.cxx +++ /dev/null @@ -1,3 +0,0 @@ -// The VS6 IDE does not support object name configuration so we need a -// source file with a different name. Include the real source file. -#include "preprocess.cxx" diff --git a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake index 3784a6a..f268de7 100644 --- a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake +++ b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake @@ -6,8 +6,8 @@ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") # configure the AutoExport test run_cmake(AutoExport) unset(RunCMake_TEST_OPTIONS) -# don't run this test on VS 6 as it is not supported -if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 6|Watcom WMake|Borland Makefiles") +# don't run this test on Watcom or Borland make as it is not supported +if("${RunCMake_GENERATOR}" MATCHES "Watcom WMake|Borland Makefiles") return() endif() # we build debug so the say.exe will be found in Debug/say.exe for diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index 31c72fb..26ffcc0 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -30,7 +30,7 @@ function(run_BuildDepends CASE) endfunction() run_BuildDepends(C-Exe) -if(NOT RunCMake_GENERATOR MATCHES "Visual Studio [67]|Xcode") +if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 7|Xcode") if(RunCMake_GENERATOR MATCHES "Visual Studio 10") # VS 10 forgets to re-link when a manifest changes set(run_BuildDepends_skip_step_2 1) @@ -40,3 +40,42 @@ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio [67]|Xcode") endif() run_BuildDepends(Custom-Always) + +function(run_ReGeneration) + # test re-generation of project even if CMakeLists.txt files disappeared + + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/regenerate-project-build) + set(RunCMake_TEST_SOURCE_DIR ${RunCMake_BINARY_DIR}/regenerate-project-source) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}") + set(ProjectHeader [=[ + cmake_minimum_required(VERSION 3.5) + project(Regenerate-Project NONE) + ]=]) + + # create project with subdirectory + file(WRITE "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" "${ProjectHeader}" + "add_subdirectory(mysubdir)") + file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}/mysubdir") + file(WRITE "${RunCMake_TEST_SOURCE_DIR}/mysubdir/CMakeLists.txt" "# empty") + + run_cmake(Regenerate-Project) + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay}) + + # now we delete the subdirectory and adjust the CMakeLists.txt + file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}/mysubdir") + file(WRITE "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" "${ProjectHeader}") + + run_cmake_command(Regenerate-Project-Directory-Removed + ${CMAKE_COMMAND} --build "${RunCMake_TEST_BINARY_DIR}") + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_SOURCE_DIR) + unset(RunCMake_TEST_NO_CLEAN) +endfunction() + +if(RunCMake_GENERATOR STREQUAL "Xcode") + run_ReGeneration(regenerate-project) +endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 5bef629..588f3a1 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -152,6 +152,7 @@ add_RunCMake_test(ObjectLibrary) add_RunCMake_test(Swift) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetSources) +add_RunCMake_test(ToolchainFile) add_RunCMake_test(find_dependency) add_RunCMake_test(CompileDefinitions) add_RunCMake_test(CompileFeatures) @@ -231,12 +232,12 @@ if(PKG_CONFIG_FOUND) add_RunCMake_test(FindPkgConfig) endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio [^6]") +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") add_RunCMake_test(include_external_msproject) add_RunCMake_test(SolutionGlobalSections) endif() -if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^6789]|[6789][0-9])") +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^789]|[789][0-9])") add_RunCMake_test(VS10Project) endif() diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt b/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt deleted file mode 100644 index 1b6a510..0000000 --- a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Warning: - The "Visual Studio 6" generator is deprecated and will be removed in a - future version of CMake. - - Add CMAKE_WARN_VS6=OFF to the cache to disable this warning.$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index a07bbbe..3b5504e 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -72,12 +72,7 @@ if(RunCMake_GENERATOR STREQUAL "Ninja") unset(RunCMake_TEST_NO_CLEAN) endif() -if(RunCMake_GENERATOR STREQUAL "Visual Studio 6") - set(RunCMake_WARN_VS6 1) - run_cmake(DeprecateVS6-WARN-ON) - unset(RunCMake_WARN_VS6) - run_cmake(DeprecateVS6-WARN-OFF) -elseif(RunCMake_GENERATOR STREQUAL "Visual Studio 7") +if(RunCMake_GENERATOR STREQUAL "Visual Studio 7") set(RunCMake_WARN_VS70 1) run_cmake(DeprecateVS70-WARN-ON) unset(RunCMake_WARN_VS70) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index db9911d..9d44a8a 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -51,9 +51,6 @@ function(run_cmake test) if(APPLE) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) endif() - if(RunCMake_GENERATOR STREQUAL "Visual Studio 6" AND NOT RunCMake_WARN_VS6) - list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS6=OFF) - endif() if(RunCMake_GENERATOR STREQUAL "Visual Studio 7" AND NOT RunCMake_WARN_VS70) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_WARN_VS70=OFF) endif() diff --git a/Tests/RunCMake/ToolchainFile/CMakeLists.txt b/Tests/RunCMake/ToolchainFile/CMakeLists.txt new file mode 100644 index 0000000..93ee9df --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.5) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ToolchainFile/CallEnableLanguage-result.txt b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ToolchainFile/CallEnableLanguage-stderr.txt b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-stderr.txt new file mode 100644 index 0000000..0de51c6 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at CallEnableLanguage-toolchain.cmake:[0-9]+ \(enable_language\): + Language 'NONE' is currently being enabled. Recursive call not allowed. +Call Stack \(most recent call first\): + .*/Modules/CMakeDetermineSystem.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(project\)$ diff --git a/Tests/RunCMake/ToolchainFile/CallEnableLanguage-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-toolchain.cmake new file mode 100644 index 0000000..8145101 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CallEnableLanguage-toolchain.cmake @@ -0,0 +1 @@ +enable_language(NONE) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake b/Tests/RunCMake/ToolchainFile/CallEnableLanguage.cmake index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-ON.cmake +++ b/Tests/RunCMake/ToolchainFile/CallEnableLanguage.cmake diff --git a/Tests/RunCMake/ToolchainFile/CallProject-result.txt b/Tests/RunCMake/ToolchainFile/CallProject-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CallProject-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ToolchainFile/CallProject-stderr.txt b/Tests/RunCMake/ToolchainFile/CallProject-stderr.txt new file mode 100644 index 0000000..e2b9f1b --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CallProject-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at CallProject-toolchain.cmake:[0-9]+ \(project\): + Language 'NONE' is currently being enabled. Recursive call not allowed. +Call Stack \(most recent call first\): + .*/Modules/CMakeDetermineSystem.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(project\)$ diff --git a/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake new file mode 100644 index 0000000..b113c13 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/CallProject-toolchain.cmake @@ -0,0 +1 @@ +project(Bad NONE) diff --git a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake b/Tests/RunCMake/ToolchainFile/CallProject.cmake index e69de29..e69de29 100644 --- a/Tests/RunCMake/CommandLine/DeprecateVS6-WARN-OFF.cmake +++ b/Tests/RunCMake/ToolchainFile/CallProject.cmake diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake new file mode 100644 index 0000000..75293e7 --- /dev/null +++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +function(run_cmake_toolchain t) + set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/${t}-toolchain.cmake) + run_cmake(${t}) +endfunction() + +run_cmake_toolchain(CallEnableLanguage) +run_cmake_toolchain(CallProject) diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index e497503..d11cfc5 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -108,9 +108,7 @@ endif() # try to compile a file that should compile set(_c_flags "${CMAKE_C_FLAGS}") -if(CMAKE_GENERATOR STREQUAL "Visual Studio 6") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D \"TESTDEF\"") -elseif(WATCOM) +if(WATCOM) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -dTESTDEF") else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \"-DTESTDEF\"") diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt index 73ea05a..20301c2 100644 --- a/Tests/VSExternalInclude/CMakeLists.txt +++ b/Tests/VSExternalInclude/CMakeLists.txt @@ -1,13 +1,10 @@ cmake_minimum_required (VERSION 2.6) project(VSExternalInclude) -if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") - set(PROJECT_EXT dsp) -else() - set(PROJECT_EXT vcproj) -endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[0124]") set(PROJECT_EXT vcxproj) +else() + set(PROJECT_EXT vcproj) endif() # make sure directories exists diff --git a/Tests/VSMidl/src/CMakeLists.txt b/Tests/VSMidl/src/CMakeLists.txt index 86c04ed..e745fdd 100644 --- a/Tests/VSMidl/src/CMakeLists.txt +++ b/Tests/VSMidl/src/CMakeLists.txt @@ -1,12 +1,6 @@ cmake_minimum_required(VERSION 2.8) project(VSMidl) -if(MSVC_VERSION GREATER 1200) - include_directories("${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir)") -else() - # midl generated headers end up directly in CMAKE_CURRENT_BINARY_DIR with - # VS6 builds. - include_directories("${CMAKE_CURRENT_BINARY_DIR}") -endif() +include_directories("${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir)") add_executable(VSMidl main.cpp test.idl) |