Skip to content
Snippets Groups Projects
Commit 6267dc40 authored by Andreas Schenk's avatar Andreas Schenk
Browse files

added copy_dependenies.cmake, which allows dependency resolution within cmake

added CPack configuration to create complete bundle dmg on OSX with "make package"
parent fe24d579
Branches
Tags
No related merge requests found
......@@ -291,9 +291,12 @@ endif()
add_subdirectory(modules)
add_subdirectory(scripts)
add_subdirectory(tools)
# deployment has to come last, to ensure that all install commands are run before deployment
# magic is done
add_subdirectory(deployment)
set(FILES_TO_BE_REMOVED ${CMAKE_SOURCE_DIR}/stage tests)
add_subdirectory(tools)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${FILES_TO_BE_REMOVED}")
......
This diff is collapsed.
INCLUDE(InstallRequiredSystemLibraries)
#-------------------------------------------------------------------------------
# Author: Andreas Schenk
#
# This file contains the configuration for the bundle/installer creation
# with CPack.
#
#-------------------------------------------------------------------------------
INCLUDE(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenStructure Framework")
set(CPACK_PACKAGE_VENDOR "2008-2010 -- The OpenStructure Team")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/ReadMe.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "0")
if (OST_REV)
set(CPACK_PACKAGE_VERSION_PATCH "0a1_${OST_REV}")
else()
set(CPACK_PACKAGE_VERSION_PATCH "0a1")
endif()
set(OST_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "openstructure ${OST_VERSION}" )
set(CPACK_PACKAGE_VERSION_MAJOR ${OST_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${OST_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${OST_VERSION_PATCH})
if(APPLE)
set(CPACK_GENERATOR Bundle)
set(CPACK_BUNDLE_NAME DNG)
set(CPACK_BUNDLE_PLIST ${PROJECT_SOURCE_DIR}/deployment/macos/Info.plist)
set (CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/graphics/icon.icns)
set (CPACK_BUNDLE_ICON ${PROJECT_SOURCE_DIR}/graphics/icon.icns)
install(CODE "if(NOT ${CMAKE_INSTALL_PREFIX} STREQUAL \${CMAKE_INSTALL_PREFIX})
#read ost_config to apply modifications
file(READ \"\${CMAKE_INSTALL_PREFIX}/libexec/openstructure/ost_config\" ost_config)
set(OST_BINARIES \"\${CMAKE_INSTALL_PREFIX}/bin/lddt\"
\"\${CMAKE_INSTALL_PREFIX}/bin/chemdict_tool\"
\"\${CMAKE_INSTALL_PREFIX}/libexec/openstructure/gosty\")
#copy python into bundle if a version different from the system version is used
if(NOT ${PYTHON_BINARY} MATCHES /usr/bin/)
get_filename_component(real_python_include_path ${PYTHON_INCLUDE_PATH} REALPATH)
get_filename_component(python_root_dir \${real_python_include_path}/../.. REALPATH)
file(COPY \${python_root_dir}/${LIB_DIR}/python${PYTHON_VERSION}/
DESTINATION \${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/python${PYTHON_VERSION})
file(COPY \${python_root_dir}/Resources/Python.app/Contents/MacOS/Python
DESTINATION \${CMAKE_INSTALL_PREFIX}/bin)
file(COPY ${PYTHON_INCLUDE_PATH}/pyconfig.h
DESTINATION \${CMAKE_INSTALL_PREFIX}/include/python${PYTHON_VERSION})
list(APPEND OST_BINARIES \"\${CMAKE_INSTALL_PREFIX}/bin/Python\")
string(REGEX REPLACE \"pyexec=\\\"[^\n\$]*\\\"\"
\"pyexec=\$DNG_BINDIR/Python\"
ost_config \"\${ost_config}\")
endif(NOT ${PYTHON_BINARY} MATCHES /usr/bin/)
file(GLOB_RECURSE OST_PYMODS \"\${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/*.so\")
list(APPEND OST_BINARIES \${OST_PYMODS})
#copy Qt stuff
file(COPY \"${QT_LIBRARY_DIR}/Resources/qt_menu.nib\"
DESTINATION \"\${CMAKE_INSTALL_PREFIX}/libexec/openstructure/\"
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
file(COPY ${QT_PLUGINS_DIR}
DESTINATION \${CMAKE_INSTALL_PREFIX}/libexec/openstructure)
file(GLOB_RECURSE QT_PLUGINS \"\${CMAKE_INSTALL_PREFIX}/libexec/openstructure/*.dylib\")
list(APPEND OST_BINARIES \${QT_PLUGINS})
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/libexec/openstructure/qt.conf\" \"[Paths]\nPlugins=../plugins\n\")
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/../MacOS/dng\" \"#!/bin/sh\nexec \\\"\\\${0%/*}/../Resources/bin/dng\\\"\n\")
execute_process(COMMAND chmod ugo+x \"\${CMAKE_INSTALL_PREFIX}/../MacOS/dng\")
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/libexec/openstructure/ost_config\" \"\${ost_config}\")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake_support)
include(CopyDependencies)
copy_dependencies(\"\${OST_BINARIES}\")
endif(NOT ${CMAKE_INSTALL_PREFIX} STREQUAL \${CMAKE_INSTALL_PREFIX})")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "openstructure ${OST_VERSION_STRING}" )
endif(APPLE)
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlashes.
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/graphics/\\\\icon_32.png")
#set(CPACK_NSIS_INSTALLED_ICON_NAME "bin/\\\\gosty.exe")
set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
set(CPACK_NSIS_HELP_LINK "http:www.openstructure.org")
#set(CPACK_NSIS_URL_INFO_ABOUT "http:www.my-personal-home-page.com")
set(CPACK_NSIS_CONTACT "users@maillist.unibas.ch")
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_SOURCE_STRIP_FILES TRUE)
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/graphics/\\\\icon_32.png")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "")
set(CPACK_PACKAGE_EXECUTABLES "dng" "DNG")
set(CPACK_PACKAGE_EXECUTABLES "gipltng" "gipltng")
set(CPACK_INSTALL_DIRECTORIES "d:/progams/lib")
# set(CPACK_STRIP_FILES "bin/gosty"
# "bin/ost.bat"
# "bin/ost_cl.bat"
# "bin\gipltng.bat
# )
ENDIF()
INCLUDE(CPack) #this must come last
if(${PROJECT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
INCLUDE(CPack) #only include CPack for the main project and not for subprojects
endif(${PROJECT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>dng</string>
<key>CFBundleName</key>
<string>DNG</string>
<key>CFBundleDisplayName</key>
<string>DNG</string>
<key>CFBundleHelpBookFolder</key>
<string>OpenStructure Manual</string>
<key>CFBundleHelpBookName</key>
<string>OpenStructure Help</string>
<key>CFBundleIconFile</key>
<string>DNG.icns</string>
<key>CFBundleIdentifier</key>
<string>org.openstructure.OpenStructure</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string></string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment