Skip to content
Permalink
Browse files

Ensure on macOS generated export header gets copied to frameworks

It *should* get copied with PUBLIC_HEADER property of target, but CMake
quirk causes it to be skipped if not part of original sources for the
target, which can’t happen because the target needs to exist first to
make the export header. This only fixes ‘qgis’ frameworks.

[ci skip]
  • Loading branch information
dakcarto committed Mar 8, 2017
1 parent e32478e commit f5d0ba1aa93f30954d02077bd6fb5b2ebf05b54e
Showing with 24 additions and 0 deletions.
  1. +8 −0 src/analysis/CMakeLists.txt
  2. +8 −0 src/core/CMakeLists.txt
  3. +8 −0 src/gui/CMakeLists.txt
@@ -205,6 +205,14 @@ ELSE(NOT APPLE)
PUBLIC_HEADER "${QGIS_ANALYSIS_HDRS}"
LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}"
)
# generated export header does not get copied with PUBLIC_HEADER files
ADD_CUSTOM_COMMAND(TARGET qgis_analysis
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy qgis_analysis.h
"${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIB_SUBDIR}/qgis_analysis.framework/Headers"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS qgis_analysis.h
)
ENDIF(NOT APPLE)

#generate unversioned libs for android
@@ -1008,6 +1008,14 @@ ELSE(NOT APPLE)
PUBLIC_HEADER "${QGIS_CORE_HDRS};${QGIS_CORE_MOC_HDRS}"
LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}"
)
# generated export header does not get copied with PUBLIC_HEADER files
ADD_CUSTOM_COMMAND(TARGET qgis_core
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy qgis_core.h
"${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIB_SUBDIR}/qgis_core.framework/Headers"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS qgis_core.h
)
ENDIF(NOT APPLE)

#generate unversioned libs for android
@@ -806,6 +806,14 @@ ELSE(NOT APPLE)
PUBLIC_HEADER "${QGIS_GUI_HDRS};${QGIS_GUI_MOC_HDRS}"
LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}"
)
# generated export header does not get copied with PUBLIC_HEADER files
ADD_CUSTOM_COMMAND(TARGET qgis_gui
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy qgis_gui.h
"${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIB_SUBDIR}/qgis_gui.framework/Headers"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS qgis_gui.h
)
ENDIF(NOT APPLE)

#generate unversioned libs for android

0 comments on commit f5d0ba1

Please sign in to comment.
You can’t perform that action at this time.