[CMake] Relinking static libs

Bill Hoffman bill.hoffman at kitware.com
Wed Apr 9 11:59:21 EDT 2008


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)

CMake will recognize bar as the static library and put in the correct 
depend information.

-Bill


More information about the CMake mailing list