[CMake] Patch CMake for Mac static library creation

Ryan Pavlik rpavlik at iastate.edu
Sat Dec 4 18:58:05 EST 2010


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 <kbelco at sandia.gov> 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

rpavlik at iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101204/e7cd60d0/attachment.htm>


More information about the CMake mailing list