Moved CMake files to cmake dir
This commit is contained in:
31
cmake/Installing.cmake
Normal file
31
cmake/Installing.cmake
Normal file
@@ -0,0 +1,31 @@
|
||||
# Installation configuration
|
||||
#
|
||||
# When running the Install step, we don't actually install Bloom on the user's machine. We install it in a release
|
||||
# directory, to be used for packaging.
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/release/")
|
||||
|
||||
install(TARGETS Bloom DESTINATION bin PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
|
||||
|
||||
install(
|
||||
DIRECTORY build/bin/plugins
|
||||
DESTINATION "bin"
|
||||
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY build/bin/platforms
|
||||
DESTINATION "bin"
|
||||
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY build/resources
|
||||
DESTINATION "."
|
||||
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY build/bin/lib
|
||||
DESTINATION "bin"
|
||||
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
)
|
||||
46
cmake/PackageGeneratorConfig.cmake
Normal file
46
cmake/PackageGeneratorConfig.cmake
Normal file
@@ -0,0 +1,46 @@
|
||||
if (CPACK_GENERATOR MATCHES "DEB")
|
||||
# For Debian packages, we have to specify our own dependency list. We can't use the automatic dependency generator
|
||||
# because CPack doesn't allow us to exclude dependencies that are shipped with Bloom. CPack uses dpkg-shlibdeps to
|
||||
# generate the dependencies, and there appears to be a -x option to exclude certain packages, but CPack doesn't
|
||||
# yet support this.
|
||||
|
||||
# This list could probably be reduced. It was generated by CPack (via dpkg-shlibdeps)
|
||||
string(
|
||||
CONCAT
|
||||
CPACK_DEBIAN_PACKAGE_DEPENDS
|
||||
"libc6 (>= 2.18), "
|
||||
"libfontconfig1 (>= 2.11.94), "
|
||||
"libfreetype6 (>= 2.6), "
|
||||
"libgcc1 (>= 1:4.2), "
|
||||
"libgl1-mesa-glx | libgl1, "
|
||||
"libstdc++6 (>= 5), "
|
||||
"libudev1 (>= 183), "
|
||||
"libx11-6, "
|
||||
"libx11-xcb1, "
|
||||
"libxcb-icccm4 (>= 0.4.1), "
|
||||
"libxcb-image0 (>= 0.2.1), "
|
||||
"libxcb-keysyms1 (>= 0.4.0), "
|
||||
"libxcb-render-util0, "
|
||||
"libxext6, "
|
||||
"libxkbcommon-x11-0 (>= 0.5.0), "
|
||||
"libxkbcommon0 (>= 0.5.0), "
|
||||
"libxrender1, "
|
||||
"zlib1g (>= 1:1.1.4)"
|
||||
)
|
||||
|
||||
set(
|
||||
CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/resources/packaging/postinst;
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/resources/packaging/postrm
|
||||
)
|
||||
|
||||
elseif (CPACK_GENERATOR MATCHES "RPM")
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "LGPLv3+")
|
||||
set(CPACK_RPM_PACKAGE_GROUP "Development/Debuggers")
|
||||
|
||||
set(CPACK_RPM_PACKAGE_AUTOREQ ON)
|
||||
set(CPACK_RPM_REQUIRES_EXCLUDE_FROM "bin/lib/")
|
||||
|
||||
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/resources/packaging/postinst)
|
||||
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/resources/packaging/postrm)
|
||||
endif()
|
||||
56
cmake/Packaging.cmake
Normal file
56
cmake/Packaging.cmake
Normal file
@@ -0,0 +1,56 @@
|
||||
# This file contains the CPack configuration for packaging Bloom. Bloom is currently packaged in Debian, RPM and
|
||||
# PKGBUILD packages. Because CPack doesn't support PKGBUILD packages, we have to build those separately. But we still
|
||||
# use CMake & CPack configuration to generate our PKGBUILD file. See below for more.
|
||||
#
|
||||
# To package Bloom, simply run CPack & makepkg from the CMake build directory:
|
||||
#
|
||||
# $ cd build/cmake-build-release/
|
||||
# $ cpack
|
||||
# $ makepkg
|
||||
#
|
||||
# CPack's -G option can be used to specify a particular generator:
|
||||
# $ cpack -G DEB
|
||||
#
|
||||
# If no generator has been specified, CPack will generate packages for all configured generators (see CPACK_GENERATOR
|
||||
# below).
|
||||
#
|
||||
# The makepkg command builds the PKGBUILD package. It uses the generated PKGBUILD file, which is generated from
|
||||
# resources/packaging/PKGBUILD.template.in. See the configure_file() invocations below.
|
||||
#
|
||||
# NOTE: The above commands assume Bloom has been built in 'release' mode, and the install target has been run.
|
||||
|
||||
configure_file(
|
||||
"${PROJECT_SOURCE_DIR}/cmake/PackageGeneratorConfig.cmake"
|
||||
"${PROJECT_BINARY_DIR}/PackageGeneratorConfig.cmake"
|
||||
)
|
||||
|
||||
set(CPACK_GENERATOR "DEB;RPM")
|
||||
set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/PackageGeneratorConfig.cmake")
|
||||
|
||||
set(CPACK_PACKAGE_NAME "Bloom")
|
||||
string(TOLOWER ${CPACK_PACKAGE_NAME} CPACK_PACKAGE_NAME_LOWER)
|
||||
|
||||
set(
|
||||
CPACK_PACKAGE_DESCRIPTION_SUMMARY
|
||||
"Debugger for AVR-based embedded systems"
|
||||
)
|
||||
|
||||
set(CPACK_PACKAGE_CONTACT "Nav Mohammed <support@bloom.oscillate.io>")
|
||||
|
||||
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/bloom")
|
||||
|
||||
# Generate the PKGBUILD and bloom.install file in the CMake build directory.
|
||||
configure_file(
|
||||
"${PROJECT_SOURCE_DIR}/resources/packaging/PKGBUILD.template.in"
|
||||
"${PROJECT_BINARY_DIR}/PKGBUILD"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
configure_file(
|
||||
"${PROJECT_SOURCE_DIR}/resources/packaging/bloom.install.template.in"
|
||||
"${PROJECT_BINARY_DIR}/bloom.install"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
include(CPack)
|
||||
Reference in New Issue
Block a user