I just read this answer, suggesting the use of CMAKE_LIBRARY_OUTPUT_DIRECTORY
for setting the directory in which library targets are created. Well, this doesn't seem to work for me:
# etc. etc.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib/")
cuda_add_library(
mykernels
src/kernel_wrappers/kernel1.cu
src/kernel_wrappers/kernel2.cu)
When I make
, the library libmyktkernels.a
is created in the main project folder (where my CMakeFiles.txt
is located), not in the lib/
subdirectory. Why is that?
Use CMAKE_ARCHIVE_OUTPUT_DIRECTORY
for the static libraries.
CMAKE_LIBRARY_OUTPUT_DIRECTORY
applies only to dynamic libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With