Discussion:
[CMake] Use of CMAKE_LIBRARY_OUTPUT_DIRECTORY
David Aldrich
2010-09-13 17:29:05 UTC
Permalink
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
Ryan Pavlik
2010-09-13 17:38:18 UTC
Permalink
Post by David Aldrich
Hi
# 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/
David Aldrich
2010-09-14 08:31:06 UTC
Permalink
Hi Ryan
Post by Ryan Pavlik
I believe for static libraries, the variable
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
is actually used.
Thanks for your answer. That's just what I need.

Best regards

David

Loading...