[CMake] Library directory flag

Michele Bosi michele.bosi at gmail.com
Mon May 11 11:05:33 EDT 2009


I'm sure this question has been asked already many times but I cound't
find any info in the archive (also because it seems that the archive
is not searchable...).
I would like to know how to add a library directory flag to a target.
For now I could only find the command:

set_target_properties(WX_example PROPERTIES LINK_FLAGS
/LIBPATH:"${WXWIDGETS_LIBRARY_DIR}")

This works fine with Visual C++ but I guess that it does not work
under linux and mac as /LIBPATH is a VC specific flag, while GCC uses
"-L".

Is there a way to do this thing in a portable way, something like
"include_directories()" but for library directories?

Thanks,
Michele


More information about the CMake mailing list