Have a look at the documentation for CMAKE_RUNTIME_OUTPUT_DIRECTORY. On Linux the .so shared library files do go in the LIBRARY_OUTPUT_DIRECTORY. However, on Windows the DLL files are placed in the runtime directory and only the import libraries (.LIB files) are placed in the LIBRARY_OUTPUT_DIRECTORY.<br>
<br><div class="gmail_quote">2011/7/25 Laura Autón García <span dir="ltr"><<a href="mailto:laura.auton@gmail.com">laura.auton@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello all,<br>
In the project I am collaborating on, CMake is used in Windows in<br>
order to generate a Visual C++ solution to be compiled afterwards. In<br>
this process, everything seems to work fine as the external<br>
directories and libraries are well included and everything compiles<br>
and so. However, we are experiencing problems with the directory in<br>
which our dll library is to be created.<br>
We specify in CMake that the directory is ../lib but<br>
when checking the configuration in Visual C++ software, it seems to be<br>
../bin/Release directory, so the library is generated there.<br>
The CMake sentences we wrote regarding this issue are as follows:<br>
<br>
SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib")<br>
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIB_DIR} CACHE PATH "Directory<br>
for libraries")<br>
<br>
According to the documentation:<br>
<br>
CMAKE_LIBRARY_OUTPUT_DIRECTORY: Where to put all the LIBRARY<br>
targets when built.<br>
This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY<br>
property on all the targets.<br>
See that target property for additional information.<br>
<br>
Also, the documentation regarding LIBRARY_OUTPUT_DIRECTORY shows:<br>
<br>
LIBRARY_OUTPUT_DIRECTORY: Output directory in which to build<br>
LIBRARY target files.<br>
This property specifies the directory into which library target<br>
files should be built. There are three<br>
kinds of target files that may be built: archive, library, and<br>
runtime. Executables are always treated<br>
as runtime targets. Static libraries are always treated as archive<br>
targets. Module libraries are always<br>
treated as library targets. For non-DLL platforms shared libraries<br>
are treated as library targets. For<br>
DLL platforms the DLL part of a shared library is treated as a<br>
runtime target and the corresponding<br>
import library is treated as an archive target. All Windows-based<br>
systems including Cygwin are<br>
DLL platforms. This property is initialized by the value of the variable<br>
CMAKE_LIBRARY_OUTPUT_DIRECTORY if it is set when a target is created.<br>
<br>
However, when the project is generated, the library output directory<br>
is not the one specified, but the one I mentioned above.<br>
If anyone has any idea why this may be happening, it would be appreciated.<br>
The binaries, on the other hand, as generated in their correct directory.<br>
<br>
Thank you in advance.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br>