[CMake] Patch CMake for Mac static library creation

Belcourt, K. Noel kbelco at sandia.gov
Sat Dec 4 14:10:25 EST 2010


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101204/c8d7f893/attachment-0001.htm>


More information about the CMake mailing list