diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-02-20 20:40:03 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-02-20 20:40:03 +0100 |
commit | 740c7cf4fa29ccfce60f6c30dc8a14bd302cfed2 (patch) | |
tree | b6d8d4ef948a9702ac690635ea65ea22abe05f69 /cmake | |
parent | 5f833a39ed92acaf482d56c3de871ff0115ffcbd (diff) | |
download | mariadb-git-740c7cf4fa29ccfce60f6c30dc8a14bd302cfed2.tar.gz |
Install static client and embedded debug libraries
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/install_macros.cmake | 50 | ||||
-rw-r--r-- | cmake/os/Windows.cmake | 1 |
2 files changed, 51 insertions, 0 deletions
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index 8a201cbb026..1dcf8b5ca21 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -161,3 +161,53 @@ FUNCTION(MYSQL_INSTALL_TARGETS) SET(INSTALL_LOCATION) ENDFUNCTION() +# Optionally install mysqld/client/embedded from debug build run. outside of the current build dir +# (unless multi-config generator is used like Visual Studio or Xcode). +# For Makefile generators we default Debug build directory to ${buildroot}/../debug. +GET_FILENAME_COMPONENT(BINARY_PARENTDIR ${CMAKE_BINARY_DIR} PATH) +SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug build") + + +FUNCTION(INSTALL_DEBUG_TARGET target) + CMAKE_PARSE_ARGUMENTS(ARG + "DESTINATION;RENAME" + "" + ${ARGN} + ) + GET_TARGET_PROPERTY(target_type ${target} TYPE) + IF(ARG_RENAME) + SET(RENAME_PARAM RENAME ${ARG_RENAME}${CMAKE_${target_type}_SUFFIX}) + ELSE() + SET(RENAME_PARAM) + ENDIF() + IF(NOT ARG_DESTINATION) + MESSAGE(FATAL_ERROR "Need DESTINATION parameter for INSTALL_DEBUG_TARGET") + ENDIF() + GET_TARGET_PROPERTY(target_location ${target} LOCATION) + IF(CMAKE_GENERATOR MATCHES "Makefiles") + STRING(REPLACE "${CMAKE_BINARY_DIR}" "${DEBUGBUILDDIR}" debug_target_location "${target_location}") + ELSE() + STRING(REPLACE "${CMAKE_CFG_INTDIR}" "Debug" debug_target_location "${target_location}" ) + ENDIF() + + INSTALL(FILES ${debug_target_location} + DESTINATION ${ARG_DESTINATION} + ${RENAME_PARAM} + CONFIGURATIONS Release RelWithDebInfo + OPTIONAL) + + IF(MSVC) + GET_FILENAME_COMPONENT(ext ${debug_target_location} EXT) + STRING(REPLACE "${ext}" ".pdb" debug_pdb_target_location "${debug_target_location}" ) + IF(RENAME_PARAM) + STRING(REPLACE "${ext}" ".pdb" "${ARG_RENAME}" pdb_rename) + SET(PDB_RENAME_PARAM RENAME ${pdb_rename}) + ENDIF() + INSTALL(FILES ${debug_pdb_target_location} + DESTINATION ${ARG_DESTINATION} + ${RPDB_RENAME_PARAM} + CONFIGURATIONS Release RelWithDebInfo + OPTIONAL) + ENDIF() +ENDFUNCTION() + diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 7c2cb535f50..f610ce9068a 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -88,6 +88,7 @@ IF(MSVC) # Fix CMake's predefined huge stack size FOREACH(type EXE SHARED MODULE) STRING(REGEX REPLACE "/STACK:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS}") + STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}") ENDFOREACH() ADD_DEFINITIONS(-DPTHREAD_STACK_MIN=1048576) |