[CMake] PUBLIC_HEADER not working for FRAMEWORKs (OK for targets without FRAMEWORK property)

Boris Dušek boris.dusek at gmail.com
Sat Aug 23 11:10:18 EDT 2008


Hi,

I tried to use CMake to generate a framework with one library file and
bunch of public header files, using this code:

...
add_library(${EBML} ${SOURCES})
set_property(TARGET ${EBML} PROPERTY FRAMEWORK ON)
set_property(TARGET ${EBML} PROPERTY PUBLIC_HEADER ${HEADERS})
...
install(TARGETS ${EBML}
    RUNTIME DESTINATION bin
    LIBRARY DESTINATION lib
    ARCHIVE DESTINATION lib
    FRAMEWORK DESTINATION "/Library/Frameworks"
    PUBLIC_HEADER DESTINATION include/ebml
    )
...

The resulting framework looked like this:
boris at Pioneer:~$ ls -R /Library/Frameworks/ebml.framework/
Versions ebml

/Library/Frameworks/ebml.framework//Versions:
0.8.1   Current

/Library/Frameworks/ebml.framework//Versions/0.8.1:
ebml

Notice that there are no headers included, as I requested by setting
the PUBLIC_HEADER property of the target properly.

When I turned the FRAMEWORK property off (simply by commenting out the
line that sets that property), the library installed into
/usr/local/lib and all the headers from PUBLIC_HEADER property of the
target were installed correctly into /usr/local/include/ebml.

Is there something I am doing wrong? I think there is either bug in
CMake, or in the documentation. I only found this post [1] considering
PUBLIC_HEADER, but it's not the same thing (and it's without answer
anyway).

While I am at it, is it possible to specify the FRAMEWORK DESTINATION
"without specifying it"? I mean, /Library/Frameworks is pretty much
the only option, why can't I omit that and CMake would figure out that
/Library/Frameworks is the default prefix for frameworks on OS X?
Similar note for RUNTINE, LIBRARY, ARCHIVE - the values I specified
are all standard on UNIX, is it possible to specify them only when I
want to use some non-standard location? (it seems against the purpose
of CMake to hardcode these platform-specific values into
CMakeLists.txt files in each project).

Thanks,
Boris Dušek

[1]: http://www.cmake.org/pipermail/cmake/2008-June/022378.html


More information about the CMake mailing list