[CMake] Using modules, adjusting CMAKE_MODULE_PATH

Rolf Eike Beer eike at sf-mail.de
Tue Nov 2 09:00:30 EDT 2010


> Hi all,
>
> your solution is working fine but I got this message:
>
> CMake Error: The source
> "F:/Checkouts/prototyping/cmake_sandbox/CMakeLists.txt" does not match the
> source "F:/Checkouts/prototyping/cmake_sandbox/rtd/CMakeLists.txt" used to
> generate cache.  Re-run cmake with a different source directory.
>
> f:\Checkouts\prototyping\cmake_sandbox\obj>cmake ../rtd
> CMake Warning (dev) at app2/CMakeLists.txt:6 (find_package):
>   Policy CMP0011 is not set: Included scripts do automatic cmake_policy
> PUSH
>   and POP.  Run "cmake --help-policy CMP0011" for policy details.  Use the
>   cmake_policy command to set the policy and suppress this warning.
>
>   The included script
>
>     F:/Checkouts/prototyping/cmake_sandbox/cmake/modules/FindAllOptions.cmake
>
>   affects policy settings.  CMake is implying the NO_POLICY_SCOPE option
> for
>   compatibility, so the effects are applied to the including context.
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> -- Configuring done
> -- Generating done
> -- Build files have been written to:
> F:/Checkouts/prototyping/cmake_sandbox/obj

You try to reuse a CMake build try. That will never work. Once you have
configured a build tree the source directory (the location, not the
contents) must not change. Use multiple build trees.

Eike


More information about the CMake mailing list