so I have the following project layout:
- CMakeLists.txt
- include/
- ...
- src/
- CMakeLists.txt
- binary1.cc
- binary2.cc
- ...
- third_party/
- project1/
- CMakeLists.txt
- ...
- bin/
The CMakeLists.txt in the root directory basically contains the following statements:
add_subdirectory(src)
add_subdirectory(third_party/project1)
...
To build I do the following:
cd bin/
cmake ..
make
.. which will happily build everything, but it places binary1
and binary2
into /bin/src
whereas I would prefer them to live in /bin/
directly (for some compatibility reasons).
I tried the following, but cmake will not configure because " ../bin is already used to build a source directory. It cannot be used to build.":
add_subdirectory(src .)
Can someone provide hints?