Re: [CMake] Patch CMake for Mac static library creation
On 11/04/2011 11:11 PM, Belcourt, K. Noel wrote: > > On Nov 4, 2011, at 3:56 PM, Belcourt, K. Noel wrote: > >> This is a long overdue followup. >> >> On Dec 4, 2010, at 12:10 PM, Belcourt, K. Noel wrote: >> >>> On Dec 4, 2010, at 10:08 AM, Ryan Pavlik wrote: >>> You can configure this for your project: http://www.cmake.org/cmake/help/cmake-2-8- docs.html#prop_tgt:STATIC_LIBRARY_FLAGS >> >> STATIC_LIBRARY_FLAGS are passed to the archiver. On the Mac, I need >> to run ranlib after ar runs, and pass flags (-c) to ranlib. Another >> other ideas how to achieve this? > > If I use a custom command like this (physics is the name of the static > library): > > add_custom_command(TARGET physics POST_BUILD COMMAND ranlib -c) This custom command can't work since you don't provide the library as argument for ranlib. How exactly does the failing command look alike? > I get this error when it tries to run. > > "/usr/bin/ranlib -c" libphysics.a > Error running link command: No such file or directory > make[2]: *** [libs/test/physics/libphysics.a] Error 2 > > Because the quoted command includes the argument. Any ideas? Have you tried the VERBATIM flag, yet? Regards, Michael -- 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] Patch CMake for Mac static library creation
On Nov 4, 2011, at 3:56 PM, Belcourt, K. Noel wrote: This is a long overdue followup. On Dec 4, 2010, at 12:10 PM, Belcourt, K. Noel wrote: On Dec 4, 2010, at 10:08 AM, Ryan Pavlik wrote: You can configure this for your project: http://www.cmake.org/cmake/help/cmake-2-8- docs.html#prop_tgt:STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS are passed to the archiver. On the Mac, I need to run ranlib after ar runs, and pass flags (-c) to ranlib. Another other ideas how to achieve this? If I use a custom command like this (physics is the name of the static library): add_custom_command(TARGET physics POST_BUILD COMMAND ranlib -c) I get this error when it tries to run. "/usr/bin/ranlib -c" libphysics.a Error running link command: No such file or directory make[2]: *** [libs/test/physics/libphysics.a] Error 2 Because the quoted command includes the argument. Any ideas? -- Noel -- 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] Patch CMake for Mac static library creation
Hi, This is a long overdue followup. On Dec 4, 2010, at 12:10 PM, Belcourt, K. Noel wrote: On Dec 4, 2010, at 10:08 AM, Ryan Pavlik wrote: You can configure this for your project: http://www.cmake.org/cmake/help/cmake-2-8- docs.html#prop_tgt:STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS are passed to the archiver. On the Mac, I need to run ranlib after ar runs, and pass flags (-c) to ranlib. Another other ideas how to achieve this? Thanks. -- Noel This doesn't seem to do what I want it to. In my CMakeLists.txt file I have this code. ADD_LIBRARY(modules ${SRCS}) set_target_properties(modules PROPERTIES static_library_flags "-noel") but my bogus option never appears anywhere, and I am creating a static archive library for this target. Also, it seems this flag is geared more to passing flags to ar, not to ranlib (at least there's been some discussion about using it to pass -X 64 to ar on AIX). Note that I've also tried this approach. -D CMAKE_RANLIB:FILEPATH="/usr/bin/ranlib -c" resulting in this error. "/usr/bin/ranlib -c" libmodules.a Error running link command: No such file or directory make[2]: *** [Modules/libmodules.a] Error 2 Naturally omitting the quotes silently drops the -c option. -- Noel -- 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] Patch CMake for Mac static library creation
The name of the target property likely has to be matching the original case (all caps) Ryan On Sat, Dec 4, 2010 at 1:10 PM, Belcourt, K. Noel wrote: > Hi Ryan, > > On Dec 4, 2010, at 10:08 AM, Ryan Pavlik wrote: > > You can configure this for your project: > > http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:STATIC_LIBRARY_FLAGS > > > This doesn't seem to do what I want it to. In my CMakeLists.txt file I > have this code. > > ADD_LIBRARY(modules ${SRCS}) > set_target_properties(modules PROPERTIES static_library_flags "-noel") > > but my bogus option never appears anywhere, and I am creating a static > archive library for this target. Also, it seems this flag is geared more to > passing flags to ar, not to ranlib (at least there's been some discussion > about using it to pass -X 64 to ar on AIX). > > Note that I've also tried this approach. > > -D CMAKE_RANLIB:FILEPATH="/usr/bin/ranlib -c" > > resulting in this error. > > "/usr/bin/ranlib -c" libmodules.a > Error running link command: No such file or directory > make[2]: *** [Modules/libmodules.a] Error 2 > > Naturally omitting the quotes silently drops the -c option. > > -- Noel > > -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com Internal VRAC/HCI Site: http://tinyurl.com/rpavlik ___ 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] Patch CMake for Mac static library creation
Hi Ryan, On Dec 4, 2010, at 10:08 AM, Ryan Pavlik wrote: You can configure this for your project: http://www.cmake.org/cmake/help/cmake-2-8- docs.html#prop_tgt:STATIC_LIBRARY_FLAGS This doesn't seem to do what I want it to. In my CMakeLists.txt file I have this code. ADD_LIBRARY(modules ${SRCS}) set_target_properties(modules PROPERTIES static_library_flags "-noel") but my bogus option never appears anywhere, and I am creating a static archive library for this target. Also, it seems this flag is geared more to passing flags to ar, not to ranlib (at least there's been some discussion about using it to pass -X 64 to ar on AIX). Note that I've also tried this approach. -D CMAKE_RANLIB:FILEPATH="/usr/bin/ranlib -c" resulting in this error. "/usr/bin/ranlib -c" libmodules.a Error running link command: No such file or directory make[2]: *** [Modules/libmodules.a] Error 2 Naturally omitting the quotes silently drops the -c option. -- Noel ___ 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] Patch CMake for Mac static library creation
On Dec 4, 2010, at 10:08 AM, Ryan Pavlik wrote: You can configure this for your project: http://www.cmake.org/cmake/help/cmake-2-8- docs.html#prop_tgt:STATIC_LIBRARY_FLAGS Thanks Ryan, I'll try it out. -- Noel ___ 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] Patch CMake for Mac static library creation
You can configure this for your project: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:STATIC_LIBRARY_FLAGS Ryan On Fri, Dec 3, 2010 at 7:07 PM, Belcourt, K. Noel wrote: > Hi, > > I'm on Mac OSX 10.5.8 with Intel 12.x compilers and CMake version 2.8.3. > CMake doesn't seem to add the -c option to the ranlib command to include > common symbols into the library table of contents. Here's the documentation > for Apple's ranlib. > > -c Include common symbols as definitions with respect to the > table of contents. This is seldom the intended behavior for > linking from a library, as it forces the linking of a library > member just because it uses an uninitialized global that is > undefined at that point in the linking. This option is > included only because this was the original behavior of ranlib. > This option is not the default. > > This behavior is necessary if you have Fortran 90 modules that define data > but that don't contain any code (or contains code that isn't called). Can > -c be added by default when creating static Fortran libraries on the Mac > using ranlib? > > Thanks. > > -- Noel Belcourt > > > ___ > 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 > -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com Internal VRAC/HCI Site: http://tinyurl.com/rpavlik ___ 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] Patch CMake for Mac static library creation
Hi, I'm on Mac OSX 10.5.8 with Intel 12.x compilers and CMake version 2.8.3. CMake doesn't seem to add the -c option to the ranlib command to include common symbols into the library table of contents. Here's the documentation for Apple's ranlib. -c Include common symbols as definitions with respect to the table of contents. This is seldom the intended behavior for linking from a library, as it forces the linking of a library member just because it uses an uninitialized global that is undefined at that point in the linking. This option is included only because this was the original behavior of ranlib. This option is not the default. This behavior is necessary if you have Fortran 90 modules that define data but that don't contain any code (or contains code that isn't called). Can -c be added by default when creating static Fortran libraries on the Mac using ranlib? Thanks. -- Noel Belcourt ___ 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