Fwd: [sldev] Re: CMake 2.4.8 vs 2.6 (Re: Missing cares, apr in Mac build)

Aimee Walton aimee at ama-zing.co.uk
Wed Jul 23 07:23:02 PDT 2008


(Sorry for the second copy of this Bill, forgot to reply to the list)

On Jul 22, 2008, at 20:14, Bill Hoffman wrote:
> Bill Hoffman wrote:
> Aimee Walton wrote:
>> We have
>>      target_link_libraries(myexe /path/to/foo)
>>
>> Which is working on 2.4 as it splits to give -lfoo
>>
>> However on 2.6 it breaks the build, as it uses /path/to/foo when  
>> it really needs /path/to/libfoo.a
>>
>> AImee.
>>
>
> Could someone please clarify if this was working on makefile  
> builds? You say it was /path/to/libfoo.a, and that implies linux/ 
> unix.   I want to make sure this is not a new issue.  As far as I  
> know /path/to/foo always failed (even in CMake 2.4) for any  
> makefile builds included nmake, and unix makefiles.  The only time  
> it worked was with the VS IDE.
> Assuming this was an issue that only affected the VS IDE, the most  
> recent release candidate for cmake 2.6.1 RC 12 contains a fix that  
> should make this work like it did in 2.4, but with a warning.


I'm working on OS X 10.4.11 with Xcode 2.4, I did try RC12, but it  
still breaks on linking in the same way. As an example the actual  
code is stuff like:

In cmake/APR.cmake:

     ...
   elseif (DARWIN)
     set(APR_LIBRARIES
       debug ${ARCH_PREBUILT_DIRS_DEBUG}/apr-1
       optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1
       )
     set(APRUTIL_LIBRARIES
       debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1
       optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1
       )
     ...


Then in cmake/LLCommon.cmake:

     ...
     set(LLCOMMON_LIBRARIES
         llcommon
         ${APRUTIL_LIBRARIES}
         ${APR_LIBRARIES}
         ${EXPAT_LIBRARIES}
         ${ZLIB_LIBRARIES}
         )


Then in mac_crash_logger/CMakeLists.txt:

     ...
     target_link_libraries(mac-crash-logger
         ${LLCRASHLOGGER_LIBRARIES}
         ${LLVFS_LIBRARIES}
         ${LLXML_LIBRARIES}
         ${LLMESSAGE_LIBRARIES}
         ${LLVFS_LIBRARIES}
         ${LLMATH_LIBRARIES}
         ${LLCOMMON_LIBRARIES}
         ${BOOST_SIGNALS_LIBRARY}
         )


With Cmake 2.6 running develop.py (after setting the CMP0003 as  
recommended by the warning) and then opening and building build- 
darwin-i386/SecondLife.xcodeproj in Xcode results in (paths shortened  
with "......"  to save space):

...
Ld ....../indra/build-darwin-i386/mac_crash_logger/RelWithDebInfo/mac- 
crash-logger normal i386
     mkdir ....../indra/build-darwin-i386/mac_crash_logger/ 
RelWithDebInfo
     cd ....../indra/build-darwin-i386
     /usr/bin/g++-4.0 -o ....../indra/build-darwin-i386/ 
mac_crash_logger/RelWithDebInfo/mac-crash-logger -L....../indra/build- 
darwin-i386/mac_crash_logger/RelWithDebInfo -F....../indra/build- 
darwin-i386/mac_crash_logger/RelWithDebInfo -filelist ....../indra/ 
build-darwin-i386/mac_crash_logger/SecondLife.build/RelWithDebInfo/ 
mac-crash-logger.build/Objects-normal/i386/mac-crash- 
logger.LinkFileList -arch i386 -Wl,-Y,1455 -L/opt/local/lib -L/usr/ 
X11R6/lib -Wl,-headerpad_max_install_names,-search_paths_first ....../ 
indra/build-darwin-i386/llcrashlogger/RelWithDebInfo/ 
libllcrashlogger.a ....../indra/build-darwin-i386/llvfs/ 
RelWithDebInfo/libllvfs.a -framework Carbon -lexpat -lcurl ....../ 
indra/../libraries/universal-darwin/lib_release/cares -lssl - 
lllcrypto -lxmlrpc-epi ....../indra/../libraries/universal-darwin/ 
lib_release/aprutil-1 ....../indra/../libraries/universal-darwin/ 
lib_release/apr-1 -framework Carbon -lexpat -lcurl ....../indra/../ 
libraries/universal-darwin/lib_release/cares -lssl -lllcrypto - 
lxmlrpc-epi ....../indra/../libraries/universal-darwin/lib_release/ 
aprutil-1 ....../indra/../libraries/universal-darwin/lib_release/ 
apr-1 ....../indra/build-darwin-i386/llxml/RelWithDebInfo/ 
libllxml.a ....../indra/build-darwin-i386/llmessage/RelWithDebInfo/ 
libllmessage.a ....../indra/build-darwin-i386/llmath/RelWithDebInfo/ 
libllmath.a ....../indra/build-darwin-i386/llcommon/RelWithDebInfo/ 
libllcommon.a -lz -lboost_signals-mt -lexpat ....../indra/build- 
darwin-i386/llmessage/RelWithDebInfo/libllmessage.a -lcurl ....../ 
indra/../libraries/universal-darwin/lib_release/cares -lssl - 
lllcrypto -lxmlrpc-epi ....../indra/build-darwin-i386/llvfs/ 
RelWithDebInfo/libllvfs.a -framework Carbon ....../indra/build-darwin- 
i386/llmath/RelWithDebInfo/libllmath.a ....../indra/build-darwin-i386/ 
llcommon/RelWithDebInfo/libllcommon.a ....../indra/../libraries/ 
universal-darwin/lib_release/aprutil-1 ....../indra/../libraries/ 
universal-darwin/lib_release/apr-1 -lexpat -lz -lboost_signals-mt
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/cares: No such file or directory
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/aprutil-1: No such file or directory
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/apr-1: No such file or directory
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/cares: No such file or directory
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/aprutil-1: No such file or directory
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/apr-1: No such file or directory
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/cares: No such file or directory
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/aprutil-1: No such file or directory
i686-apple-darwin8-g++-4.0.1: ....../indra/../libraries/universal- 
darwin/lib_release/apr-1: No such file or directory

The files are there in that location as libcares.a, libapr-1.a and  
libaprutil-1.a

With Cmake 2.4.8 it succeeds with:

...
Ld ....../indra/build-darwin-i386/mac_crash_logger/RelWithDebInfo/mac- 
crash-logger normal i386
     mkdir ....../indra/build-darwin-i386/mac_crash_logger/ 
RelWithDebInfo
     cd ....../indra/build-darwin-i386
     /usr/bin/g++-4.0 -o ....../indra/build-darwin-i386/ 
mac_crash_logger/RelWithDebInfo/mac-crash-logger -L....../indra/build- 
darwin-i386/mac_crash_logger/RelWithDebInfo -L....../indra/build- 
darwin-i386/llcrashlogger/RelWithDebInfo -L....../indra/build-darwin- 
i386/llcrashlogger -L....../indra/build-darwin-i386/llvfs/ 
RelWithDebInfo -L....../indra/build-darwin-i386/llvfs -L....../indra/ 
build-darwin-i386/llxml/RelWithDebInfo -L....../indra/build-darwin- 
i386/llxml -L....../indra/build-darwin-i386/llmessage/RelWithDebInfo - 
L....../indra/build-darwin-i386/llmessage -L....../indra/build-darwin- 
i386/llmath/RelWithDebInfo -L....../indra/build-darwin-i386/llmath - 
L....../indra/build-darwin-i386/llcommon/RelWithDebInfo -L....../ 
indra/build-darwin-i386/llcommon -L....../indra/../libraries/ 
universal-darwin/lib_release/RelWithDebInfo -L....../indra/../ 
libraries/universal-darwin/lib_release -F....../indra/build-darwin- 
i386/mac_crash_logger/RelWithDebInfo -F/System/Library/Frameworks - 
filelist ....../indra/build-darwin-i386/mac_crash_logger/ 
SecondLife.build/RelWithDebInfo/mac-crash-logger.build/Objects-normal/ 
i386/mac-crash-logger.LinkFileList -arch i386 -Wl,-Y,1455 -L/opt/ 
local/lib -L/usr/X11R6/lib -Wl,-headerpad_max_install_names,- 
search_paths_first -lllcrashlogger -lllvfs -framework Carbon -lllxml - 
lexpat -lllmessage -lcurl -lcares -lssl -lllcrypto -lxmlrpc-epi - 
lllvfs -framework Carbon -lllmath -lllcommon -laprutil-1 -lapr-1 - 
lexpat -lz -lboost_signals-mt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/sldev/attachments/20080723/88fbe499/attachment-0001.htm


More information about the SLDev mailing list