summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2013-04-19 18:45:54 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2013-04-19 18:45:54 +0200
commit0b034c1b2c619e3de6c8cbaddaede75578b5ef1a (patch)
treecbd9ef0be6348e38b0fdc75a6087c5aaa1f46f96
parent9df2057cfa5c080b04db070bdd2992a054a66a65 (diff)
downloadmariadb-git-0b034c1b2c619e3de6c8cbaddaede75578b5ef1a.tar.gz
Fix to handle CMake component names with dash in the name, when producing MSI package.
Rename connect_engine component back to connect-engine.
-rw-r--r--storage/connect/CMakeLists.txt8
-rw-r--r--win/packaging/CPackWixConfig.cmake10
-rw-r--r--win/packaging/create_msi.cmake.in38
3 files changed, 30 insertions, 26 deletions
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index 5541efca880..eae4d9a25bc 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -252,7 +252,7 @@ ENDIF(CONNECT_WITH_ODBC)
MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
STORAGE_ENGINE
MODULE_OUTPUT_NAME "ha_connect"
- COMPONENT connect_engine
+ COMPONENT connect-engine
LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
${ODBC_LIBRARY} ${IPHLPAPI_LIBRARY})
@@ -263,12 +263,12 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
IF (INSTALL_SYSCONFDIR)
INSTALL(FILES connect.cnf DESTINATION ${INSTALL_SYSCONFDIR}/my.cnf.d
- COMPONENT connect_engine)
+ COMPONENT connect-engine)
ENDIF(INSTALL_SYSCONFDIR)
IF(RPM)
- SET(CPACK_COMPONENT_CASSANDRASELIBRARIES_GROUP "connect_engine" PARENT_SCOPE)
- SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} connect_engine PARENT_SCOPE)
+ SET(CPACK_COMPONENT_CASSANDRASELIBRARIES_GROUP "connect-engine" PARENT_SCOPE)
+ SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} connect-engine PARENT_SCOPE)
SET(CPACK_RPM_connect_engine_PACKAGE_REQUIRES "MariaDB-server" PARENT_SCOPE)
# workarounds for cmake issues #13248 and #12864:
diff --git a/win/packaging/CPackWixConfig.cmake b/win/packaging/CPackWixConfig.cmake
index e363fb97a28..d6fcf963ce3 100644
--- a/win/packaging/CPackWixConfig.cmake
+++ b/win/packaging/CPackWixConfig.cmake
@@ -9,7 +9,7 @@ IF(ESSENTIALS)
ENDIF()
ELSE()
SET(CPACK_COMPONENTS_USED
- "Server;Client;Development;SharedLibraries;Embedded;Documentation;IniFiles;Readme;Debuginfo;Common;connect_engine")
+ "Server;Client;Development;SharedLibraries;Embedded;Documentation;IniFiles;Readme;Debuginfo;Common;connect-engine")
ENDIF()
SET( WIX_FEATURE_MySQLServer_EXTRA_FEATURES "DBInstance;SharedClientServerComponents")
@@ -63,10 +63,10 @@ SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install server")
SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1)
#Subfeature "Connect Engine"
- SET(CPACK_COMPONENT_CONNECT_ENGINE_GROUP "MySQLServer")
- SET(CPACK_COMPONENT_CONNECT_ENGINE_DISPLAY_NAME "Server data files")
- SET(CPACK_COMPONENT_CONNECT_ENGINE_DESCRIPTION "Server data files" )
- SET(CPACK_COMPONENT_CONNECT_ENGINE_HIDDEN 1)
+ SET(CPACK_COMPONENT_CONNECT-ENGINE_GROUP "MySQLServer")
+ SET(CPACK_COMPONENT_CONNECT-ENGINE_DISPLAY_NAME "Server data files")
+ SET(CPACK_COMPONENT_CONNECT-ENGINE_DESCRIPTION "Server data files" )
+ SET(CPACK_COMPONENT_CONNECT-ENGINE_HIDDEN 1)
#Feature "Devel"
diff --git a/win/packaging/create_msi.cmake.in b/win/packaging/create_msi.cmake.in
index a8ca35906e8..c2ab648a6db 100644
--- a/win/packaging/create_msi.cmake.in
+++ b/win/packaging/create_msi.cmake.in
@@ -29,6 +29,21 @@ SET(THIRD_PARTY_DOWNLOAD_LOCATION "@THIRD_PARTY_DOWNLOAD_LOCATION@")
SET(THIRD_PARTY_FEATURE_CONDITION "@THIRD_PARTY_FEATURE_CONDITION@")
SET(LIBMYSQL_LOCATION "@LIBMYSQL_LOCATION@")
+
+MACRO(MAKE_WIX_IDENTIFIER str varname)
+ STRING(REPLACE "/" "." ${varname} "${str}")
+ STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}")
+ STRING(LENGTH "${${varname}}" len)
+ # Identifier should be smaller than 72 character
+ # We have to cut down the length to 70 chars, since we add 2 char prefix
+ # pretty often
+ IF(len GREATER 70)
+ MATH(EXPR diff "${len}-67")
+ STRING(SUBSTRING "${${varname}}" ${diff} 67 shortstr)
+ SET(${varname} "___${shortstr}")
+ ENDIF()
+ENDMACRO()
+
SET($ENV{VS_UNICODE_OUTPUT} "")
IF(LIBMYSQL_LOCATION AND CMAKE_CFG_INTDIR)
# resolve libmysql full path
@@ -191,6 +206,7 @@ FOREACH(f ${WIX_FEATURES})
Level='${Level}' ${DISPLAY} >"
)
FOREACH(c ${${f}_COMPONENTS})
+
STRING(TOUPPER "${c}" c_upper)
IF (CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)
SET(TITLE ${CPACK_COMPONENT_${c_upper}_DISPLAY_NAME})
@@ -208,10 +224,12 @@ FOREACH(f ${WIX_FEATURES})
ELSE()
SET(Level 1)
ENDIF()
+ MAKE_WIX_IDENTIFIER("${c}" cg)
+
IF(CPACK_COMPONENT_${c_upper}_HIDDEN)
SET(CPACK_WIX_FEATURES
"${CPACK_WIX_FEATURES}
- <ComponentGroupRef Id='componentgroup.${c}'/>")
+ <ComponentGroupRef Id='componentgroup.${cg}'/>")
ELSE()
SET(CPACK_WIX_FEATURES
"${CPACK_WIX_FEATURES}
@@ -221,7 +239,7 @@ FOREACH(f ${WIX_FEATURES})
ConfigurableDirectory='INSTALLDIR'
AllowAdvertise='no'
Level='${Level}'>
- <ComponentGroupRef Id='componentgroup.${c}'/>
+ <ComponentGroupRef Id='componentgroup.${cg}'/>
</Feature>")
ENDIF()
@@ -248,21 +266,6 @@ MACRO(GENERATE_GUID VarName)
OUTPUT_STRIP_TRAILING_WHITESPACE)
ENDMACRO()
-MACRO(MAKE_WIX_IDENTIFIER str varname)
- STRING(REPLACE "/" "." ${varname} "${str}")
- STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}")
- STRING(LENGTH "${${varname}}" len)
- # Identifier should be smaller than 72 character
- # We have to cut down the length to 70 chars, since we add 2 char prefix
- # pretty often
- IF(len GREATER 70)
- MATH(EXPR diff "${len}-67")
- STRING(SUBSTRING "${${varname}}" ${diff} 67 shortstr)
- SET(${varname} "___${shortstr}")
- ENDIF()
-ENDMACRO()
-
-
FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
FILE(GLOB all_files ${dir}/*)
@@ -354,6 +357,7 @@ GET_FILENAME_COMPONENT(abs . ABSOLUTE)
FOREACH(d ${DIRS})
GET_FILENAME_COMPONENT(d ${d} ABSOLUTE)
GET_FILENAME_COMPONENT(d_name ${d} NAME)
+ MAKE_WIX_IDENTIFIER("${d_name}" d_name)
FILE(WRITE ${abs}/${d_name}_component_group.wxs
"<ComponentGroup Id='componentgroup.${d_name}'>")
SET(COMP_NAME ${d_name})