Moved distributed files to build/distributed and stop placing the binary in build/bin (have binned that directory).

Also updated installation rules
This commit is contained in:
Nav
2023-01-15 21:20:09 +00:00
parent 269af2d5fc
commit 0b19de8afa
83 changed files with 56 additions and 57 deletions

View File

@@ -9,8 +9,7 @@ set(CMAKE_CXX_STANDARD 20)
set(ENABLE_SANITIZERS off) set(ENABLE_SANITIZERS off)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(AUTOGEN_BUILD_DIR ../build/) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/bin")
find_package(yaml-cpp 0.7.0 REQUIRED) find_package(yaml-cpp 0.7.0 REQUIRED)
find_package(Qt6Core REQUIRED) find_package(Qt6Core REQUIRED)
@@ -22,15 +21,9 @@ find_package(Qt6UiTools REQUIRED)
find_package(Qt6SvgWidgets REQUIRED) find_package(Qt6SvgWidgets REQUIRED)
find_package(Qt6Network REQUIRED) find_package(Qt6Network REQUIRED)
# Bloom is distributed with some third-party dependencies (in the form of shared objects). These dependencies are
# distributed with Bloom for various reasons (licensing, availability in some package managers, etc).
#
# The shared objects are located in bin/lib (relative to Bloom's installation directory). For this reason, we instruct
# the dynamic linker to look for any of Bloom's shared object dependencies in that location first. We do this by
# including '$ORIGIN/lib' in the RPATH of Bloom's binary executable.
set(CMAKE_SKIP_BUILD_RPATH false) set(CMAKE_SKIP_BUILD_RPATH false)
set(CMAKE_BUILD_RPATH_USE_ORIGIN true) set(CMAKE_BUILD_RPATH_USE_ORIGIN true)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/lib:/usr/local/lib") set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:/usr/local/lib")
set(CMAKE_BUILD_RPATH ${CMAKE_INSTALL_RPATH}) set(CMAKE_BUILD_RPATH ${CMAKE_INSTALL_RPATH})
add_compile_definitions(BLOOM_VERSION="${CMAKE_PROJECT_VERSION}") add_compile_definitions(BLOOM_VERSION="${CMAKE_PROJECT_VERSION}")
@@ -172,25 +165,7 @@ add_custom_command(
${CMAKE_CURRENT_SOURCE_DIR}/build/scripts/Avr8TargetDescriptionFiles.php ${CMAKE_CURRENT_SOURCE_DIR}/build/scripts/Avr8TargetDescriptionFiles.php
COMMAND echo 'Processing AVR target description files.' COMMAND echo 'Processing AVR target description files.'
COMMAND COMMAND
php ${CMAKE_CURRENT_SOURCE_DIR}/build/scripts/Avr8TargetDescriptionFiles.php php ${CMAKE_CURRENT_SOURCE_DIR}/build/scripts/Avr8TargetDescriptionFiles.php ${CMAKE_BINARY_DIR}
)
# Copy resources/fonts into build/resources/Fonts
add_custom_command(
TARGET Bloom
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/resources/fonts
${CMAKE_CURRENT_SOURCE_DIR}/build/resources/Fonts
)
# Copy resources/udevrules/99-bloom.rules to build/resources/UDevRules/99-bloom.rules
add_custom_command(
TARGET Bloom
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/resources/udevrules/99-bloom.rules
${CMAKE_CURRENT_SOURCE_DIR}/build/resources/UDevRules/99-bloom.rules
) )
include(./cmake/Installing.cmake) include(./cmake/Installing.cmake)

View File

@@ -9,11 +9,17 @@
namespace Bloom\BuildScripts; namespace Bloom\BuildScripts;
$buildPath = $argv[1] ?? null;
if (empty($buildPath)) {
print "Missing build path. Aborting\n";
die;
}
require_once __DIR__ . "/TargetDescriptionFiles/Factory.php"; require_once __DIR__ . "/TargetDescriptionFiles/Factory.php";
CONST AVR_TDF_DEST_FILE_PATH = __DIR__ . "/../resources/TargetDescriptionFiles/AVR"; define("AVR_TDF_DEST_FILE_PATH", $buildPath . "/resources/TargetDescriptionFiles/AVR");
CONST AVR_TDF_DEST_RELATIVE_FILE_PATH = "../resources/TargetDescriptionFiles/AVR"; define("AVR_TDF_DEST_RELATIVE_FILE_PATH", "../resources/TargetDescriptionFiles/AVR");
CONST AVR_TDF_MAPPING_FILE_PATH = AVR_TDF_DEST_FILE_PATH . "/Mapping.json"; define("AVR_TDF_MAPPING_FILE_PATH", AVR_TDF_DEST_FILE_PATH . "/Mapping.json");
// Empty destination directory // Empty destination directory
if (file_exists(AVR_TDF_DEST_FILE_PATH)) { if (file_exists(AVR_TDF_DEST_FILE_PATH)) {
@@ -43,19 +49,19 @@ foreach ($avrTdfs as $avrTdf) {
$id = strtolower($strippedTargetName); $id = strtolower($strippedTargetName);
if (in_array($id, $processedTargetIds)) { if (in_array($id, $processedTargetIds)) {
print "\033[31m" . PHP_EOL; print "\033[31m" . "\n";
print "FATAL ERROR: duplicate AVR8 target ID detected: " . $id . PHP_EOL . PHP_EOL print "FATAL ERROR: duplicate AVR8 target ID detected: " . $id . "\n\n"
. "TDF Path: " . realpath($avrTdf->filePath); . "TDF Path: " . realpath($avrTdf->filePath);
print "\033[0m" . PHP_EOL; print "\033[0m" . "\n";
exit(1); exit(1);
} }
if (!empty(($validationFailures = $avrTdf->validate()))) { if (!empty(($validationFailures = $avrTdf->validate()))) {
print "\033[31m" . PHP_EOL; print "\033[31m" . "\n";
print "FATAL ERROR: AVR8 TDF failed validation - failure reasons:" . PHP_EOL print "FATAL ERROR: AVR8 TDF failed validation - failure reasons:" . "\n"
. implode(PHP_EOL, $validationFailures) . PHP_EOL . PHP_EOL . "TDF Path: " . implode("\n", $validationFailures) . "\n\n" . "TDF Path: "
. realpath($avrTdf->filePath); . realpath($avrTdf->filePath);
print "\033[0m" . PHP_EOL; print "\033[0m" . "\n";
exit(1); exit(1);
} }

View File

@@ -1,31 +1,49 @@
# Installation configuration # 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) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/opt/bloom" CACHE PATH "..." FORCE)
endif()
install( install(
DIRECTORY build/bin/plugins TARGETS Bloom
DESTINATION "bin" DESTINATION "bin"
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ PERMISSIONS
OWNER_EXECUTE OWNER_READ OWNER_WRITE
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
) )
install( install(
DIRECTORY build/bin/platforms DIRECTORY ${CMAKE_BINARY_DIR}/resources
DESTINATION "bin"
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
)
install(
DIRECTORY build/resources
DESTINATION "." DESTINATION "."
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DIRECTORY_PERMISSIONS
OWNER_EXECUTE OWNER_READ OWNER_WRITE
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
FILE_PERMISSIONS
OWNER_EXECUTE OWNER_READ OWNER_WRITE
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
) )
install( install(
DIRECTORY build/bin/lib DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/distributed/fonts
DESTINATION "bin" DESTINATION "resources"
DIRECTORY_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DIRECTORY_PERMISSIONS
OWNER_EXECUTE OWNER_READ OWNER_WRITE
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
FILE_PERMISSIONS
OWNER_READ OWNER_WRITE
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/build/distributed/udevrules/99-bloom.rules
DESTINATION "/usr/lib/udev/rules.d/"
PERMISSIONS
OWNER_READ OWNER_WRITE
GROUP_READ
WORLD_READ
) )

View File

@@ -39,7 +39,7 @@ namespace Bloom
( (
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true), QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true),
#ifndef BLOOM_DEBUG_BUILD #ifndef BLOOM_DEBUG_BUILD
QCoreApplication::addLibraryPath(QString::fromStdString(Paths::applicationDirPath() + "/plugins")), QCoreApplication::addLibraryPath(QString::fromStdString(Paths::applicationDirPath() + "/../plugins")),
#endif #endif
QApplication(this->qtApplicationArgc, this->qtApplicationArgv.data()) QApplication(this->qtApplicationArgc, this->qtApplicationArgv.data())
) )