[CMake] Problem with a simple framework target on OS X

Nat! nat-cmake at mulle-kybernetik.com
Mon Jan 16 05:02:21 EST 2017


Hi

I am trying to create an OS X framework with resources and headers using
cmake. This is my `CMakeLists.txt` file:

    project( Foo)

    cmake_minimum_required (VERSION 3.7)

    add_library( Foo SHARED
    foo.c
    )

    set_target_properties( Foo PROPERTIES
    FRAMEWORK TRUE
    RESOURCE "foo.md"
    PUBLIC_HEADER "foo.h"
    )


When I run `( mkdir build ; cd build ; cmake .. ; make)` a
`Foo.framework` is generated, but the header and the resource do not
appear in it. What am I missing ? (cmake version 3.7.1)

---
How to reproduce. Save above CMakeLists.txt. Now execute:

    #!/bin/sh

    echo "int version = 1;" > foo.c
    touch foo.h
    touch foo.md
    ( mkdir build ; cd build ; cmake .. ; make)
    ls -R build/Foo.framework/


Ciao
   Nat!

P.S. Asked this on stackoverflow too
(https://stackoverflow.com/posts/41597860) a few days ago.



More information about the CMake mailing list