Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qml_example
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Craig Scott
qml_example
Commits
28b29af6
Commit
28b29af6
authored
Oct 28, 2021
by
Craig Scott
Browse files
Options
Downloads
Patches
Plain Diff
Runs and installs on Windows
parent
27287f51
Branches
master
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+39
-10
39 additions, 10 deletions
CMakeLists.txt
with
39 additions
and
10 deletions
CMakeLists.txt
+
39
−
10
View file @
28b29af6
...
...
@@ -9,9 +9,11 @@ if(APPLE)
# the directory layout relative to the application binary.
set
(
CMAKE_INSTALL_RPATH @executable_path/../Frameworks
)
# This makes deployment easier
set
(
QT_QML_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/qml
)
else
()
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CMAKE_INSTALL_BINDIR
}
)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CMAKE_INSTALL_LIBDIR
}
)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CMAKE_INSTALL_LIBDIR
}
)
file
(
RELATIVE_PATH relDir
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CMAKE_INSTALL_BINDIR
}
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
CMAKE_INSTALL_LIBDIR
}
...
...
@@ -19,11 +21,13 @@ else()
set
(
CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/
${
relDir
}
)
endif
()
# This makes deployment easier on some platforms
set
(
QT_QML_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/qml
)
find_package
(
Qt6 REQUIRED COMPONENTS Core Quick
)
set
(
CMAKE_AUTOMOC ON
)
add_subdirectory
(
Shapes/EllipseShape
)
qt_add_executable
(
application MACOSX_BUNDLE WIN32 main.cpp
)
...
...
@@ -96,14 +100,39 @@ if(APPLE)
install
(
TARGETS application DESTINATION .
)
install
(
SCRIPT
${
CMAKE_CURRENT_BINARY_DIR
}
/deployapp.cmake
)
elseif
(
WIN32
)
# NOTE: Due to limitations of windeployqt, we can't use CMake's standard
# install layout. In particular, it doesn't provide an option for
# specifying where to put the QML modules. Deviating from the default
# layout windeployqt wants to use therefore results in a broken app.
# Can't use standard bin destination
install
(
TARGETS application ellipseShape DESTINATION .
)
# Install the app target and let windeployqt do the rest
find_program
(
DEPLOYQT_EXECUTABLE windeployqt
)
#set(DEPLOY_APP bin/application.exe) # Would prefer this, but can't
set
(
DEPLOY_APP application.exe
)
set
(
DEPLOY_OPTIONS
#--dir . # We would like to use these, but can't
#--libdir bin #
#--plugindir plugins #
--force
--qmldir=
${
QT_QML_OUTPUT_DIRECTORY
}
--qmlimport=
${
QT_QML_OUTPUT_DIRECTORY
}
# --verbose=2
)
list
(
JOIN DEPLOY_OPTIONS
" "
DEPLOY_OPTIONS
)
# convert to space-separated string
configure_file
(
deployapp.cmake.in deployapp.cmake @ONLY
)
install
(
SCRIPT
${
CMAKE_CURRENT_BINARY_DIR
}
/deployapp.cmake
)
else
()
if
(
NOT WIN32
)
# NOTE: We don't try to install Qt's own libraries or plugins, we are
# assuming they will be provided by the OS.
# assuming they will be provided by the OS. Since there is no deploy
# tool, we are responsible for installing everything.
set_target_properties
(
ellipseShapeplugin PROPERTIES
INSTALL_RPATH $ORIGIN/../../../
${
CMAKE_INSTALL_LIBDIR
}
)
endif
()
install
(
TARGETS application ellipseShape
)
install
(
TARGETS ellipseShapeplugin
DESTINATION qml/Shapes/EllipseShape
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment