forked from INPE-EM/inpeem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bd3c1e
commit 03850c5
Showing
11 changed files
with
306 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,70 @@ | ||
include(BundleUtilities) | ||
|
||
set(INPEEM_APP_PATH ${CMAKE_INSTALL_PREFIX}/@PROJECT_NAME@.exe) | ||
file(GLOB INPEEM_LIBS ${CMAKE_INSTALL_PREFIX}/*@CMAKE_SHARED_LIBRARY_SUFFIX@) | ||
set(INPEEM_PATHS ${CMAKE_INSTALL_PREFIX};@Qt5_DIR@/../../../bin) | ||
if(WIN32) | ||
set(INPEEM_APP_PATH ${CMAKE_INSTALL_PREFIX}/@PROJECT_NAME@.exe) | ||
file(GLOB INPEEM_LIBS ${CMAKE_INSTALL_PREFIX}/*@CMAKE_SHARED_LIBRARY_SUFFIX@) | ||
set(INPEEM_PATHS ${CMAKE_INSTALL_PREFIX};@Qt5_DIR@/../../../bin) | ||
elseif(APPLE) | ||
set(BU_CHMOD_BUNDLE_ITEMS ON) | ||
set(INPEEM_APP_PATH ${CMAKE_INSTALL_PREFIX}/@PROJECT_NAME@.app) | ||
set(INPEEM_QT_PLUGINS_ABSOLUTE_LOCATION ${CMAKE_INSTALL_PREFIX}/@INPEEM_QT_PLUGINS_LOCATION@) | ||
file(GLOB_RECURSE QT_PLUGINS "${INPEEM_QT_PLUGINS_ABSOLUTE_LOCATION}/*@CMAKE_SHARED_LIBRARY_SUFFIX@") | ||
set(INPEEM_LIBS ${INPEEM_LIBS} ${QT_PLUGINS}) | ||
#message("${QT_PLUGINS}---------------------${INPEEM_QT_PLUGINS_ABSOLUTE_LOCATION}") | ||
#exit() | ||
set(INPEEM_PATHS ${CMAKE_INSTALL_PREFIX};@Qt5_DIR@/../..) | ||
endif() | ||
|
||
if(APPLE) | ||
# Overload function | ||
function(gp_item_default_embedded_path item default_embedded_path_var) | ||
set(is_System FALSE) | ||
set(is_QImageFormat FALSE) | ||
set(is_QIconEngine FALSE) | ||
set(is_QSQLDrivers FALSE) | ||
set(is_QPlatforms FALSE) | ||
set(is_Lib FALSE) | ||
|
||
get_filename_component (resolved_file ${item} PATH) | ||
|
||
if("${resolved_file}" STREQUAL "") | ||
set (is_Lib TRUE) | ||
elseif(resolved_file MATCHES "^(@rpath)") | ||
set(is_Lib TRUE) | ||
elseif(resolved_file MATCHES "^(/System/Library/|/usr/lib|/usr/local|@loader_path)") | ||
set(is_System TRUE) | ||
elseif(resolved_file MATCHES "(imageformats)$") | ||
set (is_QImageFormat TRUE) | ||
elseif(resolved_file MATCHES "(iconengines)$") | ||
set (is_QIconEngine TRUE) | ||
elseif(resolved_file MATCHES "(sqldrivers)$") | ||
set (is_QSQLDrivers TRUE) | ||
elseif(resolved_file MATCHES "(platforms)$") | ||
set (is_QPlatforms TRUE) | ||
elseif(resolved_file MATCHES "(lib)$") | ||
set (is_Lib TRUE) | ||
endif() | ||
|
||
if(item MATCHES "\\.dylib$") | ||
if(is_System) | ||
set(${default_embedded_path_var} "@executable_path/../lib" PARENT_SCOPE) | ||
elseif(is_QImageFormat) | ||
set(${default_embedded_path_var} "@executable_path/../qtplugins/imageformats" PARENT_SCOPE) | ||
elseif(is_QIconEngine) | ||
set(${default_embedded_path_var} "@executable_path/../qtplugins/iconengines" PARENT_SCOPE) | ||
elseif(is_QSQLDrivers) | ||
set(${default_embedded_path_var} "@executable_path/../qtplugins/sqldrivers" PARENT_SCOPE) | ||
elseif(is_QPlatforms) | ||
set(${default_embedded_path_var} "@executable_path/../qtplugins/platforms" PARENT_SCOPE) | ||
elseif(is_Lib) | ||
set(${default_embedded_path_var} "@executable_path/../lib" PARENT_SCOPE) | ||
else() | ||
set(${default_embedded_path_var} "${resolved_file}" PARENT_SCOPE) | ||
endif() | ||
elseif(item MATCHES "[^/]+\\.framework/") | ||
set(${default_embedded_path_var} "@executable_path/../Frameworks" PARENT_SCOPE) | ||
endif() | ||
endfunction() | ||
endif() | ||
|
||
fixup_bundle(${INPEEM_APP_PATH} "${INPEEM_LIBS}" "${INPEEM_PATHS}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
MACRO(install_plugins plugins location) | ||
set(_files) | ||
|
||
foreach(plugin ${plugins}) | ||
get_target_property(_loc ${plugin} LOCATION) | ||
list(APPEND _files ${_loc}) | ||
endforeach() | ||
|
||
install(FILES ${_files} | ||
DESTINATION "${location}" | ||
CONFIGURATIONS Release | ||
COMPONENT runtime) | ||
ENDMACRO(install_plugins) | ||
|
||
MACRO(install_qt5_plugins location) | ||
find_package(Qt5 COMPONENTS Sql Svg PrintSupport) | ||
|
||
# Installing image plugins | ||
set(_plugins Qt5::QGifPlugin Qt5::QICOPlugin Qt5::QJpegPlugin Qt5::QSvgPlugin Qt5::QTiffPlugin) | ||
install_plugins("${_plugins}" "${location}/imageformats") | ||
|
||
# Installing svg plugins | ||
set(_plugins Qt5::QSvgPlugin Qt5::QSvgIconPlugin) | ||
install_plugins("${_plugins}" "${location}/iconengines") | ||
|
||
# Installing sql plugins | ||
set(_plugins Qt5::QSQLiteDriverPlugin) | ||
install_plugins("${_plugins}" "${location}/sqldrivers") | ||
|
||
# Installing printer support plugin | ||
if(WIN32) | ||
set(_plugins Qt5::QWindowsPrinterSupportPlugin) | ||
install_plugins("${_plugins}" "${location}/printsupport") | ||
endif() | ||
|
||
# Installing platform plugins | ||
if(WIN32) | ||
set(_plugins Qt5::QWindowsIntegrationPlugin Qt5::QMinimalIntegrationPlugin) | ||
install_plugins("${_plugins}" "platforms") | ||
elseif(APPLE) | ||
set(_plugins Qt5::QCocoaIntegrationPlugin Qt5::QMinimalIntegrationPlugin) | ||
install_plugins("${_plugins}" "${location}/platforms") | ||
endif() | ||
ENDMACRO(install_qt5_plugins) | ||
|
||
# | ||
# Macro installQtPlugins | ||
# | ||
# Description: Installs the required Qt plugins. | ||
# | ||
# param plugs List of the names of plugins to be installed. | ||
# | ||
MACRO(install_qt_plugins plgs destination) | ||
if("${QT_PLUGINS_DIR}" STREQUAL "") | ||
set (QT_PLUGINS_DIR "${Qt5_DIR}/../../../plugins") | ||
endif() | ||
|
||
set(_regex_exp "") | ||
|
||
set(_first TRUE) | ||
|
||
foreach(plg ${plgs}) | ||
if(NOT _first) | ||
set (_regex_exp ${_regex_exp}|${plg}) | ||
else() | ||
set(_regex_exp ${plg}) | ||
set(_first FALSE) | ||
endif() | ||
endforeach() | ||
|
||
set(_regex_exp "(${_regex_exp})?(${CMAKE_SHARED_LIBRARY_SUFFIX})$") | ||
|
||
set(_dest "${destination}") | ||
|
||
set(_plugin_dirs "imageformats;iconengines;sqldrivers;platforms") | ||
|
||
foreach(_plugin_dir ${_plugin_dirs}) | ||
install(DIRECTORY ${QT_PLUGINS_DIR}/${_plugin_dir} | ||
DESTINATION ${_dest} COMPONENT runtime | ||
FILES_MATCHING REGEX "${_regex_exp}") | ||
endforeach() | ||
ENDMACRO(install_qt_plugins) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
if [ "$_INPEEM_BUILD_DIR" == "" ]; then | ||
_INPEEM_BUILD_DIR=$(pwd)/build | ||
fi | ||
export _INPEEM_BUILD_DIR=$_INPEEM_BUILD_DIR | ||
|
||
if [ "$_INPEEM_INSTALL_DIR" == "" ]; then | ||
_INPEEM_INSTALL_DIR=$(pwd)/install | ||
fi | ||
export _INPEEM_INSTALL_DIR=$_INPEEM_INSTALL_DIR | ||
|
||
if [ "$_INPEEM_BUILD_TYPE" == "" ]; then | ||
_INPEEM_BUILD_TYPE=Release | ||
fi | ||
export _INPEEM_BUILD_TYPE=$_INPEEM_BUILD_TYPE | ||
|
||
if [ "$_INPEEM_BUILD_AS_BUNDLE" == "" ]; then | ||
_INPEEM_BUILD_AS_BUNDLE=ON | ||
fi | ||
export _INPEEM_BUILD_AS_BUNDLE=$_INPEEM_BUILD_AS_BUNDLE | ||
|
||
if [ "$_INPEEM_CREATE_INSTALLER" == "" ]; then | ||
_INPEEM_CREATE_INSTALLER=OFF | ||
fi | ||
export _INPEEM_CREATE_INSTALLER=$_INPEEM_CREATE_INSTALLER | ||
|
||
if [ "$_INPEEM_TERRAME_DIR" == "" ]; then | ||
_INPEEM_TERRAME_DIR=/Users/developer/inpeem/3rdparty/terrame | ||
fi | ||
export _INPEEM_TERRAME_DIR=$_INPEEM_TERRAME_DIR | ||
|
||
if [ "$_Qt5_DIR" == "" ]; then | ||
_Qt5_DIR=/Users/developer/Qt5.6.0/5.6/clang_64/lib/cmake | ||
fi | ||
export _Qt5_DIR=$_Qt5_DIR | ||
|
||
if ! command -v qmake &> /dev/null; then | ||
export PATH=$PATH:/Users/developer/Qt5.6.0/5.6/clang_64/bin | ||
fi | ||
|
||
if ! command -v cmake &> /dev/null; then | ||
export PATH=$PATH:export PATH=$PATH:/Applications/CMake.app/Contents/bin | ||
fi | ||
|
||
export _INPEEM_SOLUTION_DIR=$(pwd) | ||
|
||
mkdir $_INPEEM_BUILD_DIR | ||
cd $_INPEEM_BUILD_DIR | ||
|
||
if [ "$_INPEEM_GIT_DIR" == "" ]; then | ||
_INPEEM_GIT_DIR=../../git/inpeem | ||
fi | ||
export _INPEEM_GIT_DIR=$_INPEEM_GIT_DIR | ||
|
||
cmake -G "Xcode" -C $_INPEEM_GIT_DIR/build/cmake/inpeem_build_conf.cmake $_INPEEM_GIT_DIR/build/cmake | ||
cmake --build . --target install --config $_INPEEM_BUILD_TYPE | ||
|
||
if [ "$_INPEEM_CREATE_INSTALLER" == "ON" ]; then | ||
cpack -D CPACK_GENERATOR="DragNDrop" -C Release --config ./CPackConfig.cmake | ||
fi | ||
|
||
cd $_INPEEM_SOLUTION_DIR |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.