Re: [CMake] Generated library location
On Sun, 4 Mar 2012 22:15:52 +0100 Andreas Pakulat ap...@gmx.de wrote: No, for those three at least you also don't need link_directories. The find-modules for all 3 provide the absolute paths to the libraries in CMake variables which you can use with target_link_libraries directly and it'll just work. Thanks, Rolf and Andreas! Like I said, I'm pretty new to CMake and there is a lot to learn. I will work on that next... :-) -- Kevin Nathan (Arizona, USA) http://www.project54.com Open standards. Open source. Open minds. The command line is the front line. Linux 2.6.37.6-0.11-desktop 14:34pm up 19 days 23:53, 13 users, load average: 1.04, 0.99, 0.76 -- 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
[CMake] Generated library location
I have inherited maintenance (and updating) on a program that was spread over three different source root trees and I have incorporated them into one source tree. Since I am fairly new to CMake (and really loving it compared to autotools), I am probably missing something obvious, but here is my problem: doing an out-of-source build, my 'old-common' library (which will eventually be phased out) ends up in ./build/old-common but the source for prog2 and prog3 all look for it in ./old-common. Is there a command I can use to cause CMake to actually build the lib in ./old-common (or move it there) or do I need to write a command to copy it after generation? Or should I just use an in-source build (which I would prefer not to do)? Or is there another obvious solution which I cannot see? I have been looking through this mailing list and combing through the CMake docs but I just cannot see an easy solution... . |-build |---old-common |---src |-prog2 |-dao |-prog3 |-reports |-types |-lib (not yet used) |-old-common (old lib source) |-src (contains prog1 source) |---prog2 (source) |---dao (lib source) |---prog3 (source) |---reports (lib source) |---types (lib source) -- Kevin Nathan (Arizona, USA) http://www.project54.com Open standards. Open source. Open minds. The command line is the front line. Linux 2.6.37.6-0.11-desktop 11:27am up 18 days 20:45, 13 users, load average: 0.10, 0.22, 0.23 -- 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
Re: [CMake] Generated library location
Am Sonntag, 4. März 2012, 11:28:47 schrieb Kevin Nathan: I have inherited maintenance (and updating) on a program that was spread over three different source root trees and I have incorporated them into one source tree. Since I am fairly new to CMake (and really loving it compared to autotools), I am probably missing something obvious, but here is my problem: doing an out-of-source build, my 'old-common' library (which will eventually be phased out) ends up in ./build/old-common but the source for prog2 and prog3 all look for it in ./old-common. Is there a command I can use to cause CMake to actually build the lib in ./old-common (or move it there) or do I need to write a command to copy it after generation? Or should I just use an in-source build (which I would prefer not to do)? Or is there another obvious solution which I cannot see? I have been looking through this mailing list and combing through the CMake docs but I just cannot see an easy solution... target_link_libraries(prog2 old-common) target_link_libraries(prog3 old-common) Eike signature.asc Description: This is a digitally signed message part. -- 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
Re: [CMake] Generated library location
On Sun, 04 Mar 2012 19:50:50 +0100 Rolf Eike Beer e...@sf-mail.de wrote: Am Sonntag, 4. März 2012, 11:28:47 schrieb Kevin Nathan: ...doing an out-of-source build, my 'old-common' library (which will eventually be phased out) ends up in ./build/old-common but the source for prog2 and prog3 all look for it in ./old-common. target_link_libraries(prog2 old-common) target_link_libraries(prog3 old-common) Thanks, Eike! That's what I was doing, so your suggestion told me I hadn't messed up there and I went looking for the problem a little deeper. That's when I found that in the link_directories command, in two of the CMakeLists.txt files, was pointing to an old dir (from the old code) and I hadn't updated it to use the old-common dir. (The curse of copy/paste when you aren't sure of what you're doing!) Now, it's working -- thanks, again! -- Kevin Nathan (Arizona, USA) http://www.project54.com Open standards. Open source. Open minds. The command line is the front line. Linux 2.6.37.6-0.11-desktop 12:49pm up 18 days 22:08, 13 users, load average: 0.12, 0.19, 0.22 -- 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
Re: [CMake] Generated library location
Am Sonntag, 4. März 2012, 12:55:40 schrieb Kevin Nathan: On Sun, 04 Mar 2012 19:50:50 +0100 Rolf Eike Beer e...@sf-mail.de wrote: Am Sonntag, 4. März 2012, 11:28:47 schrieb Kevin Nathan: ...doing an out-of-source build, my 'old-common' library (which will eventually be phased out) ends up in ./build/old-common but the source for prog2 and prog3 all look for it in ./old-common. target_link_libraries(prog2 old-common) target_link_libraries(prog3 old-common) Thanks, Eike! That's what I was doing, so your suggestion told me I hadn't messed up there and I went looking for the problem a little deeper. That's when I found that in the link_directories command, in two of the CMakeLists.txt files, was pointing to an old dir (from the old code) and I hadn't updated it to use the old-common dir. (The curse of copy/paste when you aren't sure of what you're doing!) Now, it's working -- thanks, again! Remove it altogether. Link_directories() is never needed when linking to a target built in the same CMake project. You must only make sure that the library is built before the executables. Eike signature.asc Description: This is a digitally signed message part. -- 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