[CMake] Target Link Library

Lloyd lloydkl.tech at gmail.com
Wed Mar 12 04:58:41 EDT 2014


Hi,

My cross platform project has a main module and a custom library. The main
module depends on the custom library. Both these projects need to be built
with cmake. At present the option I find to set this is to using the
"target_link_library(MyExe ${CMAKE_CURRENT_BINARY_DIR}/myLib.lib)". But
this code makes my cmake file platform dependent, that is on windows I need
to use the "MyLib.lib" in CMake and on Linux I need to use "MyLib.a" ! Is
there a better alternative? (I went through the doc of find_library(), but
it doesn't seem to be suitable in this scenatio)

Thanks,
  Lloyd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140312/f4e5a009/attachment.html>


More information about the CMake mailing list