[CMake] Weird binary directory problem

Steven Van Ingelgem steven at vaningelgem.be
Wed Jun 3 07:09:09 EDT 2009


Hi,


I have the following setup:

CMakeLists.txt [have project()]
externals\CMakeLists.txt [add_subdirectory(file)]
externals\file\CMakeLists.txt [have project()]

The problem I am facing is because in the last txt-file I have:
add_executable(file <srcs>)

when I ask to show the directories, what I get is this:
PROJECT_SOURCE_DIR: /.../externals/file
PROJECT_BINARY_DIR:  /.../build/externals/file
CMAKE_CURRENT_BINARY_DIR:  /.../build/externals/file

So far it is logical.

When I "make" it, it says:
Linking C executable ../../bin/file

But the current binary directory is "build/externals/file", why does
it build in "../../bin"??

How can I know in what directory the executable is being build? I
thought this was always in "CMAKE_CURRENT_BINARY_DIR"?


Thanks,
Steven


More information about the CMake mailing list