mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-27 04:09:36 +03:00
Extend the automatic export system of install(PACKAGE_INFO) and export(PACKAGE_INFO) to handle targets created with cmake_pkg_config, and allow find_package to resolve CPS requirements in the pkg-config domain. A pkg-config package has no components of its own, so it is exposed to CPS as a package named after itself with a single component of the same name; such references take the form "<PkgName>:<PkgName>" and resolve directly to the foreign target which provides the package. The domains in which a requirement may be found are recorded in a CMake extension section rather than a non-standard `domains` attribute.
67 lines
1.9 KiB
CMake
67 lines
1.9 KiB
CMake
include(RunCMake)
|
|
|
|
function(run_cmake_install test)
|
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
|
|
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
|
list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
|
|
endif()
|
|
|
|
run_cmake(${test})
|
|
|
|
set(RunCMake_TEST_NO_CLEAN TRUE)
|
|
run_cmake_command(${test}-build ${CMAKE_COMMAND} --build . --config Release)
|
|
run_cmake_command(${test}-install ${CMAKE_COMMAND} --install . --config Release)
|
|
endfunction()
|
|
|
|
# Test incorrect usage
|
|
run_cmake(BadArgs0)
|
|
run_cmake(BadArgs1)
|
|
run_cmake(BadArgs2)
|
|
run_cmake(BadArgs3)
|
|
run_cmake(BadName)
|
|
run_cmake(BadDefaultTarget)
|
|
run_cmake(ReferencesNonExportedTarget)
|
|
run_cmake(ReferencesWronglyExportedTarget)
|
|
run_cmake(ReferencesWronglyImportedTarget)
|
|
run_cmake(ReferencesWronglyNamespacedTarget)
|
|
run_cmake(DependsMultipleDifferentNamespace)
|
|
run_cmake(DependsMultipleDifferentSets)
|
|
foreach(imported IN ITEMS ON OFF)
|
|
foreach(pkg_config_first IN ITEMS ON OFF)
|
|
set(RunCMake_TEST_VARIANT_DESCRIPTION
|
|
" (imported=${imported}, pkg_config_first=${pkg_config_first})")
|
|
run_cmake_with_options(PkgConfigCollision
|
|
-Dimported=${imported}
|
|
-Dpkg_config_first=${pkg_config_first})
|
|
endforeach()
|
|
endforeach()
|
|
unset(RunCMake_TEST_VARIANT_DESCRIPTION)
|
|
|
|
# Test functionality
|
|
run_cmake(Appendix)
|
|
run_cmake(Component)
|
|
run_cmake(InterfaceProperties)
|
|
run_cmake(Metadata)
|
|
run_cmake(ProjectMetadata)
|
|
run_cmake(NoProjectMetadata)
|
|
run_cmake(Minimal)
|
|
run_cmake(MinimalVersion)
|
|
run_cmake(LowerCaseFile)
|
|
run_cmake(Requirements)
|
|
run_cmake(PkgConfig)
|
|
run_cmake(PrivateLinkDependency)
|
|
run_cmake(TargetTypes)
|
|
run_cmake(DependsMultiple)
|
|
run_cmake(DependsMultipleNotInstalled)
|
|
run_cmake(Config)
|
|
run_cmake(EmptyConfig)
|
|
run_cmake(FileSetHeaders)
|
|
run_cmake(DependencyVersionCMake)
|
|
run_cmake(DependencyVersionCps)
|
|
run_cmake(TransitiveSymbolicComponent)
|
|
run_cmake(InstallSymbolicComponent)
|
|
run_cmake(VersionCheck)
|
|
run_cmake(VersionCheckWarning)
|
|
run_cmake(VersionCheckError)
|
|
run_cmake_install(Destination)
|