CMake/Tests
Brad King c2f79c9867 Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode
The set of compile flags used for a target's C and C++ sources is based
on the linker language.  By default this is always the C++ flags if any
C++ sources appear in the target, and otherwise the C flags.  Therefore
we can define the `COMPILE_LANGUAGE` generator expression in
`COMPILE_DEFINITIONS` to match the selected language.

This is not exactly the same as for other generators, but is the best VS
and Xcode can do.  It is also sufficient for many use cases since the
set of definitions for C and C++ is frequently similar but may be
distinct from those for other languages like CUDA.

Issue: #17435
2018-01-12 14:27:37 -05:00
..
AliasTarget
Architecture
ArgumentExpansion
Assembler
BuildDepends
BundleGeneratorTest
BundleTest
BundleUtilities
CFBundleTest Fix trivial typos in text 2017-11-03 10:25:05 -04:00
CheckCompilerRelatedVariables
CMakeCommands Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode 2018-01-12 14:27:37 -05:00
CMakeLib cmake: specify source file extensions 2018-01-09 09:21:09 -05:00
CMakeOnly GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
CMakeServerLib cmake: specify source file extensions 2018-01-09 09:21:09 -05:00
CMakeTestAllGenerators
CMakeTestMultipleConfigures
CMakeTests Merge topic 'implicit-lib-gcceh' 2017-11-08 08:25:16 -05:00
CoberturaCoverage
CommandLineTest
CompatibleInterface
CompileCommandOutput
CompileDefinitions
CompileFeatures clang-format: format all code as Cpp11 2017-08-30 11:07:05 -04:00
CompileOptions
Complex
ComplexOneConfig
ConfigSources
COnly
Contracts Tests: Add contract test for PLplot 2017-11-08 06:47:26 -05:00
CPackComponents
CPackComponentsDEB Various typo fixes 2018-01-04 06:52:01 +11:00
CPackComponentsForAll CPack RPM and DEB: improved package version handling 2017-09-21 19:54:17 +02:00
CPackComponentsPrefix
CPackTestAllGenerators
CPackWiXGenerator
CrossCompile
CSharpLinkToCxx VS: Do not reference output assemblies if not possible for CSharp target 2017-09-05 09:41:40 -04:00
CSharpOnly
CTestBuildCommandProjectInSubdir
CTestConfig GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
CTestCoverageCollectGCOV
CTestLimitDashJ
CTestScriptMode
CTestTest Various typo fixes 2018-01-04 06:52:01 +11:00
CTestTest2 Tests: In CTestTest2 configure KWSys encoding to match CMake 2017-11-09 08:35:38 -05:00
CTestTestBadExe
CTestTestBadGenerator
CTestTestChecksum
CTestTestCostSerial
CTestTestCrash
CTestTestCycle
CTestTestDepends
CTestTestEmptyBinaryDirectory
CTestTestFailure
CTestTestFdSetSize
CTestTestLabelRegExp
CTestTestLaunchers
CTestTestMissingDependsExe
CTestTestParallel
CTestTestResourceLock
CTestTestRunScript
CTestTestScheduler
CTestTestSerialInDepends
CTestTestSerialOrder
CTestTestSkipReturnCode
CTestTestStopTime Fix trivial typos in text 2017-11-03 10:25:05 -04:00
CTestTestSubdir
CTestTestTimeout Various typo fixes 2018-01-04 06:52:01 +11:00
CTestTestUpload
CTestTestVerboseOutput
CTestTestZeroTimeout
Cuda Various typo fixes 2018-01-04 06:52:01 +11:00
CudaOnly Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode 2018-01-12 14:27:37 -05:00
CustComDepend
CustomCommand
CustomCommandByproducts GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
CustomCommandWorkingDirectory
CxxDialect
CxxOnly
CxxSubdirC
DelphiCoverage
Dependency
DoubleProject
EmptyDepends
EmptyLibrary
EmptyProperty
Environment
ExportImport GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
ExternalOBJ Various typo fixes 2018-01-04 06:52:01 +11:00
ExternalProject
ExternalProjectLocal
ExternalProjectSourceSubdir
ExternalProjectSubdir
ExternalProjectUpdate
FindBoost
FindBZip2
FindDoxygen FindDoxygen: Add DOXYGEN_VERBATIM_VARS for quote prevention 2018-01-03 07:59:59 +11:00
FindEXPAT FindEXPAT: Add unit test of target and variables 2017-09-01 16:02:57 +01:00
FindFreetype FindFreetype: Add imported target, docs, and test 2017-09-07 17:52:33 +01:00
FindGSL
FindGTest FindGTest: Improve test to catch link error 2017-09-18 10:01:15 -04:00
FindGTK2
FindIconv FindIconv: Add the FindIconv module. 2017-11-29 14:51:32 +01:00
FindICU
FindJsonCpp
FindLibRHash
FindLibUV
FindLTTngUST
FindMatlab
FindModulesExecuteAll
FindMPI FindMPI: Support components for various languages 2017-09-15 14:55:08 +02:00
FindOpenCL
FindOpenGL FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GL 2017-11-17 07:17:28 -05:00
FindOpenMP
FindOpenSSL MAINT: Misc. typos 2018-01-10 12:34:14 -05:00
FindPackageModeMakefileTest cmake: Fix --find-package mode with imported targets 2017-08-29 15:30:07 -04:00
FindPackageTest WriteBasicConfigVersionFile: Fix messages in ExactVersion tests 2017-11-21 10:09:15 +01:00
FindPatch Tests: Fix FindPatch test on Windows 2017-11-15 06:56:04 -05:00
FindPNG
FindProtobuf FindProtobuf: add flag to allow descriptor files to be generated 2017-10-02 08:08:24 -04:00
FindThreads
FindTIFF
FindVulkan
FindXalanC
FindXercesC
ForceInclude
Fortran Various typo fixes 2018-01-04 06:52:01 +11:00
FortranC
FortranModules GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
FortranOnly Various typo fixes 2018-01-04 06:52:01 +11:00
Framework
FunctionTest
GeneratorExpression Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode 2018-01-12 14:27:37 -05:00
GhsMulti
GhsMultiDuplicateSourceFilenames
GoogleTest
IncludeDirectories
InterfaceLibrary Do not initialize NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries 2017-10-13 14:32:14 -04:00
InterfaceLinkLibraries
iOSNavApp
IPO
JacocoCoverage
Java UseJava: OUTPUT_DIR must exists in all cases. 2017-10-10 10:00:23 +02:00
JavaExportImport GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
JavaJavah
JavascriptCoverage
JCTest
Jump
LibName
LinkDirectory
LinkFlags
LinkLanguage
LinkLine
LinkLineOrder
LinkStatic
LoadCommand Tests: Remove ancient workaround in LoadCommand tests 2017-10-04 09:42:52 -04:00
LoadCommandOneConfig Tests: Remove ancient workaround in LoadCommand tests 2017-10-04 09:42:52 -04:00
MacroTest
MacRuntimePath GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
MakeClean
MathTest
MFC Avoid CRLF newlines in Git repo blobs 2017-08-30 08:29:43 -04:00
MissingInstall GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
MissingSourceFile
Module Merge topic 'modernize-git-whitespace-attributes' 2017-08-25 11:04:05 -04:00
ModuleDefinition
MSManifest
MumpsCoverage Avoid CRLF newlines in Git repo blobs 2017-08-30 08:29:43 -04:00
NewlineArgs
ObjC++
ObjectLibrary
OutDir GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
OutOfBinary
OutOfSource Fix trivial typos in text 2017-11-03 10:25:05 -04:00
PDBDirectoryAndName
PerConfig
Plugin
Policy0002
PolicyScope
PositionIndependentTargets
PrecompiledHeader GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
PreOrder
Preprocess
Properties Various typo fixes 2018-01-04 06:52:01 +11:00
PythonCoverage
Qt4And5Automoc
Qt4Autogen Autogen: Tests: Add basic scripts for separate tests 2017-12-13 13:48:27 +01:00
Qt4Deploy GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
Qt4Targets
Qt5Autogen Autogen: Tests: Add basic scripts for separate tests 2017-12-13 13:48:27 +01:00
QtAutogen Merge topic 'use_generator_is_multi_config' 2018-01-08 11:14:16 -05:00
QtAutomocNoQt
ReturnTest
RunCMake Genex: Enable COMPILE_LANGUAGE for COMPILE_DEFINITIONS with VS and Xcode 2018-01-12 14:27:37 -05:00
RuntimePath
SBCS
Server test: Updated server test harness to try to cause fragmentation 2017-11-29 12:35:42 -07:00
SetLang
Simple
SimpleCOnly
SimpleInstall Merge topic 'use_generator_is_multi_config' 2018-01-08 11:14:16 -05:00
SimpleInstallS2 Merge topic 'use_generator_is_multi_config' 2018-01-08 11:14:16 -05:00
SourceFileProperty
SourceGroups
SourcesProperty
StagingPrefix GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
StringFileTest
SubDir
SubDirSpaces
SubProject
SwiftMix
SwiftOnly
SwigTest
SystemInformation
TargetName
TestDriver
Testing
TestsWorkingDirectory
TryCompile Various typo fixes 2018-01-04 06:52:01 +11:00
Tutorial
Unset
VariableUnusedViaSet
VariableUnusedViaUnset
VariableUsage
Visibility
VSExcludeFromDefaultBuild
VSExternalInclude
VSGNUFortran GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
VSMASM
VSMidl
VSNASM
VSNsightTegra
VSProjectInSubdir
VSResource Ninja: Fix quoting of RC language depfile in cmcldeps call 2017-09-25 10:07:48 -04:00
VSResourceNinjaForceRSP
VSWindowsFormsResx
VSWinStorePhone VS: Add VS_SHADER_OUTPUT_HEADER_FILE and VS_SHADER_VARIABLE_NAME properties. 2017-09-27 07:56:09 -04:00
VSXaml
WarnUnusedCliUnused
Wrapping
X11
XCTest
.NoDartCoverage
bootstrap.bat.in
BootstrapTest.cmake
CheckFortran.cmake Tests: Avoid hanging on check for Fortran 2017-11-06 10:21:11 -05:00
CMakeBuildTest.cmake.in GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
CMakeCopyright.cmake
CMakeInstall.cmake GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
CMakeLists.txt GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests 2017-12-30 09:35:56 +11:00
CTestUpdateBZR.cmake.in
CTestUpdateCommon.cmake
CTestUpdateCVS.cmake.in
CTestUpdateGIT.cmake.in
CTestUpdateGIT.sh.in
CTestUpdateHG.cmake.in
CTestUpdateP4.cmake.in
CTestUpdateSVN.cmake.in
EnforceConfig.cmake.in
README.rst
test_clean.cmake.in

CMake Tests Directory
*********************

This directory contains the CMake test suite.
See also the `CMake Source Code Guide`_.

.. _`CMake Source Code Guide`: ../Help/dev/source.rst

Many tests exist as immediate subdirectories, but some tests
are organized as follows.

* ``CMakeLib/``:
  Source code, used for tests, that links to the ``CMakeLib`` library
  defined over in ``Source/``.

* ``CMakeOnly/``:
  Deprecated.  Tests that run CMake to generate a project but not build it.
  Superseded by ``Tests/RunCMake/``.

* ``Find*/``:
  Tests for specific find modules that can only be run on machines with
  the corresponding packages installed.  They are enabled in
  ``CMakeLists.txt`` by undocumented options used on CI builds.

* ``Module/``:
  Tests for specific CMake modules.

* ``RunCMake/``:
  Tests that run CMake and/or other tools while precisely checking
  their return code and stdout/stderr content.  Useful for testing
  error cases and diagnostic output.