<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 04.06.2014 23:11, Truman Ellis
wrote:<br>
</div>
<blockquote cite="mid:538F8B8D.3050506@ices.utexas.edu" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<meta charset="utf-8">
I have a top level CMakeLists.txt file which builds a library
called Camellia and several executables in subdirectories which
link with Camellia. I would like to add a third party library
called XDMF as a dependency for Camellia under Camellia/TPL/Xdmf.
Luckily, XDMF is already on a CMake build system, but when I use<br>
<br>
add_subdirectory(TPL/Xdmf)<br>
<br>
and then<br>
<br>
add_library(Camellia ${LIB_SOURCES} ${HEADERS})<br>
<br>
it builds Camellia in the build/TPL/Xdmf/bin directory rather than
build as it does without the add_subdirectory(TPL/Xdmf). Why does
adding a subdirectory change the build directory for Camellia, and
how do I fix it? Also how do I make sure Camellia is linking with
Xdmf once I get that figured out? <br>
</blockquote>
<br>
It shouldn't normally.<br>
The only way I can think of is that TPL/Xdmf/CMakeLists.txt sets
CMAKE_RUNTIME_OUTPUT_DIRECTORY as a cache variable.<br>
e.g. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/bin" CACHE PATH "docstring")<br>
<br>
As a regular variable it wouldn't affect targets created in the
parent CMakeLists.txt<br>
<br>
Nils<br>
<br>
<br>
</body>
</html>