forked from mavlink/mavlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
136 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#set(CPACK_PACKAGE_EXECUTABLES | ||
#"MyExecutable" "My Executable" | ||
#) | ||
|
||
# generic settings | ||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}") | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "micro air vehicle message marshalling library") | ||
set(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR}) | ||
set(CPACK_PACKAGE_CONTACT ${PROJECT_CONTACT_EMAIL}) | ||
set(CPACK_PACKAGE_VERSION_MAJOR "${APPLICATION_VERSION_MAJOR}") | ||
set(CPACK_PACKAGE_VERSION_MINOR "${APPLICATION_VERSION_MINOR}") | ||
set(CPACK_PACKAGE_VERSION_PATCH "${APPLICATION_VERSION_PATCH}") | ||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${APPLICATION_VERSION}") | ||
set(CPACK_SET_DESTDIR TRUE) | ||
set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES} | ||
/.git/;/build/;~$;.*\\\\.bin$;.*\\\\.swp$) | ||
|
||
# os specific packaging | ||
if(WIN32) | ||
set(CPACK_INSTALL_PREFIX "") | ||
add_definitions(-D_WIN32_WINNT=0x0501) # target xp | ||
set(CPACK_GENERATOR "NSIS") | ||
set(CPACK_SOURCE_GENERATOR "ZIP") | ||
# 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) backslashes. | ||
|
||
set(CPACK_NSIS_INSTALLED_ICON_NAME "mavlink") | ||
set(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}-${APPLICATION_VERSION}") | ||
set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\github.com/mavlink/mavlink") | ||
set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\github.com/mavlink/mavlink") | ||
set(CPACK_NSIS_CONTACT ${PROJECT_CONTACT_EMAIL}) | ||
# ON means prompt to modify environmental variable | ||
set(CPACK_NSIS_MODIFY_PATH ON) | ||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README") | ||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") | ||
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/jsbsim-nsis.bmp") | ||
|
||
elseif(APPLE) | ||
option(WITH_OSXBUNDLE "Build an app Bundle vs a pkg" ON) | ||
set(CPACK_SOURCE_GENERATOR "TGZ") | ||
|
||
# mac requires all files to have a file extension set | ||
configure_file("${CMAKE_SOURCE_DIR}/COPYING" "${CMAKE_BINARY_DIR}/COPYING.txt" COPYONLY) | ||
configure_file("${CMAKE_SOURCE_DIR}/README" "${CMAKE_BINARY_DIR}/README.txt" COPYONLY) | ||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/COPYING.txt") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_BINARY_DIR}/README.txt") | ||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_BINARY_DIR}/README.txt") | ||
|
||
if (WITH_OSXBUNDLE) | ||
set(CPACK_GENERATOR "Bundle") | ||
set(CPACK_BUNDLE_NAME "${PROJECT_NAME}") | ||
set(CPACK_INSTALL_PREFIX "${CPACK_BUNDLE_NAME}.app/Contents") | ||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${APPLICATION_VERSION}-OSX") | ||
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/jsbsim-dmg.icns") | ||
set(MACOSX_BUNDLE_EXECUTABLE_NAME "jsbsim") | ||
set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_SOURCE_DIR}/cmake/macFind.sh") | ||
# generate plist | ||
include(MacroConfigureMacOSXBundlePlist) | ||
set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/cmake/jsbsim.icns") | ||
set(CPACK_COPYRIGHT "Copyright GPL v3") | ||
ConfigureMacOSXBundlePlist(${PROJECT_NAME} "" ${CPACK_BUNDLE_ICON} ${APPLICATION_VERSION} ${CPACK_COPYRIGHT}) | ||
configure_file("${CMAKE_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in" | ||
"${CMAKE_BINARY_DIR}/MacOSXBundleInfo.plist") | ||
set(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/MacOSXBundleInfo.plist") | ||
else() | ||
set(CPACK_GENERATOR "PackageMaker") | ||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${APPLICATION_VERSION}-Darwin") | ||
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/cmake/WELCOME.txt") | ||
endif() | ||
|
||
elseif(UNIX) | ||
set(CPACK_GENERATOR "DEB") | ||
set(CPACK_SOURCE_GENERATOR "ZIP") | ||
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README") | ||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") | ||
else() | ||
message(FATAL_ERROR "unknown operating system") | ||
endif() | ||
|
||
include(CPack) | ||
set(CMAKE_INSTALL_PREFIX "${CPACK_INSTALL_PREFIX}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Welcome to installation. This program will guide you through the installation of this software. | ||
|
||
Installing this software requires administrator access. If you do not have administrator access to this computer, we recommend downloading the bundle version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,20 @@ | ||
# global needed variables | ||
set(APPLICATION_NAME ${PROJECT_NAME}) | ||
set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}") | ||
|
||
# modules | ||
include(DefineCMakeDefaults) | ||
include(DefinePlatformDefaults) | ||
include(DefineCompilerFlags) | ||
include(DefineInstallationPaths) | ||
|
||
# disallow in-source build | ||
include(MacroEnsureOutOfSourceBuild) | ||
macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. | ||
Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.") | ||
|
||
# add macros | ||
include(ExternalProject) | ||
|
||
# settings | ||
option(DEV_MODE "Setup paths for developer testing." OFF) | ||
option(BUILD_SHARED_LIBS "Build shared libraries instead of static." OFF) | ||
|
||
if (NOT BUILD_SHARED_LIBS) | ||
set(BOOST_USE_STATIC_LIBS ON) | ||
if(WIN32) | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) | ||
else() | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) | ||
endif() | ||
endif() | ||
|
||
# built variables | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | ||
|
||
# set build type | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING | ||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." | ||
FORCE) | ||
endif(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) | ||
|
||
# add make dist target | ||
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) | ||
|
||
# external projects | ||
include(ExternalProject) | ||
if(NOT EP_BASE_DIR) | ||
set(EP_BASE_DIR "${CMAKE_BINARY_DIR}/CMakeExternals") | ||
endif() | ||
if(NOT EP_INSTALL_PREFIX) | ||
set(EP_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) | ||
endif() | ||
set_property(DIRECTORY PROPERTY EP_BASE ${EP_BASE_DIR}) | ||
|
||
# install/developer mode | ||
if(DEV_MODE) | ||
message(STATUS "configuring for in source build") | ||
set(DATADIR ${PROJECT_SOURCE_DIR}/data) | ||
set(LIBDIR ${CMAKE_BINARY_DIR}/lib) | ||
set(BINDIR ${CMAKE_BINARY_DIR}/bin) | ||
set(EP_DATADIR ${EP_BASE_DIR}/${EP_INSTALL_PREFIX}/share) | ||
else() | ||
message(STATUS "configuring for install build") | ||
set(DATADIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/data) | ||
set(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) | ||
set(BINDIR ${CMAKE_INSTALL_PREFIX}/bin) | ||
set(EP_DATADIR ${EP_INSTALL_PREFIX}/share) | ||
endif() | ||
set(EP_INCLUDEDIR ${EP_BASE_DIR}/${EP_INSTALL_PREFIX}/include) | ||
set(EP_LIBDIR ${EP_BASE_DIR}/${EP_INSTALL_PREFIX}/lib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,42 @@ | ||
if (WIN32) | ||
# Same same | ||
set(BIN_INSTALL_DIR "bin" CACHE PATH "-") | ||
set(SBIN_INSTALL_DIR "." CACHE PATH "-") | ||
set(LIB_INSTALL_DIR "lib" CACHE PATH "-") | ||
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "-") | ||
set(PLUGIN_INSTALL_DIR "plugins" CACHE PATH "-") | ||
set(HTML_INSTALL_DIR "doc/HTML" CACHE PATH "-") | ||
set(ICON_INSTALL_DIR "." CACHE PATH "-") | ||
set(SOUND_INSTALL_DIR "." CACHE PATH "-") | ||
set(LOCALE_INSTALL_DIR "lang" CACHE PATH "-") | ||
elseif (UNIX OR OS2) | ||
IF (NOT APPLICATION_NAME) | ||
MESSAGE(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME") | ||
SET(APPLICATION_NAME ${PROJECT_NAME}) | ||
ENDIF (NOT APPLICATION_NAME) | ||
# application name | ||
if (NOT APPLICATION_NAME) | ||
message(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME") | ||
set(APPLICATION_NAME ${PROJECT_NAME} INTERNAL) | ||
endif (NOT APPLICATION_NAME) | ||
|
||
# Suffix for Linux | ||
SET(LIB_SUFFIX | ||
CACHE STRING "Define suffix of directory name (32/64)" | ||
) | ||
# library settings | ||
set(INSTALL_LIB_SUFFIX CACHE STRING "Define suffix of directory name (32/64)") | ||
|
||
SET(EXEC_INSTALL_PREFIX | ||
"${CMAKE_INSTALL_PREFIX}" | ||
CACHE PATH "Base directory for executables and libraries" | ||
) | ||
SET(SHARE_INSTALL_PREFIX | ||
"${CMAKE_INSTALL_PREFIX}/share" | ||
CACHE PATH "Base directory for files which go to share/" | ||
) | ||
SET(DATA_INSTALL_PREFIX | ||
"${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}" | ||
CACHE PATH "The parent directory where applications can install their data") | ||
if (NOT CPACK_INSTALL_PREFIX) | ||
set(CPACK_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) | ||
endif() | ||
|
||
# The following are directories where stuff will be installed to | ||
SET(BIN_INSTALL_DIR | ||
"${EXEC_INSTALL_PREFIX}/bin" | ||
CACHE PATH "The ${APPLICATION_NAME} binary install dir (default prefix/bin)" | ||
) | ||
SET(SBIN_INSTALL_DIR | ||
"${EXEC_INSTALL_PREFIX}/sbin" | ||
CACHE PATH "The ${APPLICATION_NAME} sbin install dir (default prefix/sbin)" | ||
) | ||
SET(LIB_INSTALL_DIR | ||
"${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" | ||
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)" | ||
) | ||
SET(LIBEXEC_INSTALL_DIR | ||
"${EXEC_INSTALL_PREFIX}/libexec" | ||
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)" | ||
) | ||
SET(PLUGIN_INSTALL_DIR | ||
"${LIB_INSTALL_DIR}/${APPLICATION_NAME}" | ||
CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is prefix/lib/${APPLICATION_NAME})" | ||
) | ||
SET(INCLUDE_INSTALL_DIR | ||
"${CMAKE_INSTALL_PREFIX}/include" | ||
CACHE PATH "The subdirectory to the header prefix (default prefix/include)" | ||
) | ||
# install prefixes | ||
if (APPLE AND (CPACK_GENERATOR STREQUAL "Bundle")) | ||
set(CPACK_GENERATOR_PREFIX "/Applications/${APPLICATION_NAME}.app/") | ||
elseif(WIN32) | ||
set(CPACK_GENERATOR_PREFIX "C:/Program Files/${APPLICATION_NAME}-${APPLICATION_VERSION}/") | ||
else() | ||
set(CPACK_GENERATOR_PREFIX "") | ||
endif() | ||
set(INSTALL_EXEC_PREFIX "${CPACK_GENERATOR_PREFIX}/${CPACK_INSTALL_PREFIX}" CACHE PATH "Base directory for executables and libraries") | ||
set(INSTALL_SHARE_PREFIX "${CPACK_GENERATOR_PREFIX}/${CPACK_INSTALL_PREFIX}/share" CACHE PATH "Base directory for files which go to share/") | ||
set(INSTALL_DATA_PREFIX "${INSTALL_SHARE_PREFIX}/${APPLICATION_NAME}" CACHE PATH "The parent directory where applications can install their data") | ||
|
||
SET(DATA_INSTALL_DIR | ||
"${DATA_INSTALL_PREFIX}" | ||
CACHE PATH "The parent directory where applications can install their data (default prefix/share/${APPLICATION_NAME})" | ||
) | ||
SET(HTML_INSTALL_DIR | ||
"${DATA_INSTALL_PREFIX}/doc/HTML" | ||
CACHE PATH "The HTML install dir for documentation (default data/doc/html)" | ||
) | ||
SET(ICON_INSTALL_DIR | ||
"${DATA_INSTALL_PREFIX}/icons" | ||
CACHE PATH "The icon install dir (default data/icons/)" | ||
) | ||
SET(SOUND_INSTALL_DIR | ||
"${DATA_INSTALL_PREFIX}/sounds" | ||
CACHE PATH "The install dir for sound files (default data/sounds)" | ||
) | ||
|
||
SET(LOCALE_INSTALL_DIR | ||
"${SHARE_INSTALL_PREFIX}/locale" | ||
CACHE PATH "The install dir for translations (default prefix/share/locale)" | ||
) | ||
|
||
SET(XDG_APPS_DIR | ||
"${SHARE_INSTALL_PREFIX}/applications/" | ||
CACHE PATH "The XDG apps dir" | ||
) | ||
SET(XDG_DIRECTORY_DIR | ||
"${SHARE_INSTALL_PREFIX}/desktop-directories" | ||
CACHE PATH "The XDG directory" | ||
) | ||
|
||
SET(SYSCONF_INSTALL_DIR | ||
"${EXEC_INSTALL_PREFIX}/etc" | ||
CACHE PATH "The ${APPLICATION_NAME} sysconfig install dir (default prefix/etc)" | ||
) | ||
SET(MAN_INSTALL_DIR | ||
"${SHARE_INSTALL_PREFIX}/man" | ||
CACHE PATH "The ${APPLICATION_NAME} man install dir (default prefix/man)" | ||
) | ||
SET(INFO_INSTALL_DIR | ||
"${SHARE_INSTALL_PREFIX}/info" | ||
CACHE PATH "The ${APPLICATION_NAME} info install dir (default prefix/info)" | ||
) | ||
endif () | ||
# The following are directories where stuff will be installed to | ||
set(INSTALL_BIN_DIR "${INSTALL_EXEC_PREFIX}/bin" CACHE PATH "The ${APPLICATION_NAME} binary install dir (default prefix/bin)") | ||
set(INSTALL_SBIN_DIR "${INSTALL_EXEC_PREFIX}/sbin" CACHE PATH "The ${APPLICATION_NAME} sbin install dir (default prefix/sbin)") | ||
set(INSTALL_LIB_DIR "${INSTALL_EXEC_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)") | ||
set(INSTALL_LIBEXEC_DIR "${INSTALL_EXEC_PREFIX}/libexec" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)") | ||
set(INSTALL_PLUGIN_DIR "${INSTALL_LIB_DIR}/${APPLICATION_NAME}" CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is prefix/lib/${APPLICATION_NAME})") | ||
set(INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The subdirectory to the header prefix (default prefix/include)") | ||
set(INSTALL_DATA_DIR "${INSTALL_DATA_PREFIX}" CACHE PATH "The parent directory where applications can install their data (default prefix/share/${APPLICATION_NAME})") | ||
set(INSTALL_HTML_DIR "${INSTALL_DATA_PREFIX}/doc/HTML" CACHE PATH "The HTML install dir for documentation (default data/doc/html)") | ||
set(INSTALL_ICON_DIR "${INSTALL_DATA_PREFIX}/icons" CACHE PATH "The icon install dir (default data/icons/)") | ||
set(INSTALL_SOUND_DIR "${INSTALL_DATA_PREFIX}/sounds" CACHE PATH "The install dir for sound files (default data/sounds)") | ||
set(INSTALL_LOCALE_DIR "${INSTALL_SHARE_PREFIX}/locale" CACHE PATH "The install dir for translations (default prefix/share/locale)") | ||
set(INSTALL_XDG_APPS_DIR "${INSTALL_SHARE_PREFIX}/applications/" CACHE PATH "The XDG apps dir") | ||
set(INSTALL_XDG_DIRECTORY_DIR "${INSTALL_SHARE_PREFIX}/desktop-directories" CACHE PATH "The XDG directory") | ||
set(INSTALL_SYSCONF_DIR "${INSTALL_EXEC_PREFIX}/etc" CACHE PATH "The ${APPLICATION_NAME} sysconfig install dir (default prefix/etc)") | ||
set(INSTALL_MAN_DIR "${INSTALL_SHARE_PREFIX}/man" CACHE PATH "The ${APPLICATION_NAME} man install dir (default prefix/man)") | ||
set(INSTALL_INFO_DIR "${INSTALL_SHARE_PREFIX}/info" CACHE PATH "The ${APPLICATION_NAME} info install dir (default prefix/info)") |