diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-11-12 13:42:50 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-11-12 13:42:50 +0100 |
commit | 36fffdeaa22c7208d3744613a7bd7bbe6e49b394 (patch) | |
tree | 2a9de33eb5ae75bb7de7ffa7ac486e42126b9bca /cmake/mysql_version.cmake | |
parent | 5a8b8b6493b11a07973f5ee16885a9d8b9cbb456 (diff) | |
download | mariadb-git-36fffdeaa22c7208d3744613a7bd7bbe6e49b394.tar.gz |
Bug#58074: ADD_VERSION_INFO cmake/mysql_version.cmake fails if LINK_FLAGS are modified
Backport version info handling (Windows-specific) from next-mr.
Instead of adding ".res" object as linker flag, add resource file (.rc) file to the source list.
This is more obvious and less error prone method.
Diffstat (limited to 'cmake/mysql_version.cmake')
-rw-r--r-- | cmake/mysql_version.cmake | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 886d7b9e8a9..9f0f7729c22 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -133,9 +133,8 @@ ENDIF() # Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx # for more info. IF(MSVC) - GET_TARGET_PROPERTY(location gen_versioninfo LOCATION) - IF(NOT location) GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) + SET(FILETYPE VFT_APP) CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in ${CMAKE_BINARY_DIR}/versioninfo_exe.rc) @@ -143,31 +142,14 @@ IF(MSVC) SET(FILETYPE VFT_DLL) CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in ${CMAKE_BINARY_DIR}/versioninfo_dll.rc) - - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_BINARY_DIR}/versioninfo_exe.res - ${CMAKE_BINARY_DIR}/versioninfo_dll.res - COMMAND ${CMAKE_RC_COMPILER} versioninfo_exe.rc - COMMAND ${CMAKE_RC_COMPILER} versioninfo_dll.rc - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - ) - ADD_CUSTOM_TARGET(gen_versioninfo - DEPENDS - ${CMAKE_BINARY_DIR}/versioninfo_exe.res - ${CMAKE_BINARY_DIR}/versioninfo_dll.res - ) - ENDIF() - - FUNCTION(ADD_VERSION_INFO target) - GET_TARGET_PROPERTY(target_type ${target} TYPE) - ADD_DEPENDENCIES(${target} gen_versioninfo) - IF(target_type MATCHES "SHARED" OR target_type MATCHES "MODULE") - SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS - "\"${CMAKE_BINARY_DIR}/versioninfo_dll.res\"") - ELSEIF(target_type MATCHES "EXE") - SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS - "${target_link_flags} \"${CMAKE_BINARY_DIR}/versioninfo_exe.res\"") + + FUNCTION(ADD_VERSION_INFO target target_type sources_var) + IF("${target_type}" MATCHES "SHARED" OR "${target_type}" MATCHES "MODULE") + SET(rcfile ${CMAKE_BINARY_DIR}/versioninfo_dll.rc) + ELSEIF("${target_type}" MATCHES "EXE") + SET(rcfile ${CMAKE_BINARY_DIR}/versioninfo_exe.rc) ENDIF() + SET(${sources_var} ${${sources_var}} ${rcfile} PARENT_SCOPE) ENDFUNCTION() ELSE() FUNCTION(ADD_VERSION_INFO) |