[CMake] Static Library output problem

Michael Wild themiwi at gmail.com
Fri Nov 11 09:34:50 EST 2011


On 11/11/2011 03:18 PM, Romain LEGUAY wrote:
> Hello everyone!
> First, I need to thank you all the CMake developers for their awesome
> work!!!
> 
> I try to build a static and a shared libraries. I set the
> LIBRARY_OUTPUT_DIRECTORY for each library target like this:
> 
> set_target_properties(${sharedLib} PROPERTIES
>   LIBRARY_OUTPUT_DIRECTORY
>  
> ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE})
> 
> set_target_properties(${staticLib} PROPERTIES
>   LIBRARY_OUTPUT_DIRECTORY
>  
> ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE})
> 
> 
> The shared library is built in the correct directory but the static is
> built in PROJECT_BINARY_DIR.
> I try to switch the order of the set_target_properties method but no
> changes.
> I don't why it doesn't work.
> 
> Did anyone have any ideas?
> 
> I attached my CMakeLists.txt file.
> 
> Thanks,
> Romain
> 
> PS: I'm on Ubuntu 11.10 64bits, with cmake 2.8.5 (installed from the deb
> package).

For static libraries, all the variables and properties use the ARCHIVE
name (e.g. ARCHIVE_OUTPUT_DIRECTORY).

HTH

Michael



More information about the CMake mailing list