Try to fix package creation
This commit is contained in:
parent
f03051b6cf
commit
49b22b7d2f
1 changed files with 27 additions and 4 deletions
|
@ -83,6 +83,28 @@ endif()
|
||||||
|
|
||||||
SET(QT_DONT_USE_QTGUI TRUE)
|
SET(QT_DONT_USE_QTGUI TRUE)
|
||||||
|
|
||||||
|
# Mysql connector
|
||||||
|
if(UNIX)
|
||||||
|
if(APPLE)
|
||||||
|
SET(MYSQLCLIENT_DEFAULT_PATHS "/usr/local/lib" "/opt/local/lib/mysql55/mysql/" "/opt/local/lib/mysql56/mysql/")
|
||||||
|
else()
|
||||||
|
SET(MYSQLCLIENT_DEFAULT_PATHS "/usr/lib" "/usr/local/lib")
|
||||||
|
endif()
|
||||||
|
elseif(WIN32)
|
||||||
|
SET(MYSQLCLIENT_DEFAULT_PATHS "C:\\Program Files\\MySQL\\MySQL Server 5.5\\lib" "C:\\Program Files\\MySQL\\MySQL Server 5.6\\lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_library(MYSQLCLIENT_LIBRARIES NAMES mysqlclient PATHS ${MYSQLCLIENT_DEFAULT_PATHS} PATH_SUFFIXES mysql mariadb)
|
||||||
|
if(${MYSQLCLIENT_LIBRARIES} MATCHES "NOTFOUND")
|
||||||
|
set(MYSQLCLIENT_FOUND FALSE CACHE INTERNAL "")
|
||||||
|
MESSAGE(STATUS "Mysql connector NOT FOUND: servatrice won't be able to connect to a mysql server")
|
||||||
|
unset(MYSQLCLIENT_LIBRARIES)
|
||||||
|
else()
|
||||||
|
set(MYSQLCLIENT_FOUND TRUE CACHE INTERNAL "")
|
||||||
|
get_filename_component(MYSQLCLIENT_LIBRARY_DIR ${MYSQLCLIENT_LIBRARIES} PATH)
|
||||||
|
MESSAGE(STATUS "Mysql connector found at: ${MYSQLCLIENT_LIBRARY_DIR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Declare path variables
|
# Declare path variables
|
||||||
set(ICONDIR share/icons CACHE STRING "icon dir")
|
set(ICONDIR share/icons CACHE STRING "icon dir")
|
||||||
set(DESKTOPDIR share/applications CACHE STRING "desktop file destination")
|
set(DESKTOPDIR share/applications CACHE STRING "desktop file destination")
|
||||||
|
@ -152,7 +174,7 @@ if(APPLE)
|
||||||
# qt5: platforms, sqldrivers
|
# qt5: platforms, sqldrivers
|
||||||
|
|
||||||
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
||||||
FILES_MATCHING REGEX "(codecs|platforms|sqldrivers)/.*\\.dylib"
|
FILES_MATCHING REGEX "(codecs/.*|platforms/.*|sqldrivers/libqsqlmysql)\\.dylib"
|
||||||
REGEX ".*_debug\\.dylib" EXCLUDE)
|
REGEX ".*_debug\\.dylib" EXCLUDE)
|
||||||
|
|
||||||
install(CODE "
|
install(CODE "
|
||||||
|
@ -166,7 +188,7 @@ Translations = Resources/translations\")
|
||||||
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dylib\")
|
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dylib\")
|
||||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||||
include(BundleUtilities)
|
include(BundleUtilities)
|
||||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\")
|
||||||
" COMPONENT Runtime)
|
" COMPONENT Runtime)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -179,7 +201,8 @@ if(WIN32)
|
||||||
# qt5: platforms, sqldrivers
|
# qt5: platforms, sqldrivers
|
||||||
|
|
||||||
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
|
||||||
FILES_MATCHING REGEX "(codecs|platforms|sqldrivers)/.*[^d]\\.dll")
|
FILES_MATCHING REGEX "(codecs/.*|platforms/.*|sqldrivers/libqsqlmysql)\\.dll"
|
||||||
|
REGEX ".*d\\.dll" EXCLUDE)
|
||||||
|
|
||||||
install(CODE "
|
install(CODE "
|
||||||
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths]
|
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths]
|
||||||
|
@ -192,7 +215,7 @@ Translations = Resources/translations\")
|
||||||
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\")
|
\"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/*.dll\")
|
||||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||||
include(BundleUtilities)
|
include(BundleUtilities)
|
||||||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/servatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
|
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/servatrice.exe\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR};${MYSQLCLIENT_LIBRARY_DIR}\")
|
||||||
" COMPONENT Runtime)
|
" COMPONENT Runtime)
|
||||||
endif()
|
endif()
|
||||||
#Compile a portable version, default off
|
#Compile a portable version, default off
|
||||||
|
|
Loading…
Reference in a new issue