Let's say there's following directory structure:
root | +--projects | | | +-test | | | +-CMakeFiles.txt | +--libs | +-testlib | +-CMakeFiles.txt
testlib also contains
CMakeFiles.txt. "test" produces an executable and "testlib" produces a static library.
I want "test" to link with "testlib" without using symlinks and without moving "testlib" library into a subdirectory within "test".
Because "testlib" isn't a subdirectory of "test", I can't do
CMakeFiles.txt – CMake will complain about "testlib" not being in the "test" subdirectory.
Also, because system has several different compilers, I can't simply install "testlib" libraries into some kind of central directory, so I want
test to compile a local copy of
testlib and link with it (i.e. as if
testlib was a subdirectory). I also want the "test" project to automatically rebuild "testlib" if it has been changed.
So, how can I deal with it? I am using CMake 2.8.4 on Windows XP SP3.