Re: [CMake] Relinking static libs

2008-04-10 Thread Bill Hoffman
Jean Lepropre wrote: Ok, I have similar instructions and it does not work (relink is not done): 1. In top-level CMakeLists.txt: ... ADD_SUBDIRECTORY(libs/bar) ADD_SUBDIRECTORY(applications/foo) ... 2. In libs/bar/CMakeLists.txt: ... ADD_LIBRARY(bar STATIC ...) ... 3. In applications/foo/CMa

Re: [CMake] Relinking static libs

2008-04-10 Thread Jean Lepropre
ROTECTED]> 09/04/08 18:00 To Jean Lepropre <[EMAIL PROTECTED]> cc cmake@cmake.org Subject Re: [CMake] Relinking static libs Jean Lepropre wrote: > Hi Bill, > > Is it the same thing if static lib is built by CMake? > No, if CMake is building the library as part of the

Re: [CMake] Relinking static libs

2008-04-09 Thread Bill Hoffman
Jean Lepropre wrote: Hi Bill, Is it the same thing if static lib is built by CMake? No, if CMake is building the library as part of the project, you link it by the target name of the library. Like this: add_library(bar STATIC ...) add_executable(foo ...) target_link_libraries(foo bar) CMak

Re: [CMake] Relinking static libs

2008-04-09 Thread Jean Lepropre
Hi Bill, Is it the same thing if static lib is built by CMake? Cheers, Jean. Message: 2 Date: Wed, 09 Apr 2008 08:35:17 -0400 From: Bill Hoffman <[EMAIL PROTECTED]> Subject: Re: [CMake] Relinking static libs To: Ilya Shvetsov <[EMAIL PROTECTED]> Cc: "cmake@cmake.org"

Re: [CMake] Relinking static libs

2008-04-09 Thread Ilya Shvetsov
You must use a FULL path to the library or CMake will not know what depend information to add. If you have: add_executable(foo foo.c) link_directories(foobar) target_link_libraries(foo A B C) And A, B and C are libraries in the foobar directory that are not built by CMake, then there will be

Re: [CMake] Relinking static libs

2008-04-09 Thread Bill Hoffman
Ilya Shvetsov wrote: On Wed, 09 Apr 2008 10:55:35 +0300, Jean Lepropre <[EMAIL PROTECTED]> wrote: Hi, I have a somewhat strange problem when linking with static libraries. I have an executable that links to a static library. If I modify only a source (cpp) file of the static lib, the lib is re

Re: [CMake] Relinking static libs

2008-04-09 Thread Ilya Shvetsov
On Wed, 09 Apr 2008 10:55:35 +0300, Jean Lepropre <[EMAIL PROTECTED]> wrote: Hi, I have a somewhat strange problem when linking with static libraries. I have an executable that links to a static library. If I modify only a source (cpp) file of the static lib, the lib is rebuilt and reinstalled

[CMake] Relinking static libs

2008-04-09 Thread Jean Lepropre
Hi, I have a somewhat strange problem when linking with static libraries. I have an executable that links to a static library. If I modify only a source (cpp) file of the static lib, the lib is rebuilt and reinstalled but the executable is not relinked to the static lib (so changes are not refl