[CMake] Use of CMAKE_LIBRARY_OUTPUT_DIRECTORY

Ryan Pavlik rpavlik at iastate.edu
Mon Sep 13 13:38:18 EDT 2010


  On 9/13/10 12:29 PM, David Aldrich wrote:
> Hi
>
> I have tried to set the output directory for my library as follows:
>
> # set destination directory for LIBRARY target (i.e. libKernel.a)
> set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ./_gnuRelease )
>
> # build the Kernel static library
> add_library(Kernel STATIC ${SRCS})
>
> however, the library is being created in the source directory, not in the directory I have specified.
>
> Why is this please?
>
> Best regards
>
> David
I believe for static libraries, the variable
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
is actually used.  In any case, you might rather consider using 
"install(TARGETS" instead of setting the output directories, and then 
just (on the user-side) setting the CMAKE_INSTALL_PREFIX and doing a 
make install.

Hope this helps!

Ryan

-- 
Ryan Pavlik
Human-Computer Interaction Graduate Student
Virtual Reality Applications Center
Iowa State University

http://academic.cleardefinition.com/



More information about the CMake mailing list