build: add compatibility symlink for block headers

On FreeBSD and OSX, the block runtime functions are defined on a Block.h
and a Block_private.h headers on the include path as opposed to
libobjc2's objc/blocks_runtime.h and objc/blocks_private.h respectively.

This commit amends libobjc2's install routine to create the
FreeBSD-style headers as symlinks to the ones provided by libobjc2 for
improved compatibility.
main
Daniel Ferreira 9 years ago
parent 2417ec5806
commit a9aba57e7c

@ -1,9 +1,13 @@
cmake_minimum_required(VERSION 2.8)
project(libobjc)
enable_language(ASM)
macro(install_symlink filepath sympath)
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${filepath} ${sympath})")
install(CODE "message(\"-- Symlinking: ${sympath} -> ${filepath}\")")
endmacro(install_symlink)
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -fno-inline ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "-O3 ${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
@ -309,7 +313,8 @@ install(TARGETS ${INSTALL_TARGETS}
install(FILES ${libobjc_HDRS}
DESTINATION "${HEADER_INSTALL_PATH}/${INCLUDE_DIRECTORY}")
install_symlink(${HEADER_INSTALL_PATH}/${INCLUDE_DIRECTORY}/blocks_runtime.h ${HEADER_INSTALL_PATH}/Block.h)
install_symlink(${HEADER_INSTALL_PATH}/${INCLUDE_DIRECTORY}/blocks_private.h ${HEADER_INSTALL_PATH}/Block_private.h)
set(CPACK_GENERATOR TGZ CACHE STRING
"Installer types to generate. Sensible options include TGZ, RPM and DEB")

Loading…
Cancel
Save