diff options
48 files changed, 844 insertions, 630 deletions
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..d934bf9 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,7 @@ +Thanks for your interest in contributing to CMake! The GitHub repository +is a mirror provided for convenience, but CMake does not use GitHub pull +requests for contribution. Please see + + https://gitlab.kitware.com/cmake/cmake/tree/master/CONTRIBUTING.rst + +for contribution instructions. GitHub OAuth may be used to sign in. diff --git a/CMakeLists.txt b/CMakeLists.txt index 831e25f..e60dc78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -529,42 +529,21 @@ macro (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- # Build libuv library. - if(NOT DEFINED CMAKE_USE_LIBUV) - set(CMAKE_USE_LIBUV 1) - if(APPLE) - include(CheckCSourceCompiles) - check_c_source_compiles(" -#include <CoreServices/CoreServices.h> -#include <AvailabilityMacros.h> -#ifndef MAC_OS_X_VERSION_10_5 -#error \"MAC_OS_X_VERSION_10_5 is not defined\" -#endif -int main(void) { return 0; } -" HAVE_CoreServices_OS_X_10_5) - if(NOT HAVE_CoreServices_OS_X_10_5) - set(CMAKE_USE_LIBUV 0) - endif() - endif() - endif() - if(CMAKE_USE_LIBUV) - if(CMAKE_USE_SYSTEM_LIBUV) - if(NOT CMAKE_VERSION VERSION_LESS 3.0) - find_package(LibUV 1.0.0) - else() - message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBUV requires CMake >= 3.0") - endif() - if(NOT LIBUV_FOUND) - message(FATAL_ERROR - "CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!") - endif() - set(CMAKE_LIBUV_LIBRARIES LibUV::LibUV) + if(CMAKE_USE_SYSTEM_LIBUV) + if(NOT CMAKE_VERSION VERSION_LESS 3.0) + find_package(LibUV 1.0.0) else() - set(CMAKE_LIBUV_LIBRARIES cmlibuv) - add_subdirectory(Utilities/cmlibuv) - CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty") + message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBUV requires CMake >= 3.0") endif() + if(NOT LIBUV_FOUND) + message(FATAL_ERROR + "CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!") + endif() + set(CMAKE_LIBUV_LIBRARIES LibUV::LibUV) else() - set(CMAKE_LIBUV_LIBRARIES) + set(CMAKE_LIBUV_LIBRARIES cmlibuv) + add_subdirectory(Utilities/cmlibuv) + CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty") endif() #--------------------------------------------------------------------- @@ -758,8 +737,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) if(NOT DEFINED CMake_ENABLE_SERVER_MODE) list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_auto_type CMake_HAVE_CXX_AUTO_TYPE) list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_range_for CMake_HAVE_CXX_RANGE_FOR) - if(CMAKE_USE_LIBUV - AND CMake_HAVE_CXX_AUTO_TYPE + if(CMake_HAVE_CXX_AUTO_TYPE AND CMake_HAVE_CXX_MAKE_UNIQUE AND CMake_HAVE_CXX_RANGE_FOR ) @@ -768,9 +746,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) set(CMake_ENABLE_SERVER_MODE 0) endif() endif() - if(CMake_ENABLE_SERVER_MODE AND NOT CMAKE_USE_LIBUV) - message(FATAL_ERROR "The server mode requires libuv!") - endif() else() set(CMake_ENABLE_SERVER_MODE 0) endif() diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 3c84c2b..381769d 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -29,7 +29,8 @@ To contribute patches: #. Base all new work on the upstream ``master`` branch. Base work on the upstream ``release`` branch only if it fixes a regression or bug in a feature new to that release. -#. Create commits making incremental, distinct, logically complete changes. +#. Create commits making incremental, distinct, logically complete changes + with appropriate `commit messages`_. #. Push a topic branch to a personal repository fork on GitLab. #. Create a GitLab Merge Request targeting the upstream ``master`` branch (even if the change is intended for merge to the ``release`` branch). @@ -40,6 +41,7 @@ The merge request will enter the `CMake Review Process`_ for consideration. .. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake .. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh .. _`CMake Source Code Guide`: Help/dev/source.rst +.. _`commit messages`: Help/dev/review.rst#commit-messages .. _`CMake Review Process`: Help/dev/review.rst License diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt index 8a0fc8d..7db221c 100644 --- a/Help/command/FIND_XXX.txt +++ b/Help/command/FIND_XXX.txt @@ -16,7 +16,6 @@ The general signature is: [PATH_SUFFIXES suffix1 [suffix2 ...]] [DOC "cache documentation string"] [NO_DEFAULT_PATH] - [NO_PACKAGE_ROOT_PATH] [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH] [NO_SYSTEM_ENVIRONMENT_PATH] @@ -61,10 +60,6 @@ If ``NO_DEFAULT_PATH`` is specified, then no additional paths are added to the search. If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: -.. |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX_SUBDIR| replace:: - |prefix_XXX_SUBDIR| for each ``<prefix>`` in ``PackageName_ROOT`` if called - from within a find module - .. |CMAKE_PREFIX_PATH_XXX_SUBDIR| replace:: |prefix_XXX_SUBDIR| for each ``<prefix>`` in :variable:`CMAKE_PREFIX_PATH` @@ -76,18 +71,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: |prefix_XXX_SUBDIR| for each ``<prefix>`` in :variable:`CMAKE_SYSTEM_PREFIX_PATH` -1. If called from within a find module, search prefix paths unique to the - current package being found. Specifically look in the ``PackageName_ROOT`` - CMake and environment variables. The package root variables are maintained - as a stack so if called from nested find modules, root paths from the - parent's find module will be searchd after paths from the current module, - i.e. ``CurrentPackage_ROOT``, ``ENV{CurrentPackage_ROOT}``, - ``ParentPackage_ROOT``, ``ENV{ParentPacakge_ROOT}``, etc. - This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed. - - * |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX| - -2. Search paths specified in cmake-specific cache variables. +1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a ``-DVAR=value``. The values are interpreted as :ref:`;-lists <CMake Language Lists>`. This can be skipped if ``NO_CMAKE_PATH`` is passed. @@ -96,7 +80,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: * |CMAKE_XXX_PATH| * |CMAKE_XXX_MAC_PATH| -3. Search paths specified in cmake-specific environment variables. +2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration, and therefore use the host's native path separator (``;`` on Windows and ``:`` on UNIX). @@ -106,17 +90,17 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: * |CMAKE_XXX_PATH| * |CMAKE_XXX_MAC_PATH| -4. Search the paths specified by the ``HINTS`` option. +3. Search the paths specified by the ``HINTS`` option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the ``PATHS`` option. -5. Search the standard system environment variables. +4. Search the standard system environment variables. This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is an argument. * |SYSTEM_ENVIRONMENT_PATH_XXX| -6. Search cmake variables defined in the Platform files +5. Search cmake variables defined in the Platform files for the current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed. @@ -124,7 +108,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: * |CMAKE_SYSTEM_XXX_PATH| * |CMAKE_SYSTEM_XXX_MAC_PATH| -7. Search the paths specified by the PATHS option +6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses. diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst index 2a14ad7..e56097b 100644 --- a/Help/command/find_file.rst +++ b/Help/command/find_file.rst @@ -8,9 +8,6 @@ find_file .. |prefix_XXX_SUBDIR| replace:: ``<prefix>/include`` .. |entry_XXX_SUBDIR| replace:: ``<entry>/include`` -.. |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX| replace:: - ``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` - is set, and |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX_SUBDIR| .. |CMAKE_PREFIX_PATH_XXX| replace:: ``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set, and |CMAKE_PREFIX_PATH_XXX_SUBDIR| diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst index 0861d67..f774f17 100644 --- a/Help/command/find_library.rst +++ b/Help/command/find_library.rst @@ -8,9 +8,6 @@ find_library .. |prefix_XXX_SUBDIR| replace:: ``<prefix>/lib`` .. |entry_XXX_SUBDIR| replace:: ``<entry>/lib`` -.. |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX| replace:: - ``<prefix>/lib/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set, - and |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX_SUBDIR| .. |CMAKE_PREFIX_PATH_XXX| replace:: ``<prefix>/lib/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set, and |CMAKE_PREFIX_PATH_XXX_SUBDIR| diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index 08c6ccd..83f4716 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -64,7 +64,6 @@ The complete Config mode command signature is:: [PATHS path1 [path2 ... ]] [PATH_SUFFIXES suffix1 [suffix2 ...]] [NO_DEFAULT_PATH] - [NO_PACAKGE_ROOT_PATH] [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH] [NO_SYSTEM_ENVIRONMENT_PATH] @@ -250,13 +249,7 @@ The set of installation prefixes is constructed using the following steps. If ``NO_DEFAULT_PATH`` is specified all ``NO_*`` options are enabled. -1. Search paths specified in the ``PackageName_ROOT`` CMake and environment - variables. The package root variables are maintained as a stack so if - called from within a find module, root paths from the parent's find - module will also be searched after paths for the current package. This can - be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed. - -2. Search paths specified in cmake-specific cache variables. These +1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a ``-DVAR=value``. The values are interpreted as :ref:`;-lists <CMake Language Lists>`. This can be skipped if ``NO_CMAKE_PATH`` is passed:: @@ -265,7 +258,7 @@ enabled. CMAKE_FRAMEWORK_PATH CMAKE_APPBUNDLE_PATH -3. Search paths specified in cmake-specific environment variables. +2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration, and therefore use the host's native path separator (``;`` on Windows and ``:`` on UNIX). @@ -276,26 +269,26 @@ enabled. CMAKE_FRAMEWORK_PATH CMAKE_APPBUNDLE_PATH -4. Search paths specified by the ``HINTS`` option. These should be paths +3. Search paths specified by the ``HINTS`` option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the ``PATHS`` option. -5. Search the standard system environment variables. This can be +4. Search the standard system environment variables. This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed. Path entries ending in ``/bin`` or ``/sbin`` are automatically converted to their parent directories:: PATH -6. Search paths stored in the CMake :ref:`User Package Registry`. +5. Search paths stored in the CMake :ref:`User Package Registry`. This can be skipped if ``NO_CMAKE_PACKAGE_REGISTRY`` is passed or by setting the :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` to ``TRUE``. See the :manual:`cmake-packages(7)` manual for details on the user package registry. -7. Search cmake variables defined in the Platform files for the +6. Search cmake variables defined in the Platform files for the current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed:: @@ -303,14 +296,14 @@ enabled. CMAKE_SYSTEM_FRAMEWORK_PATH CMAKE_SYSTEM_APPBUNDLE_PATH -8. Search paths stored in the CMake :ref:`System Package Registry`. +7. Search paths stored in the CMake :ref:`System Package Registry`. This can be skipped if ``NO_CMAKE_SYSTEM_PACKAGE_REGISTRY`` is passed or by setting the :variable:`CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY` to ``TRUE``. See the :manual:`cmake-packages(7)` manual for details on the system package registry. -9. Search paths specified by the ``PATHS`` option. These are typically +8. Search paths specified by the ``PATHS`` option. These are typically hard-coded guesses. .. |FIND_XXX| replace:: find_package diff --git a/Help/command/find_path.rst b/Help/command/find_path.rst index 988a3fa..76342d0 100644 --- a/Help/command/find_path.rst +++ b/Help/command/find_path.rst @@ -8,9 +8,6 @@ find_path .. |prefix_XXX_SUBDIR| replace:: ``<prefix>/include`` .. |entry_XXX_SUBDIR| replace:: ``<entry>/include`` -.. |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX| replace:: - ``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` - is set, and |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX_SUBDIR| .. |CMAKE_PREFIX_PATH_XXX| replace:: ``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set, and |CMAKE_PREFIX_PATH_XXX_SUBDIR| diff --git a/Help/command/find_program.rst b/Help/command/find_program.rst index 4f00773..d3430c0 100644 --- a/Help/command/find_program.rst +++ b/Help/command/find_program.rst @@ -8,8 +8,6 @@ find_program .. |prefix_XXX_SUBDIR| replace:: ``<prefix>/[s]bin`` .. |entry_XXX_SUBDIR| replace:: ``<entry>/[s]bin`` -.. |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX| replace:: - |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX_SUBDIR| .. |CMAKE_PREFIX_PATH_XXX| replace:: |CMAKE_PREFIX_PATH_XXX_SUBDIR| .. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_PROGRAM_PATH` diff --git a/Help/dev/review.rst b/Help/dev/review.rst index 9450bf0..985b1b7 100644 --- a/Help/dev/review.rst +++ b/Help/dev/review.rst @@ -185,6 +185,54 @@ commands to ``@kwrobot`` using the form ``Do: ...``: See the corresponding sections for details on permissions and options for each command. +Commit Messages +--------------- + +Part of the human review is to check that each commit message is appropriate. +The first line of the message should begin with one or two words indicating the +area the commit applies to, followed by a colon and then a brief summary. +Committers should aim to keep this first line short. Any subsequent lines +should be separated from the first by a blank line and provide relevant, useful +information. + +The appropriateness of the initial word describing the area the commit applies +to is not something the automatic robot review can judge, so it is up to the +human reviewer to confirm that the area is specified and that it is +appropriate. Good area words include the module name the commit is primarily +fixing, the main C++ source file being edited, ``Help`` for generic +documentation changes or a feature or functionality theme the changes apply to +(e.g. ``server`` or ``Autogen``). Examples of suitable first lines of a commit +message include: + +* ``Help: Fix example in cmake-buildsystem(7) manual`` +* ``FindBoost: Add support for 1.64`` +* ``Autogen: Extended mocInclude tests`` +* ``cmLocalGenerator: Explain standard flag selection logic in comments`` + +If the commit fixes a particular reported issue, this information should +ideally also be part of the commit message. The recommended way to do this is +to place a line at the end of the message in the form ``Fixes: #xxxxx`` where +``xxxxx`` is the GitLab issue number and to separate it from the rest of the +text by a blank line. For example:: + + Help: Fix FooBar example robustness issue + + FooBar supports option X, but the example provided + would not work if Y was also specified. + + Fixes: #12345 + +GitLab will automatically create relevant links to the merge request and will +close the issue when the commit is merged into master. GitLab understands a few +other synonyms for ``Fixes`` and allows much more flexible forms than the +above, but committers should aim for this format for consistency. Note that +such details can alternatively be specified in the merge request description. + +Reviewers are encouraged to ask the committer to amend commit messages to +follow these guidelines, but prefer to focus on the changes themselves as a +first priority. Maintainers will also make a check of commit messages before +merging. + Topic Testing ============= diff --git a/Help/policy/CMP0069.rst b/Help/policy/CMP0069.rst index b8f5d80..0d5ddfd 100644 --- a/Help/policy/CMP0069.rst +++ b/Help/policy/CMP0069.rst @@ -55,8 +55,8 @@ Produce a fatal error if support is not available: cmake_minimum_required(VERSION 3.9) # CMP0069 NEW project(foo) - include(CheckIPOSupport) - check_ipo_support() + include(CheckIPOSupported) + check_ipo_supported() # ... @@ -69,11 +69,11 @@ Apply IPO flags only if compiler supports it: cmake_minimum_required(VERSION 3.9) # CMP0069 NEW project(foo) - include(CheckIPOSupport) + include(CheckIPOSupported) # ... - check_ipo_support(RESULT result) + check_ipo_supported(RESULT result) if(result) set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) endif() diff --git a/Help/prop_test/FIXTURES_CLEANUP.rst b/Help/prop_test/FIXTURES_CLEANUP.rst index f0a4be0..3075b4d 100644 --- a/Help/prop_test/FIXTURES_CLEANUP.rst +++ b/Help/prop_test/FIXTURES_CLEANUP.rst @@ -2,7 +2,8 @@ FIXTURES_CLEANUP ---------------- Specifies a list of fixtures for which the test is to be treated as a cleanup -test. +test. These fixture names are distinct from test case names and are not +required to have any similarity to the names of tests associated with them. Fixture cleanup tests are ordinary tests with all of the usual test functionality. Setting the ``FIXTURES_CLEANUP`` property for a test has two diff --git a/Help/prop_test/FIXTURES_REQUIRED.rst b/Help/prop_test/FIXTURES_REQUIRED.rst index e37dfb5..e3f60c4 100644 --- a/Help/prop_test/FIXTURES_REQUIRED.rst +++ b/Help/prop_test/FIXTURES_REQUIRED.rst @@ -2,7 +2,7 @@ FIXTURES_REQUIRED ----------------- Specifies a list of fixtures the test requires. Fixture names are case -sensitive. +sensitive and they are not required to have any similarity to test names. Fixtures are a way to attach setup and cleanup tasks to a set of tests. If a test requires a given fixture, then all tests marked as setup tasks for that @@ -19,7 +19,9 @@ some setup tests fail. When CTest is asked to execute only a subset of tests (e.g. by the use of regular expressions or when run with the ``--rerun-failed`` command line option), it will automatically add any setup or cleanup tests for fixtures -required by any of the tests that are in the execution set. +required by any of the tests that are in the execution set. This behavior can +be overridden with the ``-FS``, ``-FC`` and ``-FA`` command line options to +:manual:`ctest(1)` if desired. Since setup and cleanup tasks are also tests, they can have an ordering specified by the :prop_test:`DEPENDS` test property just like any other tests. diff --git a/Help/prop_test/FIXTURES_SETUP.rst b/Help/prop_test/FIXTURES_SETUP.rst index a220215..fdb21cc 100644 --- a/Help/prop_test/FIXTURES_SETUP.rst +++ b/Help/prop_test/FIXTURES_SETUP.rst @@ -2,14 +2,15 @@ FIXTURES_SETUP -------------- Specifies a list of fixtures for which the test is to be treated as a setup -test. +test. These fixture names are distinct from test case names and are not +required to have any similarity to the names of tests associated with them. Fixture setup tests are ordinary tests with all of the usual test functionality. Setting the ``FIXTURES_SETUP`` property for a test has two primary effects: - CTest will ensure the test executes before any other test which lists the - fixture(s) in its :prop_test:`FIXTURES_REQUIRED` property. + fixture name(s) in its :prop_test:`FIXTURES_REQUIRED` property. - If CTest is asked to run only a subset of tests (e.g. using regular expressions or the ``--rerun-failed`` option) and the setup test is not in diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst index 14e8699..ae55105 100644 --- a/Help/release/3.9.rst +++ b/Help/release/3.9.rst @@ -42,12 +42,6 @@ Commands * The :command:`add_library` command ``IMPORTED`` option learned to support :ref:`Object Libraries`. -* All ``find_`` commands now have a ``PACKAGE_ROOT`` search path group that - is first in the search heuristics. If a ``find_`` command is called from - inside a find module, then the CMake variable and environment variable named - ``<PackageName>_ROOT`` are used as prefixes and are the first set of paths - to be searched. - * The :command:`find_library` command learned to search ``libx32`` paths when the build targets the ``x32`` ABI. See the :prop_gbl:`FIND_LIBRARY_USE_LIBX32_PATHS` global property. @@ -326,3 +320,16 @@ Other Changes a change to the ``v140`` toolset made by a VS 2015 update. VS changed the set of values it understands for the ``GenerateDebugInformation`` linker setting that produces the ``-DEBUG`` linker flag variants. + +Updates +======= + +Changes made since CMake 3.9.0 include the following. + +3.9.1 +----- + +* The ``find_`` command ``PACKAGE_ROOT`` search path group added by + CMake 3.9.0 has been removed for the 3.9 series due to regressions + caused by new use of ``<PackageName>_ROOT`` variables. The behavior + may be re-introduced in the future in a more-compatible way. diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake index 3a10b99..2374fbd 100644 --- a/Modules/CPackComponent.cmake +++ b/Modules/CPackComponent.cmake @@ -37,6 +37,16 @@ # components defined by the project. The user may set it to only include the # specified components. # +# Instead of specifying all the desired components, it is possible to obtain a +# list of all defined components and then remove the unwanted ones from the +# list. The :command:`get_cmake_property` command can be used to obtain the +# ``COMPONENTS`` property, then the :command:`list(REMOVE_ITEM)` command can be +# used to remove the unwanted ones. For example, to use all defined components +# except ``foo`` and ``bar``:: +# +# get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS) +# list(REMOVE_ITEM CPACK_COMPONENTS_ALL "foo" "bar") +# # .. variable:: CPACK_<GENNAME>_COMPONENT_INSTALL # # Enable/Disable component install for CPack generator <GENNAME>. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 5dc55d4..bd7d0c0 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -2,6 +2,20 @@ # FindCUDA # -------- # +# .. note:: +# +# The FindCUDA module has been superseded by first-class support +# for the CUDA language in CMake. It is no longer necessary to +# use this module or call ``find_package(CUDA)``. This module +# now exists only for compatibility with projects that have not +# been ported. +# +# Instead, list ``CUDA`` among the languages named in the top-level +# call to the :command:`project` command, or call the +# :command:`enable_language` command with ``CUDA``. +# Then one can add CUDA (``.cu``) sources to programs directly +# in calls to :command:`add_library` and :command:`add_executable`. +# # Tools for building CUDA C files: libraries and build dependencies. # # This script locates the NVIDIA CUDA C tools. It should work on linux, @@ -589,7 +603,6 @@ macro(cuda_unset_include_and_libraries) unset(CUDA_npps_LIBRARY CACHE) unset(CUDA_nvcuvenc_LIBRARY CACHE) unset(CUDA_nvcuvid_LIBRARY CACHE) - unset(CUDA_USE_STATIC_CUDA_RUNTIME CACHE) unset(CUDA_GPU_DETECT_OUTPUT CACHE) endmacro() @@ -802,12 +815,17 @@ endif() if(CUDA_cudart_static_LIBRARY) # If static cudart available, use it by default, but provide a user-visible option to disable it. option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) - set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) else() # If not available, silently disable the option. set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) +else() set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) endif() + if(NOT CUDA_VERSION VERSION_LESS "5.0") cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") mark_as_advanced(CUDA_cudadevrt_LIBRARY) diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake index 8fb44d8..b604a17 100644 --- a/Modules/FindCUDA/select_compute_arch.cmake +++ b/Modules/FindCUDA/select_compute_arch.cmake @@ -30,12 +30,17 @@ endif () if (CUDA_VERSION VERSION_GREATER "7.5") list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Pascal") - list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.0" "6.1" "6.1+PTX") + list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.0" "6.1") else() list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "5.2+PTX") endif () - +if (CUDA_VERSION VERSION_GREATER "8.5") + list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Volta") + list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.0" "7.0+PTX") +else() + list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.1+PTX") +endif() ################################################################################################ # A function for automatic detection of GPUs installed (if autodetection is enabled) @@ -141,6 +146,9 @@ function(CUDA_SELECT_NVCC_ARCH_FLAGS out_variable) elseif(${arch_name} STREQUAL "Pascal") set(arch_bin 6.0 6.1) set(arch_ptx 6.1) + elseif(${arch_name} STREQUAL "Volta") + set(arch_bin 7.0 7.0) + set(arch_ptx 7.0) else() message(SEND_ERROR "Unknown CUDA Architecture Name ${arch_name} in CUDA_SELECT_NVCC_ARCH_FLAGS") endif() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 666eb87..1f4e1d4 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 9) -set(CMake_VERSION_PATCH 20170809) +set(CMake_VERSION_PATCH 20170815) #set(CMake_VERSION_RC 1) diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 524fdf8..302000a 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -19,7 +19,6 @@ #cmakedefine HAVE_UNSETENV #cmakedefine CMAKE_USE_ELF_PARSER #cmakedefine CMAKE_USE_MACH_PARSER -#cmakedefine CMAKE_USE_LIBUV #cmakedefine CMake_HAVE_CXX_AUTO_PTR #cmakedefine CMake_HAVE_CXX_EQ_DELETE #cmakedefine CMake_HAVE_CXX_FALLTHROUGH diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index e378208..10c6fe4 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -68,6 +68,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn) } this->AlreadyInCache = false; + this->SelectDefaultNoPackageRootPath(); + // Find the current root path mode. this->SelectDefaultRootPathMode(); diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index fd0e317..4ef0f3e 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -88,6 +88,13 @@ void cmFindCommon::InitializeSearchPathGroups() std::make_pair(PathLabel::Guess, cmSearchPath(this))); } +void cmFindCommon::SelectDefaultNoPackageRootPath() +{ + if (!this->Makefile->IsOn("__UNDOCUMENTED_CMAKE_FIND_PACKAGE_ROOT")) { + this->NoPackageRootPath = true; + } +} + void cmFindCommon::SelectDefaultRootPathMode() { // Check the policy variable for this find command type. diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h index 7954267..72dcd35 100644 --- a/Source/cmFindCommon.h +++ b/Source/cmFindCommon.h @@ -84,6 +84,9 @@ protected: /** Compute final search path list (reroot + trailing slash). */ void ComputeFinalPaths(); + /** Decide whether to enable the PACKAGE_ROOT search entries. */ + void SelectDefaultNoPackageRootPath(); + /** Compute the current default root path mode. */ void SelectDefaultRootPathMode(); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index ca47535..7797700 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -209,6 +209,8 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args, this->SortDirection = strcmp(sd, "ASC") == 0 ? Asc : Dec; } + this->SelectDefaultNoPackageRootPath(); + // Find the current root path mode. this->SelectDefaultRootPathMode(); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 329c7a9..95f4543 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -326,6 +326,13 @@ std::string cmGeneratorTarget::GetOutputName( return i->second; } +void cmGeneratorTarget::ClearSourcesCache() +{ + this->KindedSourcesMap.clear(); + this->LinkImplementationLanguageIsContextDependent = true; + this->Objects.clear(); +} + void cmGeneratorTarget::AddSourceCommon(const std::string& src) { cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); @@ -333,8 +340,7 @@ void cmGeneratorTarget::AddSourceCommon(const std::string& src) CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(src); cge->SetEvaluateForBuildsystem(true); this->SourceEntries.push_back(new TargetPropertyEntry(cge)); - this->KindedSourcesMap.clear(); - this->LinkImplementationLanguageIsContextDependent = true; + this->ClearSourcesCache(); } void cmGeneratorTarget::AddSource(const std::string& src) diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 52147e3..b5f7f6e 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -491,6 +491,11 @@ public: std::string GetOutputName(const std::string& config, cmStateEnums::ArtifactType artifact) const; + /** Clears cached meta data for local and external source files. + * The meta data will be recomputed on demand. + */ + void ClearSourcesCache(); + void AddSource(const std::string& src); void AddTracedSources(std::vector<std::string> const& srcs); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index c8b13ad..18d10c5 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1433,31 +1433,36 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() std::vector<const cmGeneratorTarget*> autogenTargets; #ifdef CMAKE_BUILD_WITH_CMAKE - for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { - std::vector<cmGeneratorTarget*> targets = - this->LocalGenerators[i]->GetGeneratorTargets(); + for (std::vector<cmLocalGenerator*>::const_iterator lgit = + this->LocalGenerators.begin(); + lgit != this->LocalGenerators.end(); ++lgit) { + cmLocalGenerator* localGen = *lgit; + const std::vector<cmGeneratorTarget*>& targets = + localGen->GetGeneratorTargets(); + // Find targets that require AUTOGEN processing std::vector<cmGeneratorTarget*> filteredTargets; filteredTargets.reserve(targets.size()); - for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin(); + for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin(); ti != targets.end(); ++ti) { - if ((*ti)->GetType() == cmStateEnums::GLOBAL_TARGET) { + cmGeneratorTarget* target = *ti; + if (target->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; } - if ((*ti)->GetType() != cmStateEnums::EXECUTABLE && - (*ti)->GetType() != cmStateEnums::STATIC_LIBRARY && - (*ti)->GetType() != cmStateEnums::SHARED_LIBRARY && - (*ti)->GetType() != cmStateEnums::MODULE_LIBRARY && - (*ti)->GetType() != cmStateEnums::OBJECT_LIBRARY) { + if (target->GetType() != cmStateEnums::EXECUTABLE && + target->GetType() != cmStateEnums::STATIC_LIBRARY && + target->GetType() != cmStateEnums::SHARED_LIBRARY && + target->GetType() != cmStateEnums::MODULE_LIBRARY && + target->GetType() != cmStateEnums::OBJECT_LIBRARY) { continue; } - if ((!(*ti)->GetPropertyAsBool("AUTOMOC") && - !(*ti)->GetPropertyAsBool("AUTOUIC") && - !(*ti)->GetPropertyAsBool("AUTORCC")) || - (*ti)->IsImported()) { + if ((!target->GetPropertyAsBool("AUTOMOC") && + !target->GetPropertyAsBool("AUTOUIC") && + !target->GetPropertyAsBool("AUTORCC")) || + target->IsImported()) { continue; } - // don't do anything if there is no Qt4 or Qt5Core (which contains moc): - cmMakefile* mf = (*ti)->Target->GetMakefile(); + // don't do anything if there is no Qt4 or Qt5Core (which contains moc) + cmMakefile* mf = target->Target->GetMakefile(); std::string qtMajorVersion = mf->GetSafeDefinition("QT_VERSION_MAJOR"); if (qtMajorVersion == "") { qtMajorVersion = mf->GetSafeDefinition("Qt5Core_VERSION_MAJOR"); @@ -1465,17 +1470,13 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() if (qtMajorVersion != "4" && qtMajorVersion != "5") { continue; } - - cmGeneratorTarget* gt = *ti; - - cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt); - filteredTargets.push_back(gt); + filteredTargets.push_back(target); } + // Initialize AUTOGEN targets for (std::vector<cmGeneratorTarget*>::iterator ti = filteredTargets.begin(); ti != filteredTargets.end(); ++ti) { - cmQtAutoGeneratorInitializer::InitializeAutogenTarget( - this->LocalGenerators[i], *ti); + cmQtAutoGeneratorInitializer::InitializeAutogenTarget(localGen, *ti); autogenTargets.push_back(*ti); } } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index f077459..cb6cf2d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4381,6 +4381,18 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, cmStrCmp(existingCxxStandard)) : cmArrayEnd(CXX_STANDARDS); + if (needCxx17 && + existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS), + cmArrayEnd(CXX_STANDARDS), + cmStrCmp("17"))) { + return false; + } + if (needCxx14 && + existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS), + cmArrayEnd(CXX_STANDARDS), + cmStrCmp("14"))) { + return false; + } if (needCxx11 && existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 5a06730..7974977 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -263,13 +263,17 @@ static bool AddToSourceGroup(cmMakefile* makefile, const std::string& fileName, return true; } -static void AddGeneratedSource(cmMakefile* makefile, +static void AddGeneratedSource(cmGeneratorTarget* target, const std::string& filename, cmQtAutoGeneratorCommon::GeneratorType genType) { - cmSourceFile* gFile = makefile->GetOrCreateSource(filename, true); - gFile->SetProperty("GENERATED", "1"); - gFile->SetProperty("SKIP_AUTOGEN", "On"); + cmMakefile* makefile = target->Target->GetMakefile(); + { + cmSourceFile* gFile = makefile->GetOrCreateSource(filename, true); + gFile->SetProperty("GENERATED", "1"); + gFile->SetProperty("SKIP_AUTOGEN", "On"); + } + target->AddSource(filename); AddToSourceGroup(makefile, filename, genType); } @@ -692,19 +696,6 @@ static void RccSetupAutoTarget(cmGeneratorTarget const* target, AddDefinitionEscaped(makefile, "_rcc_options_options", rccFileOptions); } -void cmQtAutoGeneratorInitializer::InitializeAutogenSources( - cmGeneratorTarget* target) -{ - if (target->GetPropertyAsBool("AUTOMOC")) { - cmMakefile* makefile = target->Target->GetMakefile(); - // Mocs compilation file - const std::string mocsComp = - GetAutogenTargetBuildDir(target) + "/mocs_compilation.cpp"; - AddGeneratedSource(makefile, mocsComp, cmQtAutoGeneratorCommon::MOC); - target->AddSource(mocsComp); - } -} - void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( cmLocalGenerator* lg, cmGeneratorTarget* target) { @@ -781,6 +772,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( // Add moc compilation to generated files list if (mocEnabled) { const std::string mocsComp = autogenBuildDir + "/mocs_compilation.cpp"; + AddGeneratedSource(target, mocsComp, cmQtAutoGeneratorCommon::MOC); autogenProvides.push_back(mocsComp); } @@ -880,10 +872,8 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( rccBuildFile += ".cpp"; // Register rcc ouput file as generated - AddGeneratedSource(makefile, rccBuildFile, + AddGeneratedSource(target, rccBuildFile, cmQtAutoGeneratorCommon::RCC); - // Add rcc output file to origin target sources - target->AddSource(rccBuildFile); // Register rcc ouput file as generated by the _autogen target autogenProvides.push_back(rccBuildFile); } @@ -919,6 +909,12 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( } } + // cmGeneratorTarget::GetConfigCommonSourceFiles computes the target's + // sources meta data cache. Clear it so that OBJECT library targets that + // are AUTOGEN initialized after this target get their added + // mocs_compilation.cpp source acknowledged by this target. + target->ClearSourcesCache(); + // Convert std::set to std::vector const std::vector<std::string> autogenDepends(autogenDependsSet.begin(), autogenDependsSet.end()); diff --git a/Source/cmQtAutoGeneratorInitializer.h b/Source/cmQtAutoGeneratorInitializer.h index ca806f5..11f6e1e 100644 --- a/Source/cmQtAutoGeneratorInitializer.h +++ b/Source/cmQtAutoGeneratorInitializer.h @@ -11,7 +11,6 @@ class cmLocalGenerator; class cmQtAutoGeneratorInitializer { public: - static void InitializeAutogenSources(cmGeneratorTarget* target); static void InitializeAutogenTarget(cmLocalGenerator* lg, cmGeneratorTarget* target); static void SetupAutoGenerateTarget(cmGeneratorTarget const* target); diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index bdf682a..6ea1c72 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -729,6 +729,17 @@ bool cmQtAutoGenerators::RunAutogen() // moc file is included anywhere a moc_<filename>.cpp file is created and // included in the mocs_compilation.cpp file. + // Create AUTOGEN include directory + { + const std::string incDirAbs = cmSystemTools::CollapseCombinedPath( + this->AutogenBuildDir, this->AutogenIncludeDir); + if (!cmsys::SystemTools::MakeDirectory(incDirAbs)) { + this->LogError("AutoGen: Error: Could not create include directory " + + Quoted(incDirAbs)); + return false; + } + } + // key = moc source filepath, value = moc output filepath std::map<std::string, std::string> mocsIncluded; std::map<std::string, std::string> mocsNotIncluded; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index c5a6836..dd88083 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -15,6 +15,11 @@ #ifdef CMAKE_BUILD_WITH_CMAKE #include "cmDocumentation.h" #include "cmDynamicLoader.h" +#ifdef _WIN32 +#include <fcntl.h> /* _O_TEXT */ +#include <stdlib.h> /* _set_fmode, _fmode */ +#endif +#include "cm_uv.h" #endif #include "cmsys/Encoding.hxx" @@ -26,14 +31,6 @@ #include <string> #include <vector> -#ifdef CMAKE_USE_LIBUV -#ifdef _WIN32 -#include <fcntl.h> /* _O_TEXT */ -#include <stdlib.h> /* _set_fmode, _fmode */ -#endif -#include "cm_uv.h" -#endif - #ifdef CMAKE_BUILD_WITH_CMAKE static const char* cmDocumentationName[][2] = { { CM_NULLPTR, " cmake - Cross-Platform Makefile Generator." }, @@ -172,7 +169,7 @@ int main(int ac, char const* const* av) ac = args.argc(); av = args.argv(); -#if defined(CMAKE_USE_LIBUV) && defined(_WIN32) +#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(_WIN32) // Perform libuv one-time initialization now, and then un-do its // global _fmode setting so that using libuv does not change the // default file text/binary mode. See libuv issue 840. @@ -197,8 +194,6 @@ int main(int ac, char const* const* av) int ret = do_cmake(ac, av); #ifdef CMAKE_BUILD_WITH_CMAKE cmDynamicLoader::FlushCache(); -#endif -#ifdef CMAKE_USE_LIBUV uv_loop_close(uv_default_loop()); #endif return ret; diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 4a5558d..b560acd 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -428,6 +428,14 @@ else() HAVE_FINAL=$<COMPILE_FEATURES:cxx_final> HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$<COMPILE_FEATURES:cxx_inheriting_constructors,cxx_final> ) + if (CMAKE_CXX_STANDARD_DEFAULT) + target_compile_definitions(CompileFeaturesGenex PRIVATE + TEST_CXX_STD + HAVE_CXX_STD_11=$<COMPILE_FEATURES:cxx_std_11> + HAVE_CXX_STD_14=$<COMPILE_FEATURES:cxx_std_14> + HAVE_CXX_STD_17=$<COMPILE_FEATURES:cxx_std_17> + ) + endif() add_executable(CompileFeaturesGenex2 genex_test.cpp) target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_std_11) diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 5ae8a78..5303e73 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -11,6 +11,18 @@ #error EXPECT_OVERRIDE_CONTROL not defined #endif +#ifdef TEST_CXX_STD +#if !HAVE_CXX_STD_11 +#error HAVE_CXX_STD_11 is false with CXX_STANDARD == 11 +#endif +#if HAVE_CXX_STD_14 +#error HAVE_CXX_STD_14 is true with CXX_STANDARD == 11 +#endif +#if HAVE_CXX_STD_17 +#error HAVE_CXX_STD_17 is true with CXX_STANDARD == 11 +#endif +#endif + #if !HAVE_OVERRIDE_CONTROL #if EXPECT_OVERRIDE_CONTROL #error "Expect override control feature" diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 5064d26..198bf63 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -193,5 +193,9 @@ endif() add_subdirectory(uicInclude) # -- Test +# OBJECT libraries +add_subdirectory(objectLibrary) + +# -- Test # Complex test case add_subdirectory(complex) diff --git a/Tests/QtAutogen/objectLibrary/CMakeLists.txt b/Tests/QtAutogen/objectLibrary/CMakeLists.txt new file mode 100644 index 0000000..9b29a40 --- /dev/null +++ b/Tests/QtAutogen/objectLibrary/CMakeLists.txt @@ -0,0 +1,14 @@ +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) + +# Object library a defined in a subdirectory +add_subdirectory(a) + +# Object library b defined locally +include_directories(b) +add_library(b OBJECT b/classb.cpp) +target_compile_features(b PRIVATE ${QT_COMPILE_FEATURES}) + +# Executable with OBJECT library generator expressions +add_executable(someProgram main.cpp $<TARGET_OBJECTS:a> $<TARGET_OBJECTS:b>) +target_link_libraries(someProgram ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/objectLibrary/a/CMakeLists.txt b/Tests/QtAutogen/objectLibrary/a/CMakeLists.txt new file mode 100644 index 0000000..fe76ac3 --- /dev/null +++ b/Tests/QtAutogen/objectLibrary/a/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(a OBJECT classa.cpp) +target_compile_features(a PRIVATE ${QT_COMPILE_FEATURES}) diff --git a/Tests/QtAutogen/objectLibrary/a/classa.cpp b/Tests/QtAutogen/objectLibrary/a/classa.cpp new file mode 100644 index 0000000..4f08fda --- /dev/null +++ b/Tests/QtAutogen/objectLibrary/a/classa.cpp @@ -0,0 +1,7 @@ +#include "classa.h" +#include <QDebug> + +void ClassA::slotDoSomething() +{ + qDebug() << m_member; +} diff --git a/Tests/QtAutogen/objectLibrary/a/classa.h b/Tests/QtAutogen/objectLibrary/a/classa.h new file mode 100644 index 0000000..fa5fed9 --- /dev/null +++ b/Tests/QtAutogen/objectLibrary/a/classa.h @@ -0,0 +1,23 @@ +#ifndef CLASSA_H +#define CLASSA_H + +#include <QObject> +#include <QString> + +class ClassA : public QObject +{ + Q_OBJECT +public: + ClassA() + : m_member("Hello A") + { + } + +public slots: + void slotDoSomething(); + +private: + QString m_member; +}; + +#endif diff --git a/Tests/QtAutogen/objectLibrary/b/classb.cpp b/Tests/QtAutogen/objectLibrary/b/classb.cpp new file mode 100644 index 0000000..26e0926 --- /dev/null +++ b/Tests/QtAutogen/objectLibrary/b/classb.cpp @@ -0,0 +1,7 @@ +#include "classb.h" +#include <QDebug> + +void ClassB::slotDoSomething() +{ + qDebug() << m_member; +} diff --git a/Tests/QtAutogen/objectLibrary/b/classb.h b/Tests/QtAutogen/objectLibrary/b/classb.h new file mode 100644 index 0000000..783bb48 --- /dev/null +++ b/Tests/QtAutogen/objectLibrary/b/classb.h @@ -0,0 +1,23 @@ +#ifndef CLASSB_H +#define CLASSB_H + +#include <QObject> +#include <QString> + +class ClassB : public QObject +{ + Q_OBJECT +public: + ClassB() + : m_member("Hello B") + { + } + +public slots: + void slotDoSomething(); + +private: + QString m_member; +}; + +#endif diff --git a/Tests/QtAutogen/objectLibrary/main.cpp b/Tests/QtAutogen/objectLibrary/main.cpp new file mode 100644 index 0000000..cacf0fd --- /dev/null +++ b/Tests/QtAutogen/objectLibrary/main.cpp @@ -0,0 +1,13 @@ +#include "a/classa.h" +#include "b/classb.h" + +int main(int argc, char** argv) +{ + ClassA a; + a.slotDoSomething(); + + ClassB b; + b.slotDoSomething(); + + return 0; +} diff --git a/Tests/RunCMake/find_package/PackageRoot-stderr.txt b/Tests/RunCMake/find_package/PackageRoot-stderr.txt index d97c029..2ec324a 100644 --- a/Tests/RunCMake/find_package/PackageRoot-stderr.txt +++ b/Tests/RunCMake/find_package/PackageRoot-stderr.txt @@ -10,34 +10,34 @@ FOO_TEST_PATH_ZOT :FOO_TEST_PATH_ZOT-NOTFOUND FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : find_package\(Foo\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe ---------- Foo_ROOT : -ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +ENV{Foo_ROOT} :<base>/foo/env_root find_package\(Foo\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/env_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/env_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/env_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/env_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/env_root/bin/foo.exe +FOO_TEST_FILE_FOO :<base>/foo/env_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/env_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/env_root/include +FOO_TEST_PATH_ZOT :<base>/foo/env_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/env_root/bin/foo.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/env_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/env_root find_package\(Foo\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe diff --git a/Tests/RunCMake/find_package/PackageRoot.cmake b/Tests/RunCMake/find_package/PackageRoot.cmake index 39551c4..4c4f4c2 100644 --- a/Tests/RunCMake/find_package/PackageRoot.cmake +++ b/Tests/RunCMake/find_package/PackageRoot.cmake @@ -1,7 +1,13 @@ +set(__UNDOCUMENTED_CMAKE_FIND_PACKAGE_ROOT 1) cmake_policy(SET CMP0057 NEW) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) +function(PrintPath label path) + string(REPLACE "${PackageRoot_BASE}" "<base>" out "${path}") + message("${label}${out}") +endfunction() + macro(CleanUpPackageRootTest) unset(Foo_ROOT) unset(ENV{Foo_ROOT}) @@ -19,17 +25,17 @@ endmacro() macro(RunPackageRootTest) message("----------") - message("Foo_ROOT :${Foo_ROOT}") - message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}") + PrintPath("Foo_ROOT :" "${Foo_ROOT}") + PrintPath("ENV{Foo_ROOT} :" "$ENV{Foo_ROOT}") message("") find_package(Foo) message("find_package(Foo)") - message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}") - message("FOO_TEST_FILE_ZOT :${FOO_TEST_FILE_ZOT}") - message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}") - message("FOO_TEST_PATH_ZOT :${FOO_TEST_PATH_ZOT}") - message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") + PrintPath("FOO_TEST_FILE_FOO :" "${FOO_TEST_FILE_FOO}") + PrintPath("FOO_TEST_FILE_ZOT :" "${FOO_TEST_FILE_ZOT}") + PrintPath("FOO_TEST_PATH_FOO :" "${FOO_TEST_PATH_FOO}") + PrintPath("FOO_TEST_PATH_ZOT :" "${FOO_TEST_PATH_ZOT}") + PrintPath("FOO_TEST_PROG_FOO :" "${FOO_TEST_PROG_FOO}") CleanUpPackageRootTest() message("") endmacro() diff --git a/Tests/RunCMake/find_package/PackageRootNestedConfig-stderr.txt b/Tests/RunCMake/find_package/PackageRootNestedConfig-stderr.txt index 79266c3..b3ee104 100644 --- a/Tests/RunCMake/find_package/PackageRootNestedConfig-stderr.txt +++ b/Tests/RunCMake/find_package/PackageRootNestedConfig-stderr.txt @@ -22,277 +22,277 @@ BAR_TEST_PROG_FOO : BAR_TEST_PROG_BAR : ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : Bar_DIR : Bar_ROOT : ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/foo/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/foo/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/foo/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root +Bar_ROOT :<base>/bar/cmake_root ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : Bar_DIR : Bar_ROOT : -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/env_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/env_root/include +BAR_TEST_PATH_ZOT :<base>/bar/env_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/env_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +Bar_ROOT :<base>/bar/cmake_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : Bar_ROOT : ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/foo/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/foo/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/foo/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root +Bar_ROOT :<base>/bar/cmake_root ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : Bar_ROOT : -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/env_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/env_root/include +BAR_TEST_PATH_ZOT :<base>/bar/env_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/env_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +Bar_ROOT :<base>/bar/cmake_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : Bar_ROOT : ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/foo/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/foo/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/foo/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root +Bar_ROOT :<base>/bar/cmake_root ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : Bar_ROOT : -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/env_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/env_root/include +BAR_TEST_PATH_ZOT :<base>/bar/env_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/env_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +Bar_ROOT :<base>/bar/cmake_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarConfig\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/foo/cmake_root/cmake/BarConfig.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/foo/cmake_root/cmake/BarConfig.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake b/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake index 571739d..ba06c09 100644 --- a/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake +++ b/Tests/RunCMake/find_package/PackageRootNestedConfig.cmake @@ -1,7 +1,13 @@ +set(__UNDOCUMENTED_CMAKE_FIND_PACKAGE_ROOT 1) cmake_policy(SET CMP0057 NEW) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) +function(PrintPath label path) + string(REPLACE "${PackageRoot_BASE}" "<base>" out "${path}") + message("${label}${out}") +endfunction() + macro(CleanUpPackageRootTest) unset(Foo_ROOT) unset(ENV{Foo_ROOT}) @@ -41,29 +47,29 @@ endmacro() macro(RunPackageRootTest) message("----------") - message("Foo_ROOT :${Foo_ROOT}") - message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}") - message("Bar_DIR :${Bar_DIR}") - message("Bar_ROOT :${Bar_ROOT}") - message("ENV{Bar_ROOT} :$ENV{Bar_ROOT}") + PrintPath("Foo_ROOT :" "${Foo_ROOT}") + PrintPath("ENV{Foo_ROOT} :" "$ENV{Foo_ROOT}") + PrintPath("Bar_DIR :" "${Bar_DIR}") + PrintPath("Bar_ROOT :" "${Bar_ROOT}") + PrintPath("ENV{Bar_ROOT} :" "$ENV{Bar_ROOT}") message("") find_package(Foo COMPONENTS BarConfig) message("find_package(Foo COMPONENTS BarConfig)") - message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}") - message("FOO_TEST_FILE_ZOT :${FOO_TEST_FILE_ZOT}") - message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}") - message("FOO_TEST_PATH_ZOT :${FOO_TEST_PATH_ZOT}") - message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") - message("BAR_CMAKE_FILE :${BAR_CMAKE_FILE}") - message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}") - message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}") - message("BAR_TEST_FILE_ZOT :${BAR_TEST_FILE_ZOT}") - message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}") - message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}") - message("BAR_TEST_PATH_ZOT :${BAR_TEST_PATH_ZOT}") - message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}") - message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}") + PrintPath("FOO_TEST_FILE_FOO :" "${FOO_TEST_FILE_FOO}") + PrintPath("FOO_TEST_FILE_ZOT :" "${FOO_TEST_FILE_ZOT}") + PrintPath("FOO_TEST_PATH_FOO :" "${FOO_TEST_PATH_FOO}") + PrintPath("FOO_TEST_PATH_ZOT :" "${FOO_TEST_PATH_ZOT}") + PrintPath("FOO_TEST_PROG_FOO :" "${FOO_TEST_PROG_FOO}") + PrintPath("BAR_CMAKE_FILE :" "${BAR_CMAKE_FILE}") + PrintPath("BAR_TEST_FILE_FOO :" "${BAR_TEST_FILE_FOO}") + PrintPath("BAR_TEST_FILE_BAR :" "${BAR_TEST_FILE_BAR}") + PrintPath("BAR_TEST_FILE_ZOT :" "${BAR_TEST_FILE_ZOT}") + PrintPath("BAR_TEST_PATH_FOO :" "${BAR_TEST_PATH_FOO}") + PrintPath("BAR_TEST_PATH_BAR :" "${BAR_TEST_PATH_BAR}") + PrintPath("BAR_TEST_PATH_ZOT :" "${BAR_TEST_PATH_ZOT}") + PrintPath("BAR_TEST_PROG_FOO :" "${BAR_TEST_PROG_FOO}") + PrintPath("BAR_TEST_PROG_BAR :" "${BAR_TEST_PROG_BAR}") CleanUpPackageRootTest() message("") endmacro() diff --git a/Tests/RunCMake/find_package/PackageRootNestedModule-stderr.txt b/Tests/RunCMake/find_package/PackageRootNestedModule-stderr.txt index 57cab60..0ca2bdd 100644 --- a/Tests/RunCMake/find_package/PackageRootNestedModule-stderr.txt +++ b/Tests/RunCMake/find_package/PackageRootNestedModule-stderr.txt @@ -11,7 +11,7 @@ FOO_TEST_FILE_ZOT :FOO_TEST_FILE_ZOT-NOTFOUND FOO_TEST_PATH_FOO :FOO_TEST_PATH_FOO-NOTFOUND FOO_TEST_PATH_ZOT :FOO_TEST_PATH_ZOT-NOTFOUND FOO_TEST_PROG_FOO :FOO_TEST_PROG_FOO-NOTFOUND -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake +BAR_CMAKE_FILE :<base>/FindBar.cmake BAR_TEST_FILE_FOO :BAR_TEST_FILE_FOO-NOTFOUND BAR_TEST_FILE_BAR :BAR_TEST_FILE_BAR-NOTFOUND BAR_TEST_FILE_ZOT :BAR_TEST_FILE_ZOT-NOTFOUND @@ -22,277 +22,277 @@ BAR_TEST_PROG_FOO :BAR_TEST_PROG_FOO-NOTFOUND BAR_TEST_PROG_BAR :BAR_TEST_PROG_BAR-NOTFOUND ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : Bar_DIR : Bar_ROOT : ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/foo/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/foo/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/foo/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root +Bar_ROOT :<base>/bar/cmake_root ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : Bar_DIR : Bar_ROOT : -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/env_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/env_root/include +BAR_TEST_PATH_ZOT :<base>/bar/env_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/env_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root ENV{Foo_ROOT} : Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +Bar_ROOT :<base>/bar/cmake_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : Bar_ROOT : ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/foo/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/foo/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/foo/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root +Bar_ROOT :<base>/bar/cmake_root ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : Bar_ROOT : -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/env_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/env_root/include +BAR_TEST_PATH_ZOT :<base>/bar/env_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/env_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +Bar_ROOT :<base>/bar/cmake_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : Bar_ROOT : ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/foo/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/foo/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/foo/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/foo/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/foo/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root +Bar_ROOT :<base>/bar/cmake_root ENV{Bar_ROOT} : find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : Bar_ROOT : -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/env_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/env_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/env_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/env_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/env_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/env_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/env_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/env_root/include +BAR_TEST_PATH_ZOT :<base>/bar/env_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/env_root/bin/bar.exe ---------- -Foo_ROOT :.*/PackageRoot/foo/cmake_root -ENV{Foo_ROOT} :.*/PackageRoot/foo/cmake_root +Foo_ROOT :<base>/foo/cmake_root +ENV{Foo_ROOT} :<base>/foo/cmake_root Bar_DIR : -Bar_ROOT :.*/PackageRoot/bar/cmake_root -ENV{Bar_ROOT} :.*/PackageRoot/bar/env_root +Bar_ROOT :<base>/bar/cmake_root +ENV{Bar_ROOT} :<base>/bar/env_root find_package\(Foo COMPONENTS BarModule\) -FOO_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -FOO_TEST_FILE_ZOT :.*/PackageRoot/foo/cmake_root/include/zot/zot.h -FOO_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -FOO_TEST_PATH_ZOT :.*/PackageRoot/foo/cmake_root/include/zot -FOO_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_CMAKE_FILE :.*/PackageRoot/FindBar.cmake -BAR_TEST_FILE_FOO :.*/PackageRoot/foo/cmake_root/include/foo.h -BAR_TEST_FILE_BAR :.*/PackageRoot/bar/cmake_root/include/bar.h -BAR_TEST_FILE_ZOT :.*/PackageRoot/bar/cmake_root/include/zot/zot.h -BAR_TEST_PATH_FOO :.*/PackageRoot/foo/cmake_root/include -BAR_TEST_PATH_BAR :.*/PackageRoot/bar/cmake_root/include -BAR_TEST_PATH_ZOT :.*/PackageRoot/bar/cmake_root/include/zot -BAR_TEST_PROG_FOO :.*/PackageRoot/foo/cmake_root/bin/foo.exe -BAR_TEST_PROG_BAR :.*/PackageRoot/bar/cmake_root/bin/bar.exe +FOO_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +FOO_TEST_FILE_ZOT :<base>/foo/cmake_root/include/zot/zot.h +FOO_TEST_PATH_FOO :<base>/foo/cmake_root/include +FOO_TEST_PATH_ZOT :<base>/foo/cmake_root/include/zot +FOO_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_CMAKE_FILE :<base>/FindBar.cmake +BAR_TEST_FILE_FOO :<base>/foo/cmake_root/include/foo.h +BAR_TEST_FILE_BAR :<base>/bar/cmake_root/include/bar.h +BAR_TEST_FILE_ZOT :<base>/bar/cmake_root/include/zot/zot.h +BAR_TEST_PATH_FOO :<base>/foo/cmake_root/include +BAR_TEST_PATH_BAR :<base>/bar/cmake_root/include +BAR_TEST_PATH_ZOT :<base>/bar/cmake_root/include/zot +BAR_TEST_PROG_FOO :<base>/foo/cmake_root/bin/foo.exe +BAR_TEST_PROG_BAR :<base>/bar/cmake_root/bin/bar.exe diff --git a/Tests/RunCMake/find_package/PackageRootNestedModule.cmake b/Tests/RunCMake/find_package/PackageRootNestedModule.cmake index f99db59..2795cd4 100644 --- a/Tests/RunCMake/find_package/PackageRootNestedModule.cmake +++ b/Tests/RunCMake/find_package/PackageRootNestedModule.cmake @@ -1,7 +1,13 @@ +set(__UNDOCUMENTED_CMAKE_FIND_PACKAGE_ROOT 1) cmake_policy(SET CMP0057 NEW) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) set(PackageRoot_BASE ${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot) +function(PrintPath label path) + string(REPLACE "${PackageRoot_BASE}" "<base>" out "${path}") + message("${label}${out}") +endfunction() + macro(CleanUpPackageRootTest) unset(Foo_ROOT) unset(ENV{Foo_ROOT}) @@ -41,29 +47,29 @@ endmacro() macro(RunPackageRootTest) message("----------") - message("Foo_ROOT :${Foo_ROOT}") - message("ENV{Foo_ROOT} :$ENV{Foo_ROOT}") - message("Bar_DIR :${Bar_DIR}") - message("Bar_ROOT :${Bar_ROOT}") - message("ENV{Bar_ROOT} :$ENV{Bar_ROOT}") + PrintPath("Foo_ROOT :" "${Foo_ROOT}") + PrintPath("ENV{Foo_ROOT} :" "$ENV{Foo_ROOT}") + PrintPath("Bar_DIR :" "${Bar_DIR}") + PrintPath("Bar_ROOT :" "${Bar_ROOT}") + PrintPath("ENV{Bar_ROOT} :" "$ENV{Bar_ROOT}") message("") find_package(Foo COMPONENTS BarModule) message("find_package(Foo COMPONENTS BarModule)") - message("FOO_TEST_FILE_FOO :${FOO_TEST_FILE_FOO}") - message("FOO_TEST_FILE_ZOT :${FOO_TEST_FILE_ZOT}") - message("FOO_TEST_PATH_FOO :${FOO_TEST_PATH_FOO}") - message("FOO_TEST_PATH_ZOT :${FOO_TEST_PATH_ZOT}") - message("FOO_TEST_PROG_FOO :${FOO_TEST_PROG_FOO}") - message("BAR_CMAKE_FILE :${BAR_CMAKE_FILE}") - message("BAR_TEST_FILE_FOO :${BAR_TEST_FILE_FOO}") - message("BAR_TEST_FILE_BAR :${BAR_TEST_FILE_BAR}") - message("BAR_TEST_FILE_ZOT :${BAR_TEST_FILE_ZOT}") - message("BAR_TEST_PATH_FOO :${BAR_TEST_PATH_FOO}") - message("BAR_TEST_PATH_BAR :${BAR_TEST_PATH_BAR}") - message("BAR_TEST_PATH_ZOT :${BAR_TEST_PATH_ZOT}") - message("BAR_TEST_PROG_FOO :${BAR_TEST_PROG_FOO}") - message("BAR_TEST_PROG_BAR :${BAR_TEST_PROG_BAR}") + PrintPath("FOO_TEST_FILE_FOO :" "${FOO_TEST_FILE_FOO}") + PrintPath("FOO_TEST_FILE_ZOT :" "${FOO_TEST_FILE_ZOT}") + PrintPath("FOO_TEST_PATH_FOO :" "${FOO_TEST_PATH_FOO}") + PrintPath("FOO_TEST_PATH_ZOT :" "${FOO_TEST_PATH_ZOT}") + PrintPath("FOO_TEST_PROG_FOO :" "${FOO_TEST_PROG_FOO}") + PrintPath("BAR_CMAKE_FILE :" "${BAR_CMAKE_FILE}") + PrintPath("BAR_TEST_FILE_FOO :" "${BAR_TEST_FILE_FOO}") + PrintPath("BAR_TEST_FILE_BAR :" "${BAR_TEST_FILE_BAR}") + PrintPath("BAR_TEST_FILE_ZOT :" "${BAR_TEST_FILE_ZOT}") + PrintPath("BAR_TEST_PATH_FOO :" "${BAR_TEST_PATH_FOO}") + PrintPath("BAR_TEST_PATH_BAR :" "${BAR_TEST_PATH_BAR}") + PrintPath("BAR_TEST_PATH_ZOT :" "${BAR_TEST_PATH_ZOT}") + PrintPath("BAR_TEST_PROG_FOO :" "${BAR_TEST_PROG_FOO}") + PrintPath("BAR_TEST_PROG_BAR :" "${BAR_TEST_PROG_BAR}") CleanUpPackageRootTest() message("") endmacro() |