On Tuesday 12 July 2016 09:00:43 portolan wrote: > Hello, > > I am new to Cmake and I have a pretty strange behaviour: I set my c+++ > project to work with a single CMakefile.txt, and now I am trying to have > a more proper version with a .txt for each subdirectory > > Pretty normal stuff, my source tree is: > > <root> --Lib (my sources) > > --Logger (as the name says, a logger) > > --Lib_UT (Unitary tests for CxxTest) > > --Lib_UT_Runner (the Cxx-generated test runner) > > > I have a Lib_UT/CMakefile.txt and Lib_UT_Runner/CMakefile.txt, I call > them using include_directory(Lib_UT) and
I guess you mean add_subdirectory() ? > include_directory(Lib_UT_Runner) and everything is fine (apart from the > runner executable being in a different directory) > > BUT is I do the same for the logger, Lib_UT_Runner has a linking error > where it cannot link to LibLogger.so. But the shared library is > correctly generated and it is on the command line : > > /usr/bin/c++ -lpthread CMakeFiles/Lib_UT_Runner.dir/Runner.cpp.o > -o Lib_UT_Runner ../Lib_UT/libLib_UT.so ../libLib.so ../libLogger.so > -lpthread > -Wl,-rpath,/home/michele/mast-devel/cmake_debug/Lib_UT:/home/michele/mast-de > vel/cmake_debug:/home/michele/mast-devel/cmake_debug/Logger > > I tried using find_library, but I always get not-found what's the error message ? Posting relevant bits of your CMakeLists.txt (related to subdirs, creating targets and linking) would be helpful too. Alex -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake