1 #################################################################################
4 # GEOS C++ library build configuration for CMake build system
6 # Copyright (C) 2009 Mateusz Loskot <mateusz@loskot.net>
8 # This is free software; you can redistribute and/or modify it under
9 # the terms of the GNU Lesser General Public Licence as published
10 # by the Free Software Foundation.
11 # See the COPYING file for more information.
13 #################################################################################
15 #################################################################################
17 #################################################################################
19 # There is a builtin cmake way to get headers in the right location
20 # for OS X framework, but it's not practical this complex tree
22 if(APPLE AND GEOS_ENABLE_MACOSX_FRAMEWORK)
23 set(installdest GEOS.framework/Versions/${VERSION_MAJOR}/Headers)
25 set(installdest include/geos)
30 DESTINATION ${installdest})
32 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/geos/platform.h
33 DESTINATION ${installdest})
35 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/geos/version.h
36 DESTINATION ${installdest})
38 install(DIRECTORY geos/
39 DESTINATION ${installdest}
43 PATTERN ".svn" EXCLUDE)
45 # Some post-processing for the framework
46 # luckily GEOS uses header subdir already, just need to change case
47 if(APPLE AND GEOS_ENABLE_MACOSX_FRAMEWORK)
49 "execute_process(COMMAND find \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${installdest}\" -name *.* -print0
50 COMMAND xargs -0 sed -E -i \"\" \"s,# *include[[:space:]]+<geos/,#include <GEOS/,g\")")
52 "execute_process(COMMAND ln -sfh Versions/Current/Headers \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/GEOS.framework/Headers\")")