summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mysql.cc2
-rw-r--r--client/mysqltest.cc2
-rw-r--r--cmake/os/Windows.cmake11
-rw-r--r--cmake/os/WindowsCache.cmake4
-rw-r--r--config.h.cmake8
-rw-r--r--configure.cmake2
-rw-r--r--include/hash.h4
-rw-r--r--include/my_pthread.h2
-rw-r--r--libmysql/errmsg.c2
-rw-r--r--mysys/hash.c2
-rw-r--r--mysys/lf_hash.c40
-rw-r--r--win/packaging/CMakeLists.txt60
-rw-r--r--win/packaging/ca/CMakeLists.txt42
13 files changed, 88 insertions, 93 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 60bed6b0d6a..71eac780262 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1108,7 +1108,7 @@ inline int get_command_index(char cmd_char)
All client-specific commands are in the first part of commands array
and have a function to implement it.
*/
- for (uint i= 0; *commands[i].func; i++)
+ for (uint i= 0; commands[i].func; i++)
if (commands[i].cmd_char == cmd_char)
return i;
return -1;
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index e28d56e9187..c601fb57f2f 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5246,7 +5246,7 @@ static st_error global_error_names[] =
#include <my_base.h>
static st_error handler_error_names[] =
{
- { "<No error>", -1U, "" },
+ { "<No error>", UINT_MAX, "" },
#include <handler_ername.h>
{ 0, 0, 0 }
};
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake
index 4c01bab4c1f..1ad7e5c288d 100644
--- a/cmake/os/Windows.cmake
+++ b/cmake/os/Windows.cmake
@@ -96,8 +96,11 @@ IF(MSVC)
STRING(REGEX REPLACE "/STACK:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS}")
STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}")
STRING(REGEX REPLACE "/INCREMENTAL$" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}")
+ STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_DEBUG "${CMAKE_${type}_LINKER_FLAGS_DEBUG}")
+ STRING(REGEX REPLACE "/INCREMENTAL$" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_DEBUG "${CMAKE_${type}_LINKER_FLAGS_DEBUG}")
SET(CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO} /OPT:REF /release")
ENDFOREACH()
+
# Mark 32 bit executables large address aware so they can
# use > 2GB address space
@@ -113,7 +116,7 @@ IF(MSVC)
#TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /we4099")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /we4099")
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
# _WIN64 is defined by the compiler itself.
@@ -181,14 +184,14 @@ CHECK_SYMBOL_REPLACEMENT(S_IROTH _S_IREAD sys/stat.h)
CHECK_SYMBOL_REPLACEMENT(S_IFIFO _S_IFIFO sys/stat.h)
CHECK_SYMBOL_REPLACEMENT(SIGQUIT SIGTERM signal.h)
CHECK_SYMBOL_REPLACEMENT(SIGPIPE SIGINT signal.h)
-CHECK_SYMBOL_REPLACEMENT(isnan _isnan float.h)
-CHECK_SYMBOL_REPLACEMENT(finite _finite float.h)
+CHECK_SYMBOL_REPLACEMENT(isnan _isnan "math.h;float.h")
+CHECK_SYMBOL_REPLACEMENT(finite _finite "math;float.h")
CHECK_FUNCTION_REPLACEMENT(popen _popen)
CHECK_FUNCTION_REPLACEMENT(pclose _pclose)
CHECK_FUNCTION_REPLACEMENT(access _access)
CHECK_FUNCTION_REPLACEMENT(strcasecmp _stricmp)
CHECK_FUNCTION_REPLACEMENT(strncasecmp _strnicmp)
-CHECK_FUNCTION_REPLACEMENT(snprintf _snprintf)
+CHECK_SYMBOL_REPLACEMENT(snprintf _snprintf stdio.h)
CHECK_FUNCTION_REPLACEMENT(strtok_r strtok_s)
CHECK_FUNCTION_REPLACEMENT(strtoll _strtoi64)
CHECK_FUNCTION_REPLACEMENT(strtoull _strtoui64)
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake
index b805ec4fb43..2808a6f749f 100644
--- a/cmake/os/WindowsCache.cmake
+++ b/cmake/os/WindowsCache.cmake
@@ -101,7 +101,6 @@ SET(HAVE_IPPROTO_IPV6 CACHE INTERNAL "")
SET(HAVE_IPV6 TRUE CACHE INTERNAL "")
SET(HAVE_IPV6_V6ONLY 1 CACHE INTERNAL "")
SET(HAVE_ISINF CACHE INTERNAL "")
-SET(HAVE_ISNAN CACHE INTERNAL "")
SET(HAVE_ISSETUGID CACHE INTERNAL "")
SET(HAVE_GETUID CACHE INTERNAL "")
SET(HAVE_GETEUID CACHE INTERNAL "")
@@ -231,7 +230,6 @@ SET(HAVE_SIZEOF_ULONG FALSE CACHE INTERNAL "")
SET(HAVE_SIZEOF_U_INT32_T FALSE CACHE INTERNAL "")
SET(HAVE_SIZE_OF_SSIZE_T FALSE CACHE INTERNAL "")
SET(HAVE_SLEEP CACHE INTERNAL "")
-SET(HAVE_SNPRINTF CACHE INTERNAL "")
SET(HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 CACHE INTERNAL "")
SET(HAVE_SOLARIS_STYLE_GETHOST CACHE INTERNAL "")
SET(STACK_DIRECTION -1 CACHE INTERNAL "")
@@ -324,10 +322,8 @@ SET(WORDS_BIGENDIAN CACHE INTERNAL "")
SET(HAVE__S_IFIFO 1 CACHE INTERNAL "")
SET(HAVE__S_IREAD 1 CACHE INTERNAL "")
SET(HAVE__finite 1 CACHE INTERNAL "")
-SET(HAVE__isnan 1 CACHE INTERNAL "")
SET(HAVE__pclose 1 CACHE INTERNAL "")
SET(HAVE__popen 1 CACHE INTERNAL "")
-SET(HAVE__snprintf 1 CACHE INTERNAL "")
SET(HAVE__stricmp 1 CACHE INTERNAL "")
SET(HAVE__strnicmp 1 CACHE INTERNAL "")
SET(HAVE__strtoi64 1 CACHE INTERNAL "")
diff --git a/config.h.cmake b/config.h.cmake
index 46eed79dfa5..b037464df88 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -317,6 +317,8 @@
#cmakedefine HAVE_TIMESPEC_TS_SEC 1
#cmakedefine STRUCT_DIRENT_HAS_D_INO 1
#cmakedefine STRUCT_DIRENT_HAS_D_NAMLEN 1
+#cmakedefine STRUCT_TIMESPEC_HAS_TV_SEC 1
+#cmakedefine STRUCT_TIMESPEC_HAS_TV_NSEC 1
#cmakedefine SPRINTF_RETURNS_INT 1
#define USE_MB 1
@@ -514,6 +516,10 @@
#cmakedefine strtoll @strtoll@
#cmakedefine strtoull @strtoull@
#cmakedefine vsnprintf @vsnprintf@
+#if (_MSC_VER > 1800)
+#define tzname _tzname
+#define P_tmpdir "C:\\TEMP"
+#endif
#if (_MSC_VER > 1310)
# define HAVE_SETENV
#define setenv(a,b,c) _putenv_s(a,b)
@@ -522,7 +528,7 @@
/* We don't want the min/max macros */
#ifdef __WIN__
-#define NOMINMAX
+#define NOMINMAX 1
#endif
/*
diff --git a/configure.cmake b/configure.cmake
index fb127688bd2..f8c58dac391 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1056,3 +1056,5 @@ CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_IN
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN)
SET(SPRINTF_RETURNS_INT 1)
CHECK_INCLUDE_FILE(ucontext.h HAVE_UCONTEXT_H)
+CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_sec "time.h" STRUCT_TIMESPEC_HAS_TV_SEC)
+CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_nsec "time.h" STRUCT_TIMESPEC_HAS_TV_NSEC)
diff --git a/include/hash.h b/include/hash.h
index ba36df23f58..fde7fc30d38 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -44,7 +44,7 @@ extern "C" {
typedef uint my_hash_value_type;
typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool);
-typedef my_hash_value_type (*my_hash_function)(const CHARSET_INFO *,
+typedef my_hash_value_type (*my_hash_function)(CHARSET_INFO *,
const uchar *, size_t);
typedef void (*my_hash_free_key)(void *);
typedef my_bool (*my_hash_walk_action)(void *,void *);
@@ -78,7 +78,7 @@ uchar *my_hash_search(const HASH *info, const uchar *key, size_t length);
uchar *my_hash_search_using_hash_value(const HASH *info,
my_hash_value_type hash_value,
const uchar *key, size_t length);
-my_hash_value_type my_hash_sort(const CHARSET_INFO *cs,
+my_hash_value_type my_hash_sort(CHARSET_INFO *cs,
const uchar *key, size_t length);
#define my_calc_hash(A, B, C) my_hash_sort((A)->charset, B, C)
uchar *my_hash_first(const HASH *info, const uchar *key, size_t length,
diff --git a/include/my_pthread.h b/include/my_pthread.h
index bb4d0c88ebd..cff6416904a 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -86,10 +86,12 @@ typedef volatile LONG my_pthread_once_t;
#define MY_PTHREAD_ONCE_INPROGRESS 1
#define MY_PTHREAD_ONCE_DONE 2
+#if !STRUCT_TIMESPEC_HAS_TV_SEC || !STRUCT_TIMESPEC_HAS_TV_NSEC
struct timespec {
time_t tv_sec;
long tv_nsec;
};
+#endif
int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 84884f9565a..e30cdc9762b 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -90,7 +90,7 @@ const char *client_errors[]=
""
};
-const char** get_client_errmsgs()
+const char** get_client_errmsgs(void)
{
return client_errors;
}
diff --git a/mysys/hash.c b/mysys/hash.c
index 4ef731cde15..344b698a433 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -40,7 +40,7 @@ static void movelink(HASH_LINK *array,uint pos,uint next_link,uint newlink);
static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
size_t length);
-my_hash_value_type my_hash_sort(const CHARSET_INFO *cs, const uchar *key,
+my_hash_value_type my_hash_sort(CHARSET_INFO *cs, const uchar *key,
size_t length)
{
ulong nr1= 1, nr2= 4;
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index aa96ca94198..eb0c252edb1 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -43,7 +43,7 @@ const int LF_HASH_OVERHEAD= sizeof(LF_SLIST);
/*
a structure to pass the context (pointers two the three successive elements
- in a list) from lfind to linsert/ldelete
+ in a list) from l_find to l_insert/l_delete
*/
typedef struct {
intptr volatile *prev;
@@ -70,7 +70,7 @@ typedef struct {
cursor is positioned in either case
pins[0..2] are used, they are NOT removed on return
*/
-static int lfind(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
+static int l_find(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
const uchar *key, uint keylen, CURSOR *cursor, LF_PINS *pins)
{
uint32 cur_hashnr;
@@ -138,7 +138,7 @@ retry:
/*
DESCRIPTION
insert a 'node' in the list that starts from 'head' in the correct
- position (as found by lfind)
+ position (as found by l_find)
RETURN
0 - inserted
@@ -148,7 +148,7 @@ retry:
it uses pins[0..2], on return all pins are removed.
if there're nodes with the same key value, a new node is added before them.
*/
-static LF_SLIST *linsert(LF_SLIST * volatile *head, CHARSET_INFO *cs,
+static LF_SLIST *l_insert(LF_SLIST * volatile *head, CHARSET_INFO *cs,
LF_SLIST *node, LF_PINS *pins, uint flags)
{
CURSOR cursor;
@@ -156,7 +156,7 @@ static LF_SLIST *linsert(LF_SLIST * volatile *head, CHARSET_INFO *cs,
for (;;)
{
- if (lfind(head, cs, node->hashnr, node->key, node->keylen,
+ if (l_find(head, cs, node->hashnr, node->key, node->keylen,
&cursor, pins) &&
(flags & LF_HASH_UNIQUE))
{
@@ -200,7 +200,7 @@ static LF_SLIST *linsert(LF_SLIST * volatile *head, CHARSET_INFO *cs,
NOTE
it uses pins[0..2], on return all pins are removed.
*/
-static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
+static int l_delete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
const uchar *key, uint keylen, LF_PINS *pins)
{
CURSOR cursor;
@@ -208,7 +208,7 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
for (;;)
{
- if (!lfind(head, cs, hashnr, key, keylen, &cursor, pins))
+ if (!l_find(head, cs, hashnr, key, keylen, &cursor, pins))
{
res= 1; /* not found */
break;
@@ -232,7 +232,7 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
(to ensure the number of "set DELETED flag" actions
is equal to the number of "remove from the list" actions)
*/
- lfind(head, cs, hashnr, key, keylen, &cursor, pins);
+ l_find(head, cs, hashnr, key, keylen, &cursor, pins);
}
res= 0;
break;
@@ -258,12 +258,12 @@ static int ldelete(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
it uses pins[0..2], on return the pin[2] keeps the node found
all other pins are removed.
*/
-static LF_SLIST *lsearch(LF_SLIST * volatile *head, CHARSET_INFO *cs,
+static LF_SLIST *l_search(LF_SLIST * volatile *head, CHARSET_INFO *cs,
uint32 hashnr, const uchar *key, uint keylen,
LF_PINS *pins)
{
CURSOR cursor;
- int res= lfind(head, cs, hashnr, key, keylen, &cursor, pins);
+ int res= l_find(head, cs, hashnr, key, keylen, &cursor, pins);
if (res)
_lf_pin(pins, 2, cursor.curr);
else
@@ -363,7 +363,7 @@ void lf_hash_destroy(LF_HASH *hash)
-1 - out of memory
NOTE
- see linsert() for pin usage notes
+ see l_insert() for pin usage notes
*/
int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data)
{
@@ -384,7 +384,7 @@ int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data)
if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins)))
return -1;
node->hashnr= my_reverse_bits(hashnr) | 1; /* normal node */
- if (linsert(el, hash->charset, node, pins, hash->flags))
+ if (l_insert(el, hash->charset, node, pins, hash->flags))
{
_lf_alloc_free(pins, node);
lf_rwunlock_by_pins(pins);
@@ -407,7 +407,7 @@ int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data)
1 - didn't (not found)
-1 - out of memory
NOTE
- see ldelete() for pin usage notes
+ see l_delete() for pin usage notes
*/
int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
{
@@ -427,7 +427,7 @@ int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
*/
if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins)))
return -1;
- if (ldelete(el, hash->charset, my_reverse_bits(hashnr) | 1,
+ if (l_delete(el, hash->charset, my_reverse_bits(hashnr) | 1,
(uchar *)key, keylen, pins))
{
lf_rwunlock_by_pins(pins);
@@ -446,7 +446,7 @@ int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
MY_ERRPTR if OOM
NOTE
- see lsearch() for pin usage notes
+ see l_search() for pin usage notes
*/
void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
{
@@ -460,7 +460,7 @@ void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen)
return MY_ERRPTR;
if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins)))
return MY_ERRPTR;
- found= lsearch(el, hash->charset, my_reverse_bits(hashnr) | 1,
+ found= l_search(el, hash->charset, my_reverse_bits(hashnr) | 1,
(uchar *)key, keylen, pins);
lf_rwunlock_by_pins(pins);
return found ? found+1 : 0;
@@ -488,16 +488,16 @@ static int initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node,
dummy->hashnr= my_reverse_bits(bucket) | 0; /* dummy node */
dummy->key= dummy_key;
dummy->keylen= 0;
- if ((cur= linsert(el, hash->charset, dummy, pins, LF_HASH_UNIQUE)))
+ if ((cur= l_insert(el, hash->charset, dummy, pins, LF_HASH_UNIQUE)))
{
my_free(dummy);
dummy= cur;
}
my_atomic_casptr((void **)node, (void **)(char*) &tmp, dummy);
/*
- note that if the CAS above failed (after linsert() succeeded),
- it would mean that some other thread has executed linsert() for
- the same dummy node, its linsert() failed, it picked up our
+ note that if the CAS above failed (after l_insert() succeeded),
+ it would mean that some other thread has executed l_insert() for
+ the same dummy node, its l_insert() failed, it picked up our
dummy node (in "dummy= cur") and executed the same CAS as above.
Which means that even if CAS above failed we don't need to retry,
and we should not free(dummy) - there's no memory leak here
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt
index 3b9b72f48fd..0535a486d57 100644
--- a/win/packaging/CMakeLists.txt
+++ b/win/packaging/CMakeLists.txt
@@ -17,36 +17,62 @@ IF(NOT WIN32)
RETURN()
ENDIF()
+IF(MSVC_VERSION LESS 1600)
+ RETURN()
+ENDIF()
+
+
+
SET(MANUFACTURER "MariaDB Corporation Ab")
FIND_PATH(WIX_DIR heat.exe
- $ENV{WIX_DIR}/bin
- $ENV{ProgramFiles}/wix/bin
- "$ENV{ProgramFiles}/Windows Installer XML v3/bin"
- "$ENV{ProgramFiles}/Windows Installer XML v3.5/bin"
- "$ENV{ProgramFiles}/Windows Installer XML v3.6/bin"
"$ENV{ProgramFiles}/WiX Toolset v3.9/bin"
- "$ENV{WIX}/bin"
+ "$ENV{ProgramFiles}/WiX Toolset v3.10/bin"
)
-
SET(CPACK_WIX_PACKAGE_BASE_NAME "MariaDB")
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
SET(CPACK_WIX_UPGRADE_CODE "49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3")
- SET(CPACK_WIX_PACKAGE_NAME "MariaDB @MAJOR_VERSION@.@MINOR_VERSION@")
+ SET(CPACK_WIX_PACKAGE_NAME "MariaDB ${MAJOR_VERSION}.${MINOR_VERSION}")
ELSE()
SET(CPACK_WIX_UPGRADE_CODE "2331E7BD-EE58-431B-9E18-B2B918BCEB1B")
- SET(CPACK_WIX_PACKAGE_NAME "MariaDB @MAJOR_VERSION@.@MINOR_VERSION@ (x64)")
+ SET(CPACK_WIX_PACKAGE_NAME "MariaDB ${MAJOR_VERSION}.${MINOR_VERSION} (x64)")
ENDIF()
+IF(WIX_DIR)
+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(WIX_ARCH_SUFFIX "x64")
+ELSE()
+ SET(WIX_ARCH_SUFFIX "x86")
+ENDIF()
+# Need some Wix SDK libraries to link with customaction
+IF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 )
+ SET(WIX_MSVC_SUFFIX "VS2010")
+ELSEIF(MSVC_VERSION EQUAL 1800)
+ SET(WIX_MSVC_SUFFIX "VS2013")
+ELSEIF (MSVC_VERSION EQUAL 1900)
+ SET(WIX_MSVC_SUFFIX "VS2015")
+ENDIF()
+
+
+FIND_LIBRARY(WIX_WCAUTIL_LIBRARY
+ NAMES wcautil${WIX_ARCH_SUFFIX} wcautil${WIX_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
+ wcautil
+ PATHS
+ ${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/lib/${WIX_ARCH_SUFFIX}
+ )
+
+FIND_LIBRARY(WIX_DUTIL_LIBRARY
+ NAMES dutil${WIX_ARCH_SUFFIX}
+ dutil
+ PATHS
+ ${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/lib/${WIX_ARCH_SUFFIX}
+ )
+ENDIF()
-IF(NOT WIX_DIR)
- IF(NOT _WIX_DIR_CHECKED)
- SET(_WIX_DIR_CHECKED 1 CACHE INTERNAL "")
- MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated")
- IF(BUILD_RELEASE)
+IF(NOT WIX_DUTIL_LIBRARY)
+ MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated")
+ IF(BUILD_RELEASE)
MESSAGE(FATAL_ERROR
- "Can't find Wix. It is necessary for producing official package"
- )
- ENDIF()
+ "Can't find Wix. It is necessary for producing official package")
ENDIF()
RETURN()
ENDIF()
diff --git a/win/packaging/ca/CMakeLists.txt b/win/packaging/ca/CMakeLists.txt
index ccd03130d69..c57ae4b2113 100644
--- a/win/packaging/ca/CMakeLists.txt
+++ b/win/packaging/ca/CMakeLists.txt
@@ -13,53 +13,13 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/inc)
-LINK_DIRECTORIES(${WIX_DIR}/../SDK/lib)
-
+INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX_MSVC_SUFFIX}/inc)
SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
-IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- SET(WIX_ARCH_SUFFIX "_x64")
- SET(WIX36_ARCH_SUFFIX "x64")
-ELSE()
- SET(WIX_ARCH_SUFFIX)
- SET(WIX36_ARCH_SUFFIX "x86")
-ENDIF()
-
-IF(MSVC_VERSION EQUAL 1400)
- SET(WIX35_MSVC_SUFFIX "_2005")
-ELSEIF(MSVC_VERSION EQUAL 1500)
- SET(WIX35_MSVC_SUFFIX "_2008")
- SET(WIX36_MSVC_SUFFIX "VS2008")
-ELSEIF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 )
- SET(WIX35_MSVC_SUFFIX "_2010")
- SET(WIX36_MSVC_SUFFIX "VS2010")
-ELSEIF(MSVC_VERSION EQUAL 1800 OR MSVC_VERSION EQUAL 1900 )
- SET(WIX35_MSVC_SUFFIX "_2013")
- SET(WIX36_MSVC_SUFFIX "VS2013")
-ELSE()
- # When next VS is out, add the correct version here
- MESSAGE(FATAL_ERROR "Unknown VS version")
-ENDIF()
-INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/inc)
-FIND_LIBRARY(WIX_WCAUTIL_LIBRARY
- NAMES wcautil${WIX_ARCH_SUFFIX} wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
- wcautil
- PATHS
- ${WIX_DIR}/../SDK/lib
- ${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/lib/${WIX36_ARCH_SUFFIX}
- )
-FIND_LIBRARY(WIX_DUTIL_LIBRARY
- NAMES dutil${WIX_ARCH_SUFFIX} dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
- dutil
- PATHS
- ${WIX_DIR}/../SDK/lib
- ${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/lib/${WIX36_ARCH_SUFFIX}
- )
ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES})