Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ImageINSA_Tanguy
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
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tanguy.Raufflet
ImageINSA_Tanguy
Commits
b888fb31
Commit
b888fb31
authored
10 years ago
by
Antoine Lorence
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] Improve deployment on Windows platforms
parent
ed24a7ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+19
-41
19 additions, 41 deletions
CMakeLists.txt
app/CMakeLists.txt
+2
-2
2 additions, 2 deletions
app/CMakeLists.txt
with
21 additions
and
43 deletions
CMakeLists.txt
+
19
−
41
View file @
b888fb31
...
...
@@ -19,8 +19,8 @@ find_package(Qt5PrintSupport)
# We want to generate everything in the right target folder, for easier deployment
set
(
DEPLOY_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/eiimage CACHE PATH
"The folder to use for deployment."
FORCE
)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${
DEPLOY_OUTPUT_DIRECTORY
}
)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
DEPLOY_OUTPUT_DIRECTORY
}
)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${
DEPLOY_OUTPUT_DIRECTORY
}
/lib
)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
DEPLOY_OUTPUT_DIRECTORY
}
/lib
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
DEPLOY_OUTPUT_DIRECTORY
}
)
# Find RandomLib, which must be built and installed before running this compilation
...
...
@@ -71,63 +71,41 @@ include_directories(core)
add_subdirectory
(
plugins
)
add_subdirectory
(
app
)
# Deploy all needed dynamic libraries
if
(
WIN32
)
get_target_property
(
Qt5Core Qt5::Core LOCATION
)
file
(
COPY
${
Qt5Core
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
get_target_property
(
Qt5Gui Qt5::Gui LOCATION
)
file
(
COPY
${
Qt5Gui
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
get_target_property
(
Qt5Widgets Qt5::Widgets LOCATION
)
file
(
COPY
${
Qt5Widgets
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
get_target_property
(
Qt5Xml Qt5::Xml LOCATION
)
file
(
COPY
${
Qt5Xml
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
get_target_property
(
Qt5Script Qt5::Script LOCATION
)
file
(
COPY
${
Qt5Script
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
get_target_property
(
Qt5Print Qt5::PrintSupport LOCATION
)
file
(
COPY
${
Qt5Print
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
get_target_property
(
Qt5Opengl Qt5::OpenGL LOCATION
)
file
(
COPY
${
Qt5Opengl
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
get_target_property
(
Qt5Svg Qt5::Svg LOCATION
)
file
(
COPY
${
Qt5Svg
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
get_filename_component
(
QT_DIR
${
Qt5Core
}
DIRECTORY
)
# Copy icuuc, icudt & icuin**.dll files
file
(
GLOB ICUS
"
${
QT_DIR
}
/icu*.dll"
)
foreach
(
__FILE
${
ICUS
}
)
file
(
COPY
${
__FILE
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
endforeach
()
# Copy MinGW dependencies
file
(
GLOB GCCS
"
${
QT_DIR
}
/*gcc_s*.dll"
)
foreach
(
__FILE
${
GCCS
}
)
file
(
COPY
${
__FILE
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
endforeach
()
file
(
GLOB GCCS
"
${
QT_DIR
}
/*stdc++*.dll"
)
foreach
(
__FILE
${
GCCS
}
)
file
(
COPY
${
__FILE
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
endforeach
()
file
(
GLOB THREADS
"
${
QT_DIR
}
/*winpthread*.dll"
)
foreach
(
__FILE
${
THREADS
}
)
file
(
COPY
${
__FILE
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
endforeach
()
# libRandom.dll
get_target_property
(
RandomLocation RandomLib IMPORTED_LOCATION_RELEASE
)
file
(
COPY
${
RandomLocation
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
# Qwt.dll
get_filename_component
(
QWT_LIB_DIR
${
QWT_LIBRARY
}
DIRECTORY
)
file
(
GLOB QWT_SHARED_LIBS
"
${
QWT_LIB_DIR
}
/*.dll"
)
foreach
(
__FILE
${
QWT_SHARED_LIBS
}
)
file
(
COPY
${
__FILE
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
endforeach
()
# Jpeg and png dlls
get_filename_component
(
JPEG_LIB_DIR
${
JPEG_LIBRARY
}
DIRECTORY
)
file
(
GLOB JPEG_SHARED_LIBS
"
${
JPEG_LIB_DIR
}
/../bin/*.dll"
)
foreach
(
__FILE
${
JPEG_SHARED_LIBS
}
)
file
(
COPY
${
__FILE
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
endforeach
()
get_filename_component
(
PNG_LIB_DIR
${
PNG_LIBRARY
}
DIRECTORY
)
file
(
GLOB PNG_SHARED_LIBS
"
${
PNG_LIB_DIR
}
/../bin/*.dll"
)
foreach
(
__FILE
${
PNG_SHARED_LIBS
}
)
file
(
COPY
${
__FILE
}
DESTINATION
${
DEPLOY_OUTPUT_DIRECTORY
}
)
endforeach
()
# Qt and compiler dll
if
(
CMAKE_BUILD_TYPE MATCHES
"Release"
)
set
(
DEPLOY_FLAG
"--release"
)
else
()
set
(
DEPLOY_FLAG
"--debug"
)
endif
()
add_custom_target
(
WinQtDeploy ALL
windeployqt
${
DEPLOY_FLAG
}
${
DEPLOY_OUTPUT_DIRECTORY
}
/qwt.dll
COMMAND windeployqt
${
DEPLOY_FLAG
}
${
DEPLOY_OUTPUT_DIRECTORY
}
/eiimage.exe
COMMENT
"Copy Qt & compiler DLL to the target directory"
)
add_dependencies
(
WinQtDeploy eiimage
)
endif
()
This diff is collapsed.
Click to expand it.
app/CMakeLists.txt
+
2
−
2
View file @
b888fb31
...
...
@@ -204,8 +204,8 @@ target_link_libraries(eiimage
ImageIn
)
add_custom_command
(
TARGET eiimage
COMMAND
POST_BUILD
${
CMAKE_COMMAND
}
-E make_directory
${
DEPLOY_OUTPUT_DIRECTORY
}
/lang
add_custom_command
(
TARGET eiimage POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
DEPLOY_OUTPUT_DIRECTORY
}
/lang
COMMENT
"Create directory
${
DEPLOY_OUTPUT_DIRECTORY
}
/lang"
)
foreach
(
__FILE
${
QM_FILES
}
)
add_custom_command
(
TARGET eiimage POST_BUILD
...
...
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
register
or
sign in
to comment