Hi Gerhard,

> ...
> target_link_libraries( ${TEST_EXECUTABLE} libA )
> ...

works fine !

Thanks,
Gerhard
-------- Original-Nachricht --------
Datum: Tue, 3 Apr 2007 10:25:23 +0200
Von: "Gerhard Grimm" <[EMAIL PROTECTED]>
An: [EMAIL PROTECTED], cmake@cmake.org
Betreff: AW: [CMake] Linking installed libraries on a "sub" CMakeLists

> Hi Gerhard,
> 
> I'd suggest to replace
> 
> ...
> set ( LIBA_LIBRARY ${TEST_LIB_INSTALL_DIR}/liblibA.a )
> target_link_libraries( ${TEST_EXECUTABLE} ${LIBA_LIBRARY} )
> ...
> 
> with
> 
> ...
> target_link_libraries( ${TEST_EXECUTABLE} libA )
> ...
> 
> That should do the trick!
> 
> 
> Best regards,
> 
> Gerhard
> 
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Auftrag von
> [EMAIL PROTECTED]
> Gesendet: Dienstag, 3. April 2007 10:06
> An: cmake@cmake.org
> Betreff: [CMake] Linking installed libraries on a "sub" CMakeLists
> 
> 
> Hi all
> 
> I'm using cmake to compile lots of different libs under linux, with
> add_subdirectory.
> I want to install the libs and headers in a directory
> ${CMAKE_BINARY_DIR}/dist/lib and ${CMAKE_BINARY_DIR}/dist/include
> 
> My root CMakeLists.txt file:
> project(testproject)
> 
> add_subdirectory( libA )
> add_subdirectory( libB )
> ...
> add_subdirectory( testApplication )
> 
> 
> 
> 
> My libA CMakeLists.txt file:
> ...
> install(TARGETS libA DESTINATION ${TEST_LIB_INSTALL_DIR} )
> install(FILES libA.h DESTINATION ${TEST_INCLUDE_INSTALL_DIR} )
> ...
> 
> 
> In my testApplication I want to link againt some libraries and I need the
> installed header files.
> ...
> include_directories ( ${TEST_INCLUDE_INSTALL_DIR} )
> link_directories ( ${TEST_LIB_INSTALL_DIR} )
> ...
> 
> ...
> set ( LIBA_LIBRARY ${TEST_LIB_INSTALL_DIR}/liblibA.a )
> target_link_libraries( ${TEST_EXECUTABLE} ${LIBA_LIBRARY} )
> ...
>  
> When I call cmake from my project root directory, I get the following
> error.
> CMake Error: Attempt to add link library
> "/home/cmaketests/final/dist/lib/liblibA.a" to target "testApplication" which 
> is not built by this project.
> CMake Error: Cannot find source file
> "/home/cmaketests/final/dist/lib/liblibA.a" for target "testApplication"
> 
> 
> Any ideas ? 
> Thanks all.
> Gerhard
> -- 
> 
> "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
> _______________________________________________
> CMake mailing list
> CMake@cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to