#79 CMake reports an error when using External Modules

General (20)

I use External Modules in YARP configured using <YARP_ROOT>/conf/ExternalModules.cmake.

I have multiple external modules, and when I generate a solution for Visual Studio, CMake returns this error:

CMake Warning (dev) at src/modules/CMakeLists.txt:62 (add_subdirectory):
Policy CMP0013 is not set: Duplicate binary directories are not allowed.
Run "cmake --help-policy CMP0013" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

The binary directory


is already used to build a source directory. This command uses it to build
source directory


which can generate conflicting build files. CMake does not support this
use case but it used to work accidentally and is being allowed for
This warning is for project developers. Use -Wno-dev to suppress it.

I looked into <YARP_ROOT>/src/modules/CMakeLists.txt : 62 and replaced it with:


It seems to me that CMake is putting all external modules into the same directory, and this workaround solved my problem.

Is this a bug?


  • Paul Fitzpatrick

    Thanks for reporting this. Yes, this is a bug (that used to work accidentally, as the cmake message says). Thanks for figuring out a solution. Committed (with ${EXTDIR} rather than ${EXT_DIR}, right?), with changelog acknowledgement. If you get a change to confirm that YARP trunk now works for you, that would be very useful.

  • Rui

    Rui - 2011-11-02

    You're right, it's ${EXTDIR} and not ${EXT_DIR}, my mistake.

    I just compiled YARP trunk with this latest change and it works for me.

  • Paul Fitzpatrick

    Thanks, closing bug.

  • Paul Fitzpatrick

    • assigned_to: nobody --> eshuy
    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks