diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | cmake/create_initial_db.cmake (renamed from cmake/create_initial_db.cmake.in) | 20 | ||||
-rw-r--r-- | cmake/install_macros.cmake | 16 | ||||
-rw-r--r-- | cmake/libutils.cmake | 47 | ||||
-rw-r--r-- | cmake/merge_archives_unix.cmake (renamed from cmake/merge_archives_unix.cmake.in) | 11 | ||||
m--------- | libmariadb | 0 | ||||
-rw-r--r-- | libmysqld/CMakeLists.txt | 3 | ||||
-rw-r--r-- | pcre/CMakeLists.txt | 63 | ||||
-rw-r--r-- | pcre/pcre_grep_test.sh | 13 | ||||
-rw-r--r-- | pcre/pcre_test.bat | 9 | ||||
-rw-r--r-- | pcre/pcre_test.sh | 11 | ||||
-rw-r--r-- | sql/CMakeLists.txt | 25 | ||||
-rw-r--r-- | storage/connect/CMakeLists.txt | 9 | ||||
-rw-r--r-- | storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake | 16 | ||||
-rw-r--r-- | win/packaging/CMakeLists.txt | 73 | ||||
-rw-r--r-- | win/packaging/create_msi.cmake (renamed from win/packaging/create_msi.cmake.in) | 54 | ||||
-rw-r--r-- | win/packaging/extra.wxs.in | 4 | ||||
-rw-r--r-- | win/packaging/heidisql.cmake | 6 | ||||
-rw-r--r-- | win/upgrade_wizard/CMakeLists.txt | 3 |
20 files changed, 177 insertions, 221 deletions
diff --git a/.gitignore b/.gitignore index 832df90347b..0b08870f001 100644 --- a/.gitignore +++ b/.gitignore @@ -94,7 +94,6 @@ packaging/rpm-oel/mysql.spec packaging/rpm-uln/mysql.10.0.11.spec packaging/solaris/postinstall-solaris pcre/config.h -pcre/pcre*test.sh pcre/pcre.h pcre/pcre_chartables.c pcre/pcregrep diff --git a/CMakeLists.txt b/CMakeLists.txt index 94e38658697..0cd4028ac75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,15 +19,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7) IF(POLICY CMP0022) CMAKE_POLICY(SET CMP0022 NEW) ENDIF() - -# We use the LOCATION target property (CMP0026) -# and get_target_property() for non-existent targets (CMP0045) -# and INSTALL_NAME_DIR (CMP0042) -IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR - CMAKE_VERSION VERSION_GREATER "3.0.0") - CMAKE_POLICY(SET CMP0026 OLD) - CMAKE_POLICY(SET CMP0045 OLD) - CMAKE_POLICY(SET CMP0042 OLD) +IF(POLICY CMP0042) + CMAKE_POLICY(SET CMP0042 OLD) +ENDIF() +IF(POLICY CMP0045) + CMAKE_POLICY(SET CMP0045 OLD) ENDIF() IF(POLICY CMP0054) CMAKE_POLICY(SET CMP0054 NEW) diff --git a/cmake/create_initial_db.cmake.in b/cmake/create_initial_db.cmake index baa48847815..df972cf379a 100644 --- a/cmake/create_initial_db.cmake.in +++ b/cmake/create_initial_db.cmake @@ -14,11 +14,6 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # This script creates initial database for packaging on Windows -SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@") -SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") -SET(MYSQLD_EXECUTABLE "@MYSQLD_EXECUTABLE@") -SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@") -SET(WIN32 "@WIN32@") # Force Visual Studio to output to stdout IF(ENV{VS_UNICODE_OUTPUT}) SET ($ENV{VS_UNICODE_OUTPUT}) @@ -32,30 +27,27 @@ ENDIF() # Create bootstrapper SQL script FILE(WRITE bootstrap.sql "use mysql;\n" ) FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql mysql_performance_tables.sql) - FILE(STRINGS ${CMAKE_SOURCE_DIR}/scripts/${FILENAME} CONTENTS) + FILE(STRINGS ${TOP_SRCDIR}/scripts/${FILENAME} CONTENTS) FOREACH(STR ${CONTENTS}) IF(NOT STR MATCHES "@current_hostname") FILE(APPEND bootstrap.sql "${STR}\n") ENDIF() ENDFOREACH() ENDFOREACH() -FILE(READ ${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql CONTENTS) +FILE(READ ${TOP_SRCDIR}/scripts/fill_help_tables.sql CONTENTS) FILE(APPEND bootstrap.sql "${CONTENTS}") FILE(REMOVE_RECURSE mysql performance_schema) FILE(REMOVE ibdata1 ib_logfile0 ib_logfile1) MAKE_DIRECTORY(mysql) -IF(WIN32) - SET(CONSOLE --console) -ENDIF() SET(BOOTSTRAP_COMMAND ${MYSQLD_EXECUTABLE} --no-defaults - ${CONSOLE} + --console --bootstrap - --lc-messages-dir=${CMAKE_CURRENT_BINARY_DIR}/share + --lc-messages-dir=${BINDIR}/share --basedir=. --datadir=. --default-storage-engine=MyISAM @@ -65,10 +57,10 @@ SET(BOOTSTRAP_COMMAND GET_FILENAME_COMPONENT(CWD . ABSOLUTE) EXECUTE_PROCESS( - COMMAND "@CMAKE_COMMAND@" -E echo Executing ${BOOTSTRAP_COMMAND} + COMMAND "${CMAKE_COMMAND}" -E echo Executing ${BOOTSTRAP_COMMAND} ) EXECUTE_PROCESS ( - COMMAND "@CMAKE_COMMAND@" -E + COMMAND "${CMAKE_COMMAND}" -E echo input file bootstrap.sql, current directory ${CWD} ) EXECUTE_PROCESS ( diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index d9d12371830..71657e32308 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -159,21 +159,17 @@ ENDFUNCTION() # Install symbolic link to CMake target. -# the link is created in the same directory as target +# the link is created in the current build directory # and extension will be the same as for target file. MACRO(INSTALL_SYMLINK linkname target destination component) IF(UNIX) - GET_TARGET_PROPERTY(location ${target} LOCATION) - GET_FILENAME_COMPONENT(path ${location} PATH) - GET_FILENAME_COMPONENT(name ${location} NAME) - SET(output ${path}/${linkname}) + SET(output ${CMAKE_CURRENT_BINARY_DIR}/${linkname}) ADD_CUSTOM_COMMAND( OUTPUT ${output} - COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${output} + COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${linkname} COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink - ${name} + $<TARGET_FILE_NAME:${target}> ${linkname} - WORKING_DIRECTORY ${path} DEPENDS ${target} ) @@ -259,8 +255,7 @@ FUNCTION(MYSQL_INSTALL_TARGETS) ENDIF() # Install man pages on Unix IF(UNIX) - GET_TARGET_PROPERTY(target_location ${target} LOCATION) - INSTALL_MANPAGE(${target_location}) + INSTALL_MANPAGE($<TARGET_FILE:${target}>) ENDIF() ENDFOREACH() @@ -277,6 +272,7 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug FUNCTION(INSTALL_DEBUG_TARGET target) + RETURN() # XXX unused? CMAKE_PARSE_ARGUMENTS(ARG "" "DESTINATION;RENAME;PDB_DESTINATION;COMPONENT" diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 621f6ecb535..cdc7af5d228 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -139,17 +139,17 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) SET(OSLIBS) FOREACH(LIB ${LIBS_TO_MERGE}) - GET_TARGET_PROPERTY(LIB_LOCATION ${LIB} LOCATION) - GET_TARGET_PROPERTY(LIB_TYPE ${LIB} TYPE) - IF(NOT LIB_LOCATION) + IF(NOT TARGET ${LIB}) # 3rd party library like libz.so. Make sure that everything # that links to our library links to this one as well. LIST(APPEND OSLIBS ${LIB}) ELSE() + GET_TARGET_PROPERTY(LIB_TYPE ${LIB} TYPE) # This is a target in current project # (can be a static or shared lib) IF(LIB_TYPE STREQUAL "STATIC_LIBRARY") - SET(STATIC_LIBS ${STATIC_LIBS} ${LIB_LOCATION}) + SET(STATIC_TGTS ${STATIC_TGTS} ${LIB}) + SET(STATIC_LIBS ${STATIC_LIBS} $<TARGET_FILE:${LIB}>) ADD_DEPENDENCIES(${TARGET} ${LIB}) # Extract dependent OS libraries GET_DEPENDEND_OS_LIBS(${LIB} LIB_OSLIBS) @@ -171,7 +171,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) ADD_CUSTOM_COMMAND( OUTPUT ${SOURCE_FILE} COMMAND ${CMAKE_COMMAND} -E touch ${SOURCE_FILE} - DEPENDS ${STATIC_LIBS}) + DEPENDS ${STATIC_TGTS}) IF(MSVC) # To merge libs, just pass them to lib.exe command line. @@ -182,29 +182,27 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) SET_TARGET_PROPERTIES(${TARGET} PROPERTIES STATIC_LIBRARY_FLAGS "${LINKER_EXTRA_FLAGS}") ELSE() - GET_TARGET_PROPERTY(TARGET_LOCATION ${TARGET} LOCATION) IF(APPLE) # Use OSX's libtool to merge archives (ihandles universal # binaries properly) ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD - COMMAND rm ${TARGET_LOCATION} - COMMAND libtool -static -o ${TARGET_LOCATION} + COMMAND rm $<TARGET_FILE:${TARGET}> + COMMAND libtool -static -o $<TARGET_FILE:${TARGET}> ${STATIC_LIBS} ) ELSE() # Generic Unix, Cygwin or MinGW. In post-build step, call # script, that extracts objects from archives with "ar x" # and repacks them with "ar r" - SET(TARGET ${TARGET}) - CONFIGURE_FILE( - ${MYSQL_CMAKE_SCRIPT_DIR}/merge_archives_unix.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET}.cmake - @ONLY - ) ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD - COMMAND rm ${TARGET_LOCATION} - COMMAND ${CMAKE_COMMAND} -P - ${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET}.cmake + COMMAND ${CMAKE_COMMAND} + -DTARGET_LOCATION="$<TARGET_FILE:${TARGET}>" + -DTARGET="${TARGET}" + -DSTATIC_LIBS="${STATIC_LIBS}" + -DCMAKE_CURRENT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}" + -DCMAKE_AR="${CMAKE_AR}" + -DCMAKE_RANLIB="${CMAKE_RANLIB}" + -P "${MYSQL_CMAKE_SCRIPT_DIR}/merge_archives_unix.cmake" ) ENDIF() ENDIF() @@ -294,18 +292,11 @@ MACRO(MERGE_LIBRARIES) ENDMACRO() FUNCTION(GET_DEPENDEND_OS_LIBS target result) - SET(deps ${${target}_LIB_DEPENDS}) - IF(deps) - FOREACH(lib ${deps}) - # Filter out keywords for used for debug vs optimized builds - IF(NOT lib MATCHES "general" AND NOT lib MATCHES "debug" AND NOT lib MATCHES "optimized") - GET_TARGET_PROPERTY(lib_location ${lib} LOCATION) - IF(NOT lib_location) - SET(ret ${ret} ${lib}) - ENDIF() + FOREACH(lib ${${target}_LIB_DEPENDS}) + IF(NOT TARGET ${lib}) + SET(ret ${ret} ${lib}) ENDIF() - ENDFOREACH() - ENDIF() + ENDFOREACH() SET(${result} ${ret} PARENT_SCOPE) ENDFUNCTION() diff --git a/cmake/merge_archives_unix.cmake.in b/cmake/merge_archives_unix.cmake index d05336d6c91..08b1931c3d3 100644 --- a/cmake/merge_archives_unix.cmake.in +++ b/cmake/merge_archives_unix.cmake @@ -14,19 +14,12 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# This script merges many static libraries into -# one big library on Unix. -SET(TARGET_LOCATION "@TARGET_LOCATION@") -SET(TARGET "@TARGET@") -SET(STATIC_LIBS "@STATIC_LIBS@") -SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") -SET(CMAKE_AR "@CMAKE_AR@") -SET(CMAKE_RANLIB "@CMAKE_RANLIB@") - +FILE(REMOVE "${TARGET_LOCATION}") SET(TEMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET}) MAKE_DIRECTORY(${TEMP_DIR}) # Extract each archive to its own subdirectory(avoid object filename clashes) +SEPARATE_ARGUMENTS(STATIC_LIBS UNIX_COMMAND "${STATIC_LIBS}") FOREACH(LIB ${STATIC_LIBS}) GET_FILENAME_COMPONENT(NAME_NO_EXT ${LIB} NAME_WE) SET(TEMP_SUBDIR ${TEMP_DIR}/${NAME_NO_EXT}) diff --git a/libmariadb b/libmariadb -Subproject ebf5db6cd0c7d10b0632a1389faa9731e3c09cf +Subproject ed5921ed4f26407ff1ff0596f2c74c8d7098632 diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index d7450eb3e87..99b620882de 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -155,8 +155,7 @@ SET(LIBS # (with corresponding target ${engine}_embedded) SET(EMBEDDED_LIBS) FOREACH(LIB ${LIBS}) - GET_TARGET_PROPERTY(EMBEDDED_LOCATION ${LIB}_embedded LOCATION) - IF(EMBEDDED_LOCATION) + IF(TARGET ${LIB}_embedded) LIST(APPEND EMBEDDED_LIBS ${LIB}_embedded) ELSE() LIST(APPEND EMBEDDED_LIBS ${LIB}) diff --git a/pcre/CMakeLists.txt b/pcre/CMakeLists.txt index 80e402e5713..ca60d9ed265 100644 --- a/pcre/CMakeLists.txt +++ b/pcre/CMakeLists.txt @@ -364,12 +364,6 @@ IF(PCRE_BUILD_TESTS) # exes in Debug location tested by the RunTest shell script # via "make test" - IF(PCRE_BUILD_PCREGREP) - GET_TARGET_PROPERTY(PCREGREP_EXE pcregrep DEBUG_LOCATION) - ENDIF(PCRE_BUILD_PCREGREP) - - GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION) - STRING(REGEX REPLACE "[^/]+$" "" PCRETEST_DIR ${PCRETEST_EXE}) # ================================================= # Write out a CTest configuration file @@ -381,36 +375,24 @@ MESSAGE(\"When testing is complete, review test output in the MESSAGE(\" \") ") - FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.sh - "#! /bin/sh -# This is a generated file. -srcdir=${PROJECT_SOURCE_DIR} -pcretest=${PCRETEST_EXE} -cd ${PCRETEST_DIR} -. ${PROJECT_SOURCE_DIR}/RunTest -if test \"$?\" != \"0\"; then exit 1; fi -# End -") - IF(UNIX) - ADD_TEST(pcre_test sh ${PROJECT_BINARY_DIR}/pcre_test.sh) + ADD_TEST(NAME pcre_test + COMMAND sh pcre_test.sh + ${PROJECT_SOURCE_DIR} + $<TARGET_FILE:pcretest> + $<TARGET_FILE_DIR:pcretest> + ) ENDIF(UNIX) IF(PCRE_BUILD_PCREGREP) - FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_grep_test.sh - "#! /bin/sh -# This is a generated file. -srcdir=${PROJECT_SOURCE_DIR} -pcregrep=${PCREGREP_EXE} -pcretest=${PCRETEST_EXE} -cd ${PCRETEST_DIR} -. ${PROJECT_SOURCE_DIR}/RunGrepTest -if test \"$?\" != \"0\"; then exit 1; fi -# End -") - IF(UNIX) - ADD_TEST(pcre_grep_test sh ${PROJECT_BINARY_DIR}/pcre_grep_test.sh) + ADD_TEST(NAME pcre_grep_test + COMMAND sh pcre_grep_test.sh + ${PROJECT_SOURCE_DIR} + $<TARGET_FILE:pcregrep> + $<TARGET_FILE:pcretest> + $<TARGET_FILE_DIR:pcretest> + ) ENDIF(UNIX) ENDIF(PCRE_BUILD_PCREGREP) @@ -418,22 +400,13 @@ if test \"$?\" != \"0\"; then exit 1; fi # Provide environment for executing the bat file version of RunTest FILE(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} winsrc) FILE(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} winbin) - FILE(TO_NATIVE_PATH ${PCRETEST_EXE} winexe) - - FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.bat - "\@REM This is a generated file. -\@echo off -setlocal -SET srcdir=\"${winsrc}\" -SET pcretest=\"${winexe}\" -if not [%CMAKE_CONFIG_TYPE%]==[] SET pcretest=\"${winbin}\\%CMAKE_CONFIG_TYPE%\\pcretest.exe\" -call %srcdir%\\RunTest.Bat -if errorlevel 1 exit /b 1 -echo RunTest.bat tests successfully completed -") ADD_TEST(NAME pcre_test_bat - COMMAND pcre_test.bat) + COMMAND pcre_test.bat + ${winsrc} + ${winbin} + $<TARGET_FILE:pcretest> + ) SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed") diff --git a/pcre/pcre_grep_test.sh b/pcre/pcre_grep_test.sh new file mode 100644 index 00000000000..7165aeeb0e2 --- /dev/null +++ b/pcre/pcre_grep_test.sh @@ -0,0 +1,13 @@ +#! /bin/sh +# +srcdir="$1" +pcregrep="$2" +pcretest="$3" +cd "$4" +shift +shift +shift +shift +. "$srcdir"/RunGrepTest +if test "$?" != "0"; then exit 1; fi +# End diff --git a/pcre/pcre_test.bat b/pcre/pcre_test.bat new file mode 100644 index 00000000000..c3f8dc3d43b --- /dev/null +++ b/pcre/pcre_test.bat @@ -0,0 +1,9 @@ +@echo off +setlocal +SET srcdir="%1" +SET bindir="%1" +SET pcretest="%3" +if not [%CMAKE_CONFIG_TYPE%]==[] SET pcretest="%bindir%\%CMAKE_CONFIG_TYPE%\pcretest.exe" +call %srcdir%\RunTest.Bat +if errorlevel 1 exit /b 1 +echo RunTest.bat tests successfully completed diff --git a/pcre/pcre_test.sh b/pcre/pcre_test.sh new file mode 100644 index 00000000000..8fadc671c9a --- /dev/null +++ b/pcre/pcre_test.sh @@ -0,0 +1,11 @@ +#! /bin/sh +# +srcdir="$1" +pcretest="$2" +cd "$3" +shift +shift +shift +. "$srcdir"/RunTest +if test "$?" != "0"; then exit 1; fi +# End diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index c736b0e82aa..708c36a58b0 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -203,9 +203,7 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS) SET(MYSQLD_LIB ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.lib) SET(MYSQLD_CORELIBS sql mysys dbug strings) FOREACH (CORELIB ${MYSQLD_CORELIBS}) - GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION) - FILE(TO_NATIVE_PATH ${LOC} LOC) - SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC}) + SET (LIB_LOCATIONS ${LIB_LOCATIONS} $<TARGET_FILE:${CORELIB}>) ENDFOREACH (CORELIB) SET(_PLATFORM x86) @@ -420,23 +418,20 @@ SET(DBOPT_FILE ${CMAKE_SOURCE_DIR}/support-files/db.opt ) INSTALL(FILES ${DBOPT_FILE} DESTINATION data/test COMPONENT DataFiles) # Install initial database on windows -IF(NOT CMAKE_CROSSCOMPILING) - GET_TARGET_PROPERTY(MYSQLD_EXECUTABLE mysqld LOCATION) -ENDIF() -IF(WIN32 AND MYSQLD_EXECUTABLE) - CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/cmake/create_initial_db.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake - @ONLY - ) - +IF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING) + IF(MSVC_IDE OR CMAKE_GENERATOR MATCHES "Xcode") SET (CONFIG_PARAM -DCONFIG=${CMAKE_CFG_INTDIR}) ENDIF() MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/data) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep - COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake + COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} + -DTOP_SRCDIR="${CMAKE_SOURCE_DIR}" + -DBINDIR="${CMAKE_CURRENT_BINARY_DIR}" + -DMYSQLD_EXECUTABLE="$<TARGET_FILE:mysqld>" + -DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}" + -P ${CMAKE_SOURCE_DIR}/cmake/create_initial_db.cmake COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data DEPENDS mysqld @@ -454,7 +449,7 @@ IF(WIN32 AND MYSQLD_EXECUTABLE) ELSE() # Not windows or cross compiling, just install an empty directory INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles) -ENDIF(WIN32 AND MYSQLD_EXECUTABLE) +ENDIF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING) ENDIF(INSTALL_LAYOUT STREQUAL "STANDALONE") IF(WIN32) diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 782d1f44bdf..9a08ff08425 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -338,14 +338,7 @@ IF(WIN32) # Install some extra files that belong to connect engine - # install ha_connect.lib - GET_TARGET_PROPERTY(CONNECT_LOCATION connect LOCATION) - STRING(REPLACE "dll" "lib" CONNECT_LIB ${CONNECT_LOCATION}) - IF(CMAKE_CONFIGURATION_TYPES) - STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" - CONNECT_LIB ${CONNECT_LIB}) - ENDIF() - INSTALL(FILES ${CONNECT_LIB} + INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib" DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine) ENDIF(WIN32) diff --git a/storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake b/storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake index e1da095fc00..3413339628f 100644 --- a/storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake +++ b/storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake @@ -3,17 +3,11 @@ # We use it in MySQL to merge mysys,dbug,vio etc into mysqlclient FUNCTION(TOKU_GET_DEPENDEND_OS_LIBS target result) SET(deps ${${target}_LIB_DEPENDS}) - IF(deps) - FOREACH(lib ${deps}) - # Filter out keywords for used for debug vs optimized builds - IF(NOT lib MATCHES "general" AND NOT lib MATCHES "debug" AND NOT lib MATCHES "optimized") - GET_TARGET_PROPERTY(lib_location ${lib} LOCATION) - IF(NOT lib_location) - SET(ret ${ret} ${lib}) - ENDIF() - ENDIF() - ENDFOREACH() - ENDIF() + FOREACH(lib ${deps}) + IF(TARGET ${lib}) + SET(ret ${ret} ${lib}) + ENDIF() + ENDFOREACH() SET(${result} ${ret} PARENT_SCOPE) ENDFUNCTION(TOKU_GET_DEPENDEND_OS_LIBS) diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt index d5dc3becba8..61bfe9e5568 100644 --- a/win/packaging/CMakeLists.txt +++ b/win/packaging/CMakeLists.txt @@ -123,11 +123,9 @@ ELSE() FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "\n}\n") SET(COPYING_RTF "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf") ENDIF() -GET_TARGET_PROPERTY(WIXCA_LOCATION wixca LOCATION) SET(CPACK_WIX_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake) -GET_TARGET_PROPERTY(upgrade_wizard_location mysql_upgrade_wizard LOCATION) -IF(NOT upgrade_wizard_location) +IF(NOT TARGET mysql_upgrade_wizard) SET(EXTRA_WIX_PREPROCESSOR_FLAGS "-dHaveUpgradeWizard=0") ENDIF() IF(WITH_INNOBASE_STORAGE_ENGINE) @@ -145,7 +143,6 @@ IF(WITH_THIRD_PARTY) ENDIF() ENDIF() -GET_TARGET_PROPERTY(LIBMYSQL_LOCATION libmysql LOCATION) FOREACH(third_party ${WITH_THIRD_PARTY}) SET(third_party_install_plugin ${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake) IF(NOT EXISTS ${third_party_install_plugin}) @@ -169,10 +166,6 @@ ENDIF() IF(NOT CPACK_WIX_UI) SET(CPACK_WIX_UI "MyWixUI_Mondo") ENDIF() -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake - @ONLY) - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) SET(WixWin64 " Win64='yes'") @@ -188,17 +181,69 @@ ENDIF() ADD_CUSTOM_TARGET( MSI - COMMAND ${CMAKE_COMMAND} - ${CONFIG_PARAM} - -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake + COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} + -DCANDLE_EXECUTABLE="${CANDLE_EXECUTABLE}" + -DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}" + -DCMAKE_FULL_VER="${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" + -DCMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P} + -DCOPYING_RTF="${COPYING_RTF}" + -DCPACK_WIX_CONFIG="${CPACK_WIX_CONFIG}" + -DCPACK_WIX_INCLUDE="${CPACK_WIX_INCLUDE}" + -DCPACK_WIX_PACKAGE_BASE_NAME="${CPACK_WIX_PACKAGE_BASE_NAME}" + -DCPACK_WIX_PACKAGE_NAME="${CPACK_WIX_PACKAGE_NAME}" + -DCPACK_WIX_UPGRADE_CODE="${CPACK_WIX_UPGRADE_CODE}" + -DEXTRA_WIX_PREPROCESSOR_FLAGS="${EXTRA_WIX_PREPROCESSOR_FLAGS}" + -DLIGHT_EXECUTABLE="${LIGHT_EXECUTABLE}" + -DMAJOR_VERSION="${MAJOR_VERSION}" + -DMANUFACTURER="${MANUFACTURER}" + -DMINOR_VERSION="${MINOR_VERSION}" + -DPATCH_VERSION="${PATCH_VERSION}" + -DSIGNCODE="${SIGNCODE}" + -DSIGNTOOL_EXECUTABLE="${SIGNTOOL_EXECUTABLE}" + -DSIGNTOOL_PARAMETERS="${SIGNTOOL_PARAMETERS}" + -DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}" + -DTHIRD_PARTY_DOWNLOAD_LOCATION="${THIRD_PARTY_DOWNLOAD_LOCATION}" + -DTHIRD_PARTY_FEATURE_CONDITION="${THIRD_PARTY_FEATURE_CONDITION}" + -DTINY_VERSION="${TINY_VERSION}" + -DTOP_BINDIR="${CMAKE_BINARY_DIR}" + -DVERSION="${VERSION}" + -DWITH_THIRD_PARTY="${WITH_THIRD_PARTY}" + -DWIXCA_LOCATION="$<TARGET_FILE:wixca>" + -P ${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake ) ADD_DEPENDENCIES(MSI wixca) ADD_CUSTOM_TARGET( MSI_ESSENTIALS - COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1 - ${CONFIG_PARAM} - -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake + COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DESSENTIALS=1 + -DCANDLE_EXECUTABLE="${CANDLE_EXECUTABLE}" + -DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}" + -DCMAKE_FULL_VER="${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" + -DCMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P} + -DCOPYING_RTF="${COPYING_RTF}" + -DCPACK_WIX_CONFIG="${CPACK_WIX_CONFIG}" + -DCPACK_WIX_INCLUDE="${CPACK_WIX_INCLUDE}" + -DCPACK_WIX_PACKAGE_BASE_NAME="${CPACK_WIX_PACKAGE_BASE_NAME}" + -DCPACK_WIX_PACKAGE_NAME="${CPACK_WIX_PACKAGE_NAME}" + -DCPACK_WIX_UPGRADE_CODE="${CPACK_WIX_UPGRADE_CODE}" + -DEXTRA_WIX_PREPROCESSOR_FLAGS="${EXTRA_WIX_PREPROCESSOR_FLAGS}" + -DLIGHT_EXECUTABLE="${LIGHT_EXECUTABLE}" + -DMAJOR_VERSION="${MAJOR_VERSION}" + -DMANUFACTURER="${MANUFACTURER}" + -DMINOR_VERSION="${MINOR_VERSION}" + -DPATCH_VERSION="${PATCH_VERSION}" + -DSIGNCODE="${SIGNCODE}" + -DSIGNTOOL_EXECUTABLE="${SIGNTOOL_EXECUTABLE}" + -DSIGNTOOL_PARAMETERS="${SIGNTOOL_PARAMETERS}" + -DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}" + -DTHIRD_PARTY_DOWNLOAD_LOCATION="${THIRD_PARTY_DOWNLOAD_LOCATION}" + -DTHIRD_PARTY_FEATURE_CONDITION="${THIRD_PARTY_FEATURE_CONDITION}" + -DTINY_VERSION="${TINY_VERSION}" + -DTOP_BINDIR="${CMAKE_BINARY_DIR}" + -DVERSION="${VERSION}" + -DWITH_THIRD_PARTY="${WITH_THIRD_PARTY}" + -DWIXCA_LOCATION="$<TARGET_FILE:wixca>" + -P ${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake ) ADD_DEPENDENCIES(MSI_ESSENTIALS wixca) diff --git a/win/packaging/create_msi.cmake.in b/win/packaging/create_msi.cmake index c37f7ca9d1d..f0407684ff3 100644 --- a/win/packaging/create_msi.cmake.in +++ b/win/packaging/create_msi.cmake @@ -1,35 +1,3 @@ -SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@") -SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@") -SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@") -SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@") -SET(CMAKE_COMMAND "@CMAKE_COMMAND@") -SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@") -SET(VERSION "@VERSION@") -SET(MAJOR_VERSION "@MAJOR_VERSION@") -SET(MINOR_VERSION "@MINOR_VERSION@") -SET(PATCH_VERSION "@PATCH_VERSION@") -SET(TINY_VERSION "@TINY_VERSION@") -SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@) -SET(MANUFACTURER "@MANUFACTURER@") -SET(WIXCA_LOCATION "@WIXCA_LOCATION@") -SET(COPYING_RTF "@COPYING_RTF@") -SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@") -SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@") -SET(CPACK_WIX_UPGRADE_CODE "@CPACK_WIX_UPGRADE_CODE@") -SET(CPACK_WIX_PACKAGE_NAME "@CPACK_WIX_PACKAGE_NAME@") -SET(CPACK_WIX_PACKAGE_BASE_NAME "@CPACK_WIX_PACKAGE_BASE_NAME@") -SET(SIGNCODE "@SIGNCODE@") -SET(SIGNTOOL_EXECUTABLE "@SIGNTOOL_EXECUTABLE@") -SET(SIGNTOOL_PARAMETERS "@SIGNTOOL_PARAMETERS@") -SET(CMAKE_FULL_VER - "@CMAKE_MAJOR_VERSION@.@CMAKE_MINOR_VERSION@.@CMAKE_PATCH_VERSION@") -SET(EXTRA_WIX_PREPROCESSOR_FLAGS "@EXTRA_WIX_PREPROCESSOR_FLAGS@") -SET(WITH_THIRD_PARTY "@WITH_THIRD_PARTY@") -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}}") @@ -45,19 +13,15 @@ MACRO(MAKE_WIX_IDENTIFIER str varname) ENDMACRO() SET($ENV{VS_UNICODE_OUTPUT} "") -IF(LIBMYSQL_LOCATION AND CMAKE_CFG_INTDIR) - # resolve libmysql full path - STRING(REPLACE "${CMAKE_CFG_INTDIR}" "${CMAKE_INSTALL_CONFIG_NAME}" LIBMYSQL_LOCATION "${LIBMYSQL_LOCATION}") -ENDIF() - + FOREACH(third_party ${WITH_THIRD_PARTY}) - INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake) + INCLUDE(${SRCDIR}/${third_party}.cmake) # Check than above script produced ${third_party}.wxi and ${third_party}_feature.wxi FOREACH(outfile ${third_party}.wxi ${third_party}_feature.wxi) IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${outfile}) MESSAGE(FATAL_ERROR - "${CMAKE_CURRENT_SOURCE_DIR}/${third_party}.cmake did not produce " + "${SRCDIR}/${third_party}.cmake did not produce " "${CMAKE_CURRENT_BINARY_DIR}/${outfile}" ) ENDIF() @@ -79,7 +43,7 @@ ENDIF() SET(ENV{VS_UNICODE_OUTPUT}) -INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake) +INCLUDE(${TOP_BINDIR}/CPackConfig.cmake) IF(CPACK_WIX_CONFIG) INCLUDE(${CPACK_WIX_CONFIG}) @@ -101,13 +65,13 @@ FOREACH(comp ${COMPONENTS_ALL}) SET(ENV{DESTDIR} testinstall/${comp}) EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp} - -DCMAKE_INSTALL_PREFIX= -P ${CMAKE_BINARY_DIR}/cmake_install.cmake + -DCMAKE_INSTALL_PREFIX= -P ${TOP_BINDIR}/cmake_install.cmake OUTPUT_QUIET ) # Exclude empty install components SET(INCLUDE_THIS_COMPONENT 1) - SET(MANIFEST_FILENAME "${CMAKE_BINARY_DIR}/install_manifest_${comp}.txt") + SET(MANIFEST_FILENAME "${TOP_BINDIR}/install_manifest_${comp}.txt") IF(EXISTS ${MANIFEST_FILENAME}) FILE(READ ${MANIFEST_FILENAME} content) STRING(LENGTH "${content}" content_length) @@ -385,9 +349,9 @@ SET(CPACK_WIX_INCLUDES ENDFOREACH() -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in +CONFIGURE_FILE(${SRCDIR}/mysql_server.wxs.in ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/extra.wxs.in +CONFIGURE_FILE(${SRCDIR}/extra.wxs.in ${CMAKE_CURRENT_BINARY_DIR}/extra.wxs) SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}") @@ -432,6 +396,6 @@ IF(SIGNCODE) ) ENDIF() CONFIGURE_FILE(${CPACK_PACKAGE_FILE_NAME}.msi - ${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.msi + ${TOP_BINDIR}/${CPACK_PACKAGE_FILE_NAME}.msi COPYONLY) diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in index 819bcc36ecb..a71ef982896 100644 --- a/win/packaging/extra.wxs.in +++ b/win/packaging/extra.wxs.in @@ -71,8 +71,8 @@ <!-- User interface dialogs --> - <WixVariable Id='WixUIBannerBmp' Value='@CMAKE_CURRENT_SOURCE_DIR@\WixUIBannerBmp.jpg' /> - <WixVariable Id='WixUIDialogBmp' Value='@CMAKE_CURRENT_SOURCE_DIR@\WixUIDialogBmp.jpg' /> + <WixVariable Id='WixUIBannerBmp' Value='@SRCDIR@\WixUIBannerBmp.jpg' /> + <WixVariable Id='WixUIDialogBmp' Value='@SRCDIR@\WixUIDialogBmp.jpg' /> <UI> <!-- Dialog on uninstall of the database --> diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake index 569ae4d8ed5..77a0bc05e70 100644 --- a/win/packaging/heidisql.cmake +++ b/win/packaging/heidisql.cmake @@ -13,11 +13,5 @@ IF(NOT EXISTS ${HEIDISQL_DOWNLOAD_DIR}/${HEIDISQL_ZIP}) ENDIF() SET(LIBMYSQLDLL_SOURCE ${HEIDISQL_DOWNLOAD_DIR}/libmysql.dll) -IF(CMAKE_SIZEOF_VOID_P EQUAL 4) - # Use our libmysql if it is 32 bit. - IF(LIBMYSQL_LOCATION) - SET(LIBMYSQLDLL_SOURCE "${LIBMYSQL_LOCATION}") - ENDIF() -ENDIF() CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql.wxi) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/heidisql_feature.wxi.in ${CMAKE_CURRENT_BINARY_DIR}/heidisql_feature.wxi) diff --git a/win/upgrade_wizard/CMakeLists.txt b/win/upgrade_wizard/CMakeLists.txt index 81c9c0d572c..f4148ee98d2 100644 --- a/win/upgrade_wizard/CMakeLists.txt +++ b/win/upgrade_wizard/CMakeLists.txt @@ -46,9 +46,8 @@ SET_TARGET_PROPERTIES(mysql_upgrade_wizard PROPERTIES WIN32_EXECUTABLE 1) # to change service configuration. Due to a CMake bug http://www.vtk.org/Bug/view.php?id=11171 # it is not possible currenly to do it with linker flags. Work around is to use # manifest tool mt.exe and embed the manifest post-build. -GET_TARGET_PROPERTY(upgrade_wizard_location mysql_upgrade_wizard LOCATION) ADD_CUSTOM_COMMAND( TARGET mysql_upgrade_wizard POST_BUILD COMMAND mt.exe -manifest ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_wizard.exe.manifest - "-outputresource:${upgrade_wizard_location};#1" + "-outputresource:$<TARGET_FILE:mysql_upgrade_wizard>;#1" ) |