Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart-Steensma authored and BartSte committed Jan 4, 2024
1 parent 1696d21 commit 306bb3f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ project(
LANGUAGES CXX)

option(BUILD_TESTS "Build tests" OFF)
option(BUILD_SHARED_LIBS "Build using shared libraries is turned off" OFF)

message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Build tests: ${BUILD_TESTS}")

set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,5 +381,10 @@ more information.
# TODO:

- [ ] Add pre built binaries to the github releases
- For static build I used the followig configure command:
```
./configure -static -prefix /home/barts/code/snapshot/3rdparty/Qt/ -submodules qtbase,qtmultimedia,qtwayland -icu
```

- [ ] Add an uninstall target?
- [ ] Cross compile for raspberry pi
6 changes: 6 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
add_executable(snapshot main.cpp ${CMAKE_SOURCE_DIR}/resources/resources.qrc)
target_link_libraries(snapshot PRIVATE snapshotapp)
install(TARGETS snapshot DESTINATION bin)

set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_GENERATOR "ZIP")

include(CPack)
24 changes: 9 additions & 15 deletions scripts/install-qt
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail

usage="Usage: $0
usage="Usage: $0 <optional packages>
Installs Qt 6.6.1 to 3rdparty/Qt. For this script to work, you need to set the
QT_INSTALLER_JWT_TOKEN environment variable to your jwt token. Check the
website of Qt for more information.
Optionally, you can add more Qt packages to install by adding them as
arguments.
Options:
-h, --help Show this help message and exit"

while [[ $# -gt 0 ]]; do
case "$1" in
-h | --help)
echo "$usage"
exit 0
;;
*)
echo "Unknown option: $1"
echo "$usage"
exit 1
;;
esac
done
if [[ "$*" == *-h* ]] || [[ "$*" == *--help* ]]; then
echo "$usage"
exit 0
fi

tmp_dir=$(mktemp -d)
this_dir=$(dirname "$(realpath "${BASH_SOURCE:-$0}")")
Expand All @@ -32,6 +26,6 @@ multimedia="qt.qt6.661.addons.qtmultimedia"

curl "https://d13lb3tujbc8s0.cloudfront.net/onlineinstallers/qt-unified-linux-x64-4.6.1-online.run" -o "$tmp_dir/qt-installer.run"
chmod +x "$tmp_dir/qt-installer.run"
"$tmp_dir/qt-installer.run" --root "$install_dir" --accept-licenses --accept-obligations --default-answer --confirm-command install $base $multimedia
"$tmp_dir/qt-installer.run" --root "$install_dir" --accept-licenses --accept-obligations --default-answer --confirm-command install $base $multimedia $@

rm -rf "$tmp_dir"
9 changes: 6 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/3rdparty/Qt/6.6.1/gcc_64/lib/cmake)
list(APPEND CMAKE_PREFIX_PATH
${CMAKE_SOURCE_DIR}/3rdparty/Qt/6.6.1/gcc_64/lib/cmake)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/3rdparty/Qt/lib/cmake)

set(Boost_USE_STATIC_LIBS ON)
find_package(spdlog REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)
find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia MultimediaWidgets)
Expand All @@ -12,9 +15,9 @@ file(GLOB_RECURSE INCLUDES "${CMAKE_SOURCE_DIR}/include/*")
add_library(snapshotapp ${SOURCES} ${INCLUDES})
target_include_directories(
snapshotapp
PUBLIC ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/3rdparty/include ${Boost_INCLUDE_DIRS}
PUBLIC ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/3rdparty/include
${Boost_INCLUDE_DIRS}
INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/snapshotapp_autogen/include)
target_link_libraries(
snapshotapp PUBLIC spdlog::spdlog_header_only Qt6::Widgets Qt6::Multimedia
Qt6::MultimediaWidgets Boost::filesystem)
install(TARGETS snapshotapp DESTINATION lib)

0 comments on commit 306bb3f

Please sign in to comment.