I have a library 'bar' that is C++, but exports a C API. So, say, I have
this CMakeLists.txt:
add_library(bar bar.cpp)
add_executable(foo foo.c)
target_link_libraries(foo bar)
On most platforms this is fine, but on Solaris it can't link due to
unresolved externals.
I can work around this by either a) linking foo as C++, or b) forcing
bar to link to libCrun and libCstd. The first is obviously undesirable
because it should be an implementation detail that bar uses C++; users
of the library should not need to care.
Has anyone run into this before? In particular, does anyone know of a
nice, neat, canned solution for grabbing libCrun and libCstd in CMake?
(Or is this a case to use 'target_link_libraries(bar -lCrun -lCstd)'
instead of 'find_library(Cstd ...)', etc.?)
--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
Now I lay me back to sleep.
The speaker's dull; the subject's deep.
If he should stop before I wake,
Give me a nudge for goodness' sake.
-- Anonymous
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake