![]() Registered Member ![]()
|
I there I am trying to follow http://www.cmake.org/cmake/help/cmake_tutorial.html
That is to say, I try to compile a programm (test_of_vector_tools) that includes .cpp and .h files that are in an other direcotry (lib_kinematic) where I put all my includes. If I understand it right: I just put a CMakeLists in the libkinematic directory in the test_of_vector_tools one, I have to add an "include directories" add "add_subdirectory" as well to actually build the library add a targetl_link_library Compared to the tutorial In my case lib_kinematic is Mathfunction and test_of_vector_tools is Tutorial
|
![]() Administrator ![]()
|
You appear to have a minor typo...
should be
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
OOps that's right,
But the problem now is that he is complaining that
is not a subdirectory, which is indeed right, but I don't have no "add_directory" command |
![]() Administrator ![]()
|
It is likely referring to the fact that the paths CMake needs should be relative to where the CMakeLists.txt file is.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Okay yeah but the stuff is I am not so keen to write a relative link
Anyway, I now do it another way, I compile a .so file separtely, which I try to link . I still have a final linking problem:
Compilation
in the CMakesLists
To me it should find it since it is in a directory that is scaned by ld So far as I have read on the internet the -lkinematic should add a "lib" before and a ".so" at the end , also it should be gould ? I googled and don't find something else than the LD_LIBRARY_PATH stuff (which I have done) Thanks a lot. |
![]() Administrator ![]()
|
If "kinematic" is already linked to in your CMakeLists.txt, then it should be linked to automatically.
I'm not sure of the exact CMake macro, but you probably need to add the linker path however - this is seperate to LD_LIBRARY_PATH.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
hmm I don't clearly understand. To me it is rather a problem that the .so files does not get indexed even when running ldconfing on the path where it is because
If I place the .so file in /usr/lib then the compilation will work without a problem and it will run too What do you mean by adding the linker path? My CMakeLists looks like that:
|
![]() Administrator ![]()
|
Please see http://www.cmake.org/Wiki/CMake_2.6_Not ... irectories
The linker is the program which runs after the compiler, and is responsible for creating the final binary from the now compiled code. The GNU Compiler usually uses "ld" as it's linker.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft