Use of OBJECT library breaks install of Framework headers
It sounds a little counterintuitive but it is so.
To reproduce, use the files in the "Tests/Framework" folder of the cmake repository and replace the "CMakeLists.txt" file with:
cmake_minimum_required (VERSION 2.6)
project(Framework)
add_library( bar OBJECT
foo.cxx
)
add_library( foo
$<TARGET_OBJECTS:bar>
# foo.cxx
foo.h
)
add_dependencies( foo bar)
set_target_properties( foo PROPERTIES
FRAMEWORK TRUE
PUBLIC_HEADER "foo.h"
)
When you build it, you will see that there is no "foo.framework/Headers/foo.h" file created. Now comment out the line $<TARGET_OBJECTS:bar>
and un-comment in foo.cxx
. The file "foo.framework/Headers/foo.h" will appear after a build.
BTW, if you leave foo.h
out of add_library
not even the "Headers" folder is created. But there is no warning given. This has been the second time this has bewildered me for hours. A warning at least would be appreciated.