2014-01-20 22:44:27 +04:00
|
|
|
# See adjacent README.rst for documentation of this test infrastructure.
|
2012-03-10 01:24:43 +04:00
|
|
|
|
|
|
|
macro(add_RunCMake_test test)
|
2015-02-09 10:39:18 +03:00
|
|
|
set(TEST_ARGS ${ARGN})
|
|
|
|
if ("${ARGV1}" STREQUAL "TEST_DIR")
|
|
|
|
if ("${ARGV2}" STREQUAL "")
|
|
|
|
message(FATAL_ERROR "Invalid args")
|
|
|
|
endif()
|
|
|
|
set(Test_Dir ${ARGV2})
|
|
|
|
list(REMOVE_AT TEST_ARGS 0)
|
|
|
|
list(REMOVE_AT TEST_ARGS 0)
|
|
|
|
else()
|
|
|
|
set(Test_Dir ${test})
|
|
|
|
endif()
|
2014-12-16 00:44:59 +03:00
|
|
|
add_test(NAME RunCMake.${test} COMMAND ${CMAKE_CMAKE_COMMAND}
|
2012-03-10 01:24:43 +04:00
|
|
|
-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}
|
2014-03-03 23:06:34 +04:00
|
|
|
-DRunCMake_GENERATOR=${CMAKE_GENERATOR}
|
2014-09-05 23:40:01 +04:00
|
|
|
-DRunCMake_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
2014-03-03 23:06:34 +04:00
|
|
|
-DRunCMake_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
|
2015-01-24 15:08:12 +03:00
|
|
|
-DRunCMake_MAKE_PROGRAM=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
|
2015-02-09 10:39:18 +03:00
|
|
|
-DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${Test_Dir}
|
2012-03-10 01:24:43 +04:00
|
|
|
-DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test}
|
2012-12-20 19:16:57 +04:00
|
|
|
${${test}_ARGS}
|
2015-02-09 10:39:18 +03:00
|
|
|
${TEST_ARGS}
|
|
|
|
-P "${CMAKE_CURRENT_SOURCE_DIR}/${Test_Dir}/RunCMakeTest.cmake"
|
2012-03-10 01:24:43 +04:00
|
|
|
)
|
|
|
|
endmacro()
|
2012-03-10 01:34:09 +04:00
|
|
|
|
2015-06-05 22:03:26 +03:00
|
|
|
function(add_RunCMake_test_group test types)
|
|
|
|
# create directory for common content
|
|
|
|
set(TEST_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/${test}/conf")
|
|
|
|
file(REMOVE_RECURSE "${TEST_CONFIG_DIR}")
|
|
|
|
file(MAKE_DIRECTORY "${TEST_CONFIG_DIR}")
|
|
|
|
|
|
|
|
foreach(type IN LISTS types)
|
|
|
|
# generate prerequirements config file in cmake as ctest doesn't have as
|
|
|
|
# much system information so it is easier to set programs and environment
|
|
|
|
# values here
|
|
|
|
unset(${test}_${type}_FOUND_PREREQUIREMENTS)
|
|
|
|
include("${CMAKE_CURRENT_SOURCE_DIR}/${test}/${type}/Prerequirements.cmake")
|
|
|
|
get_test_prerequirements("${test}_${type}_FOUND_PREREQUIREMENTS"
|
|
|
|
"${TEST_CONFIG_DIR}/${type}_config.cmake")
|
|
|
|
|
|
|
|
# only add the test if prerequirements are met
|
|
|
|
if(${test}_${type}_FOUND_PREREQUIREMENTS)
|
|
|
|
add_test(NAME RunCMake.${test}_${type} COMMAND ${CMAKE_CMAKE_COMMAND}
|
|
|
|
-DTEST_TYPE=${type}
|
|
|
|
-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-DRunCMake_GENERATOR=${CMAKE_GENERATOR}
|
|
|
|
-DRunCMake_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
|
|
|
|
-DRunCMake_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
|
|
|
|
-DRunCMake_MAKE_PROGRAM=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
|
|
|
|
-DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test}
|
|
|
|
-DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${type}/${test}
|
|
|
|
-Dconfig_file=${TEST_CONFIG_DIR}/${type}_config.cmake
|
|
|
|
-P "${CMAKE_CURRENT_SOURCE_DIR}/${test}/RunCMakeTest.cmake"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|
|
|
|
|
2015-07-06 23:15:49 +03:00
|
|
|
if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1)
|
|
|
|
set(Swift_ARGS -DXCODE_BELOW_6_1=1)
|
|
|
|
endif()
|
|
|
|
|
2012-12-20 19:16:57 +04:00
|
|
|
if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 3)
|
|
|
|
set(GeneratorToolset_ARGS -DXCODE_BELOW_3=1)
|
|
|
|
endif()
|
|
|
|
|
2014-06-06 18:01:07 +04:00
|
|
|
if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 2)
|
|
|
|
set(TargetSources_ARGS -DXCODE_BELOW_2=1)
|
2014-07-17 17:31:53 +04:00
|
|
|
set(File_Generate_ARGS -DXCODE_BELOW_2=1)
|
2014-06-06 18:01:07 +04:00
|
|
|
endif()
|
|
|
|
|
2014-07-25 00:18:21 +04:00
|
|
|
# Test MSVC for older host CMake versions, and test
|
|
|
|
# WIN32/CMAKE_C_COMPILER_ID to fix check on Intel for Windows.
|
|
|
|
if(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel"))
|
|
|
|
set(GeneratorExpression_ARGS -DLINKER_SUPPORTS_PDB=1)
|
|
|
|
endif()
|
|
|
|
|
2012-12-06 18:59:18 +04:00
|
|
|
add_RunCMake_test(CMP0019)
|
2013-06-04 18:25:47 +04:00
|
|
|
add_RunCMake_test(CMP0022)
|
2013-06-28 18:37:39 +04:00
|
|
|
add_RunCMake_test(CMP0026)
|
2013-06-18 18:33:33 +04:00
|
|
|
add_RunCMake_test(CMP0027)
|
2013-07-30 11:51:56 +04:00
|
|
|
add_RunCMake_test(CMP0028)
|
2013-11-08 20:44:55 +04:00
|
|
|
add_RunCMake_test(CMP0037)
|
2013-11-05 21:01:09 +04:00
|
|
|
add_RunCMake_test(CMP0038)
|
2013-11-05 22:15:53 +04:00
|
|
|
add_RunCMake_test(CMP0039)
|
2013-11-20 12:53:06 +04:00
|
|
|
add_RunCMake_test(CMP0040)
|
2013-11-26 14:24:47 +04:00
|
|
|
add_RunCMake_test(CMP0041)
|
2013-12-19 08:25:29 +04:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES Darwin AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
|
|
|
|
add_RunCMake_test(CMP0042)
|
|
|
|
endif()
|
2013-12-30 16:33:02 +04:00
|
|
|
add_RunCMake_test(CMP0043)
|
2014-01-08 16:16:33 +04:00
|
|
|
add_RunCMake_test(CMP0045)
|
2014-01-12 15:58:04 +04:00
|
|
|
add_RunCMake_test(CMP0046)
|
2014-02-11 20:41:24 +04:00
|
|
|
add_RunCMake_test(CMP0049)
|
2014-02-11 21:39:55 +04:00
|
|
|
add_RunCMake_test(CMP0050)
|
2014-03-18 19:15:15 +04:00
|
|
|
add_RunCMake_test(CMP0051)
|
2014-05-21 01:00:28 +04:00
|
|
|
add_RunCMake_test(CMP0053)
|
2014-09-04 22:21:28 +04:00
|
|
|
add_RunCMake_test(CMP0054)
|
2014-11-18 18:34:32 +03:00
|
|
|
add_RunCMake_test(CMP0055)
|
2015-04-29 18:25:13 +03:00
|
|
|
add_RunCMake_test(CMP0057)
|
2015-04-01 21:53:31 +03:00
|
|
|
add_RunCMake_test(CMP0059)
|
2015-04-07 17:43:47 +03:00
|
|
|
add_RunCMake_test(CMP0060)
|
2014-12-30 04:47:48 +03:00
|
|
|
add_RunCMake_test(CMP0064)
|
2015-08-24 21:33:31 +03:00
|
|
|
|
|
|
|
# The test for Policy 65 requires the use of the
|
|
|
|
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
|
|
|
|
# generators ignore. The policy will have no effect on those generators.
|
|
|
|
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
|
|
|
|
add_RunCMake_test(CMP0065)
|
|
|
|
endif()
|
2015-07-14 20:31:21 +03:00
|
|
|
if(CMAKE_GENERATOR MATCHES "Make")
|
|
|
|
add_RunCMake_test(Make)
|
|
|
|
endif()
|
2015-03-20 23:43:21 +03:00
|
|
|
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
|
|
|
add_RunCMake_test(Ninja)
|
|
|
|
endif()
|
2013-03-13 02:20:01 +04:00
|
|
|
add_RunCMake_test(CTest)
|
2014-12-16 21:50:30 +03:00
|
|
|
|
|
|
|
if(NOT CMake_TEST_EXTERNAL_CMAKE)
|
2015-02-19 19:35:51 +03:00
|
|
|
add_RunCMake_test(ctest_memcheck
|
2014-12-16 21:50:30 +03:00
|
|
|
-DPSEUDO_BC=$<TARGET_FILE:pseudo_BC>
|
|
|
|
-DPSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify>
|
|
|
|
-DPSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind>
|
|
|
|
-DPSEUDO_BC_NOLOG=$<TARGET_FILE:pseudonl_BC>
|
|
|
|
-DPSEUDO_PURIFY_NOLOG=$<TARGET_FILE:pseudonl_purify>
|
|
|
|
-DPSEUDO_VALGRIND_NOLOG=$<TARGET_FILE:pseudonl_valgrind>
|
|
|
|
-DMEMCHECK_FAIL=$<TARGET_FILE:memcheck_fail>
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2016-09-15 22:31:39 +03:00
|
|
|
add_RunCMake_test(AndroidTestUtilities)
|
2015-09-16 17:09:07 +03:00
|
|
|
add_RunCMake_test(BuildDepends)
|
2014-09-21 00:37:52 +04:00
|
|
|
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
|
2013-02-18 19:35:53 +04:00
|
|
|
add_RunCMake_test(CompilerChange)
|
|
|
|
endif()
|
2013-10-24 21:04:24 +04:00
|
|
|
add_RunCMake_test(CompilerNotFound)
|
2013-07-09 22:35:49 +04:00
|
|
|
add_RunCMake_test(Configure)
|
2013-10-18 19:54:09 +04:00
|
|
|
add_RunCMake_test(DisallowedCommands)
|
2013-01-26 01:39:57 +04:00
|
|
|
add_RunCMake_test(ExternalData)
|
2014-03-03 22:51:57 +04:00
|
|
|
add_RunCMake_test(FeatureSummary)
|
2013-02-22 17:44:13 +04:00
|
|
|
add_RunCMake_test(FPHSA)
|
2016-09-01 22:22:05 +03:00
|
|
|
if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom")
|
|
|
|
add_RunCMake_test(GenerateExportHeader)
|
|
|
|
endif()
|
2012-08-13 17:49:53 +04:00
|
|
|
add_RunCMake_test(GeneratorExpression)
|
2014-09-05 22:25:27 +04:00
|
|
|
add_RunCMake_test(GeneratorPlatform)
|
2012-12-10 19:42:33 +04:00
|
|
|
add_RunCMake_test(GeneratorToolset)
|
2015-06-16 21:59:51 +03:00
|
|
|
add_RunCMake_test(GNUInstallDirs)
|
2012-09-18 15:57:07 +04:00
|
|
|
add_RunCMake_test(TargetPropertyGeneratorExpressions)
|
2012-06-20 19:04:35 +04:00
|
|
|
add_RunCMake_test(Languages)
|
2015-09-02 23:09:22 +03:00
|
|
|
add_RunCMake_test(LinkStatic)
|
2012-03-12 22:51:30 +04:00
|
|
|
add_RunCMake_test(ObjectLibrary)
|
2015-07-06 23:15:49 +03:00
|
|
|
add_RunCMake_test(Swift)
|
2014-02-26 18:59:18 +04:00
|
|
|
add_RunCMake_test(TargetObjects)
|
2014-02-13 20:25:00 +04:00
|
|
|
add_RunCMake_test(TargetSources)
|
2016-03-07 21:31:25 +03:00
|
|
|
add_RunCMake_test(ToolchainFile)
|
2014-03-11 17:36:58 +04:00
|
|
|
add_RunCMake_test(find_dependency)
|
2015-07-21 23:52:44 +03:00
|
|
|
add_RunCMake_test(CompileDefinitions)
|
2014-04-02 17:34:16 +04:00
|
|
|
add_RunCMake_test(CompileFeatures)
|
2015-08-01 08:16:40 +03:00
|
|
|
add_RunCMake_test(PolicyScope)
|
2013-10-21 18:59:40 +04:00
|
|
|
add_RunCMake_test(WriteCompilerDetectionHeader)
|
2012-11-05 15:46:26 +04:00
|
|
|
if(NOT WIN32)
|
|
|
|
add_RunCMake_test(PositionIndependentCode)
|
2015-05-22 17:43:34 +03:00
|
|
|
endif()
|
|
|
|
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
|
|
|
add_RunCMake_test(VisibilityPreset)
|
2012-11-05 15:46:26 +04:00
|
|
|
endif()
|
2013-12-03 16:26:51 +04:00
|
|
|
if (QT4_FOUND)
|
|
|
|
set(CompatibleInterface_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
|
|
|
|
endif()
|
2013-01-19 14:21:14 +04:00
|
|
|
add_RunCMake_test(CompatibleInterface)
|
2012-08-06 17:29:20 +04:00
|
|
|
add_RunCMake_test(Syntax)
|
2012-03-12 22:51:30 +04:00
|
|
|
|
2014-11-13 20:46:49 +03:00
|
|
|
add_RunCMake_test(add_custom_command)
|
|
|
|
add_RunCMake_test(add_custom_target)
|
2013-03-29 22:53:36 +04:00
|
|
|
add_RunCMake_test(add_dependencies)
|
2015-08-04 23:39:31 +03:00
|
|
|
add_RunCMake_test(add_subdirectory)
|
2012-03-10 01:47:19 +04:00
|
|
|
add_RunCMake_test(build_command)
|
2015-05-07 21:40:38 +03:00
|
|
|
add_RunCMake_test(execute_process)
|
2013-12-02 20:18:29 +04:00
|
|
|
add_RunCMake_test(export)
|
2013-10-18 19:25:49 +04:00
|
|
|
add_RunCMake_test(cmake_minimum_required)
|
2015-12-05 20:57:41 +03:00
|
|
|
add_RunCMake_test(cmake_parse_arguments)
|
2014-11-29 19:56:18 +03:00
|
|
|
add_RunCMake_test(continue)
|
2015-02-17 21:41:40 +03:00
|
|
|
add_RunCMake_test(ctest_build)
|
2016-07-28 22:12:43 +03:00
|
|
|
add_RunCMake_test(ctest_cmake_error)
|
2015-02-17 20:38:52 +03:00
|
|
|
add_RunCMake_test(ctest_configure)
|
2015-02-17 23:57:26 +03:00
|
|
|
if(COVERAGE_COMMAND)
|
|
|
|
add_RunCMake_test(ctest_coverage -DCOVERAGE_COMMAND=${COVERAGE_COMMAND})
|
|
|
|
endif()
|
2015-02-17 17:58:25 +03:00
|
|
|
add_RunCMake_test(ctest_start)
|
2015-02-19 19:33:32 +03:00
|
|
|
add_RunCMake_test(ctest_submit)
|
2015-02-17 22:23:56 +03:00
|
|
|
add_RunCMake_test(ctest_test)
|
2015-02-18 17:15:29 +03:00
|
|
|
add_RunCMake_test(ctest_upload)
|
2016-09-07 07:04:07 +03:00
|
|
|
add_RunCMake_test(ctest_fixtures)
|
2014-05-20 18:42:13 +04:00
|
|
|
add_RunCMake_test(file)
|
2015-02-18 18:54:45 +03:00
|
|
|
add_RunCMake_test(find_file)
|
2014-12-08 23:12:51 +03:00
|
|
|
add_RunCMake_test(find_library)
|
2012-03-10 01:34:09 +04:00
|
|
|
add_RunCMake_test(find_package)
|
2015-02-18 18:54:45 +03:00
|
|
|
add_RunCMake_test(find_path)
|
2015-09-01 23:33:24 +03:00
|
|
|
add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
|
2013-04-16 17:27:51 +04:00
|
|
|
add_RunCMake_test(get_filename_component)
|
2015-01-08 23:27:46 +03:00
|
|
|
add_RunCMake_test(get_property)
|
2013-05-28 19:13:24 +04:00
|
|
|
add_RunCMake_test(if)
|
2012-07-10 18:55:02 +04:00
|
|
|
add_RunCMake_test(include)
|
2012-10-15 12:27:42 +04:00
|
|
|
add_RunCMake_test(include_directories)
|
2012-04-17 18:32:46 +04:00
|
|
|
add_RunCMake_test(list)
|
2013-09-17 20:54:34 +04:00
|
|
|
add_RunCMake_test(message)
|
2016-09-27 16:33:58 +03:00
|
|
|
add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES})
|
2014-11-18 18:34:29 +03:00
|
|
|
add_RunCMake_test(return)
|
2015-07-08 20:14:37 +03:00
|
|
|
add_RunCMake_test(set_property)
|
2013-10-21 20:49:15 +04:00
|
|
|
add_RunCMake_test(string)
|
2013-05-15 23:19:20 +04:00
|
|
|
add_RunCMake_test(try_compile)
|
2015-01-23 03:13:56 +03:00
|
|
|
add_RunCMake_test(try_run)
|
2013-11-13 12:18:18 +04:00
|
|
|
add_RunCMake_test(set)
|
2013-06-03 17:23:25 +04:00
|
|
|
add_RunCMake_test(variable_watch)
|
2015-07-14 16:41:05 +03:00
|
|
|
add_RunCMake_test(while)
|
2013-01-16 19:42:39 +04:00
|
|
|
add_RunCMake_test(CMP0004)
|
2013-06-28 13:25:40 +04:00
|
|
|
add_RunCMake_test(TargetPolicies)
|
2013-07-12 11:14:31 +04:00
|
|
|
add_RunCMake_test(alias_targets)
|
2012-11-02 18:47:40 +04:00
|
|
|
add_RunCMake_test(interface_library)
|
2013-10-29 13:40:09 +04:00
|
|
|
add_RunCMake_test(no_install_prefix)
|
2014-03-07 09:55:07 +04:00
|
|
|
add_RunCMake_test(configure_file)
|
2016-02-18 21:59:18 +03:00
|
|
|
add_RunCMake_test(CTestTimeoutAfterMatch)
|
2012-04-19 16:35:10 +04:00
|
|
|
|
2013-03-16 21:25:59 +04:00
|
|
|
find_package(Qt4 QUIET)
|
|
|
|
find_package(Qt5Core QUIET)
|
2013-03-27 03:15:08 +04:00
|
|
|
if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0)
|
2013-03-16 21:25:59 +04:00
|
|
|
add_RunCMake_test(IncompatibleQt)
|
|
|
|
endif()
|
2013-07-04 12:00:27 +04:00
|
|
|
if (QT4_FOUND)
|
2014-12-16 00:46:05 +03:00
|
|
|
add_RunCMake_test(ObsoleteQtMacros -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
|
2013-07-04 12:00:27 +04:00
|
|
|
endif()
|
2013-03-16 21:25:59 +04:00
|
|
|
|
FindPkgConfig: Extend PKG_CONFIG_PATH using CMake variables (#12926)
Use CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, and CMAKE_APPBUNDLE_PATH
cache and environment variables to extend PKG_CONFIG_PATH before calling
pkg-config.
In each of the path in these variables it searches for lib/pkgconfig.
Then, depending on the system, it searches for
lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig (debian) or for
lib64/pkgconfig (other 64 bit unixes). If any of these path is found,
it is appended to the PKG_CONFIG_PATH enviromnent variable.
Add two new arguments to the pkg_check_module and pkg_search_module
macro, NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH. The new signature
are therefore:
pkg_check_modules(<PREFIX> [REQUIRED] [QUIET]
[NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
<MODULE> [<MODULE>]*)
pkg_search_module(<PREFIX> [REQUIRED] [QUIET]
[NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
<MODULE> [<MODULE>]*)
By default, if CMAKE_MINIMUM_REQUIRED_VERSION is 3.1 or later (in
order to keep compatibility with the previous behavior), or if
PKG_CONFIG_USE_CMAKE_PREFIX_PATH is set, the CMAKE_PREFIX_PATH,
CMAKE_FRAMEWORK_PATH, and CMAKE_APPBUNDLE_PATH cache and environment
variables will be added to pkgconfig search path.
The NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH arguments disable this
behavior for the cache variables and the environment variables,
respectively, similarly to the find_package() command.
2014-03-06 21:55:04 +04:00
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
if(PKG_CONFIG_FOUND)
|
|
|
|
add_RunCMake_test(FindPkgConfig)
|
|
|
|
endif()
|
|
|
|
|
2016-03-09 17:42:18 +03:00
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
2012-04-19 16:35:10 +04:00
|
|
|
add_RunCMake_test(include_external_msproject)
|
2016-03-21 23:01:20 +03:00
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([789]|10)" AND NOT CMAKE_VS_DEVENV_COMMAND)
|
|
|
|
set(NO_USE_FOLDERS 1)
|
|
|
|
endif()
|
|
|
|
add_RunCMake_test(VSSolution -DNO_USE_FOLDERS=${NO_USE_FOLDERS})
|
2012-04-19 16:35:10 +04:00
|
|
|
endif()
|
2013-01-02 20:10:04 +04:00
|
|
|
|
2016-03-09 17:42:18 +03:00
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^789]|[789][0-9])")
|
2016-02-26 00:04:05 +03:00
|
|
|
add_RunCMake_test(VS10Project)
|
|
|
|
endif()
|
|
|
|
|
2014-05-15 21:50:53 +04:00
|
|
|
if(XCODE_VERSION AND NOT "${XCODE_VERSION}" VERSION_LESS 3)
|
2015-02-22 21:00:11 +03:00
|
|
|
add_RunCMake_test(XcodeProject -DXCODE_VERSION=${XCODE_VERSION})
|
2014-05-15 21:50:53 +04:00
|
|
|
endif()
|
|
|
|
|
2015-11-13 14:59:18 +03:00
|
|
|
if(NOT XCODE
|
|
|
|
AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
|
|
|
|
AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
|
|
|
|
add_RunCMake_test(Framework)
|
|
|
|
endif()
|
|
|
|
|
2013-01-02 20:10:04 +04:00
|
|
|
add_RunCMake_test(File_Generate)
|
2013-07-23 01:25:21 +04:00
|
|
|
add_RunCMake_test(ExportWithoutLanguage)
|
2013-06-04 18:21:33 +04:00
|
|
|
add_RunCMake_test(target_link_libraries)
|
2013-10-13 16:25:08 +04:00
|
|
|
|
2014-04-16 19:20:15 +04:00
|
|
|
add_RunCMake_test(target_compile_features)
|
2013-09-20 17:10:40 +04:00
|
|
|
add_RunCMake_test(CheckModules)
|
2014-01-20 22:50:31 +04:00
|
|
|
add_RunCMake_test(CommandLine)
|
2015-04-07 20:40:33 +03:00
|
|
|
add_RunCMake_test(CommandLineTar)
|
2013-12-25 20:59:24 +04:00
|
|
|
|
|
|
|
add_RunCMake_test(install)
|
2015-08-28 09:07:52 +03:00
|
|
|
add_RunCMake_test(CPackConfig)
|
2014-05-15 21:12:40 +04:00
|
|
|
add_RunCMake_test(CPackInstallProperties)
|
2014-10-28 13:05:57 +03:00
|
|
|
add_RunCMake_test(ExternalProject)
|
2015-03-06 00:51:10 +03:00
|
|
|
add_RunCMake_test(CTestCommandLine)
|
2015-03-31 22:04:39 +03:00
|
|
|
# Only run this test on unix platforms that support
|
|
|
|
# symbolic links
|
|
|
|
if(UNIX)
|
|
|
|
add_RunCMake_test(CPackSymlinks)
|
|
|
|
endif()
|
2014-11-30 15:42:00 +03:00
|
|
|
|
|
|
|
set(IfacePaths_INCLUDE_DIRECTORIES_ARGS -DTEST_PROP=INCLUDE_DIRECTORIES)
|
|
|
|
add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths)
|
2015-01-21 02:29:46 +03:00
|
|
|
|
2014-11-28 20:58:38 +03:00
|
|
|
set(IfacePaths_SOURCES_ARGS -DTEST_PROP=SOURCES)
|
|
|
|
add_RunCMake_test(IfacePaths_SOURCES TEST_DIR IfacePaths)
|
|
|
|
|
2014-11-26 00:47:44 +03:00
|
|
|
add_RunCMake_test(COMPILE_LANGUAGE-genex)
|
2015-02-12 19:13:31 +03:00
|
|
|
|
|
|
|
# Matlab module related tests
|
|
|
|
if(CMake_TEST_FindMatlab)
|
|
|
|
add_RunCMake_test(FindMatlab)
|
|
|
|
endif()
|
2015-03-24 07:02:50 +03:00
|
|
|
|
|
|
|
add_executable(pseudo_emulator pseudo_emulator.c)
|
2016-05-04 20:30:19 +03:00
|
|
|
add_executable(pseudo_emulator_custom_command pseudo_emulator_custom_command.c)
|
2015-03-24 07:02:50 +03:00
|
|
|
add_RunCMake_test(CrosscompilingEmulator
|
2016-05-04 20:30:19 +03:00
|
|
|
-DPSEUDO_EMULATOR=$<TARGET_FILE:pseudo_emulator>
|
|
|
|
-DPSEUDO_EMULATOR_CUSTOM_COMMAND=$<TARGET_FILE:pseudo_emulator_custom_command>)
|
2015-04-10 19:42:49 +03:00
|
|
|
# Xcode 2.x forgets to create the output directory before linking
|
|
|
|
# the individual architectures.
|
|
|
|
if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
|
|
|
|
add_custom_command(
|
|
|
|
TARGET pseudo_emulator
|
|
|
|
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
|
|
|
|
)
|
2016-05-04 20:30:19 +03:00
|
|
|
add_custom_command(
|
|
|
|
TARGET pseudo_emulator_custom_command
|
|
|
|
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
|
|
|
|
)
|
2015-04-10 19:42:49 +03:00
|
|
|
endif()
|
2015-05-18 21:39:25 +03:00
|
|
|
|
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
|
2016-06-03 01:08:30 +03:00
|
|
|
if(UNIX AND NOT CYGWIN)
|
|
|
|
execute_process(COMMAND ldd --help
|
2016-07-21 22:38:47 +03:00
|
|
|
OUTPUT_VARIABLE LDD_HELP
|
|
|
|
ERROR_VARIABLE LDD_ERR)
|
2016-06-03 01:08:30 +03:00
|
|
|
if("${LDD_HELP}" MATCHES
|
|
|
|
"(-r, --function-relocs.*process data and function relocations.*-u, --unused.*print unused direct dependencies)")
|
|
|
|
add_RunCMake_test(LinkWhatYouUse)
|
|
|
|
endif()
|
|
|
|
endif()
|
2016-04-08 23:09:27 +03:00
|
|
|
add_executable(pseudo_tidy pseudo_tidy.c)
|
2015-05-18 21:39:25 +03:00
|
|
|
add_executable(pseudo_iwyu pseudo_iwyu.c)
|
2016-04-08 23:09:27 +03:00
|
|
|
add_RunCMake_test(ClangTidy -DPSEUDO_TIDY=$<TARGET_FILE:pseudo_tidy>)
|
2015-05-18 21:39:25 +03:00
|
|
|
add_RunCMake_test(IncludeWhatYouUse -DPSEUDO_IWYU=$<TARGET_FILE:pseudo_iwyu>)
|
2015-06-04 22:56:56 +03:00
|
|
|
add_RunCMake_test(CompilerLauncher)
|
2015-05-18 21:39:25 +03:00
|
|
|
endif()
|
2015-06-05 22:03:26 +03:00
|
|
|
|
2015-09-28 23:50:15 +03:00
|
|
|
add_RunCMake_test_group(CPack "DEB;RPM;TGZ")
|
2015-06-19 23:12:43 +03:00
|
|
|
# add a test to make sure symbols are exported from a shared library
|
|
|
|
# for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used
|
|
|
|
add_RunCMake_test(AutoExportDll)
|
2016-06-21 23:18:56 +03:00
|
|
|
|
2016-07-12 20:26:55 +03:00
|
|
|
add_RunCMake_test(AndroidMK)
|
|
|
|
|
2016-06-21 23:18:56 +03:00
|
|
|
if(CMake_TEST_ANDROID_NDK OR CMake_TEST_ANDROID_STANDALONE_TOOLCHAIN)
|
|
|
|
if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
|
|
|
|
message(FATAL_ERROR "Android tests supported only by Makefile and Ninja generators")
|
|
|
|
endif()
|
|
|
|
foreach(v TEST_ANDROID_NDK TEST_ANDROID_STANDALONE_TOOLCHAIN)
|
|
|
|
if(CMake_${v})
|
|
|
|
string(REPLACE ";" "|" ${v} "${CMake_${v}}")
|
|
|
|
list(APPEND Android_ARGS "-D${v}=${${v}}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_RunCMake_test(Android)
|
|
|
|
|
|
|
|
# This test can take a very long time due to lots of combinations.
|
|
|
|
# Use a long default timeout and provide an option to customize it.
|
|
|
|
if(NOT DEFINED CMake_TEST_ANDROID_TIMEOUT)
|
|
|
|
set(CMake_TEST_ANDROID_TIMEOUT 3000)
|
|
|
|
endif()
|
|
|
|
set_property(TEST RunCMake.Android PROPERTY TIMEOUT ${CMake_TEST_ANDROID_TIMEOUT})
|
|
|
|
endif()
|