diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-12-18 23:53:30 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-12-18 23:53:30 +0100 |
commit | 27c0d595e9e3a35232672209219ecc9b74004ab4 (patch) | |
tree | 5bd743311c627949ab06195560ba2e8fc844d41c /cmake/mysql_add_executable.cmake | |
parent | c7d19daba5987593b7cc7da7ff2f68e073d10838 (diff) | |
download | mariadb-git-27c0d595e9e3a35232672209219ecc9b74004ab4.tar.gz |
Simplify embedding version info into executables with ADD_VERSION_INFO
Diffstat (limited to 'cmake/mysql_add_executable.cmake')
-rw-r--r-- | cmake/mysql_add_executable.cmake | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake index 6df7c8dda33..cb0237332c2 100644 --- a/cmake/mysql_add_executable.cmake +++ b/cmake/mysql_add_executable.cmake @@ -37,53 +37,10 @@ FUNCTION (MYSQL_ADD_EXECUTABLE) LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
SET(sources ${ARG_DEFAULT_ARGS})
- IF(WIN32)
- ADD_VERSION_INFO(${target} VFT_APP sources)
- ENDIF()
ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
-
# tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL)
MYSQL_INSTALL_TARGETS(${target} DESTINATION bin)
ENDIF()
-ENDFUNCTION()
-
-# Function to embed version info into executables/dlls on Windows
-# Refer http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
-# for more information
-MACRO(ADD_VERSION_INFO target filetype sources)
- SET(HAVE_RC_FILE)
- FOREACH(src ${sources})
- IF("${src}" MATCHES "\\.rc$")
- SET(HAVE_RC_FILE 1)
- BREAK()
- ENDIF()
- ENDFOREACH()
- IF(NOT HAVE_RC_FILE)
- IF(NOT MAJOR_VERSION)
- MESSAGE(FATAL_ERROR "MAJOR_VERSION is not defined")
- ENDIF()
- IF(NOT MINOR_VERSION)
- MESSAGE(FATAL_ERROR "MINOR_VERSION is not defined")
- ENDIF()
- IF(NOT PATCH)
- SET(PATCH 0)
- ENDIF()
- SET(FILETYPE ${filetype})
- SET(INTERNALNAME ${target})
- IF(FILETYPE STREQUAL VFT_APP)
- SET(ORIGINALFILENAME ${target}.exe)
- ELSE()
- SET(ORIGINALFILENAME ${target}.dll)
- ENDIF()
- SET(FILEDESCRIPTION ${target})
- FIND_FILE(VERINFO_IN versioninfo.rc.in ${CMAKE_MODULE_PATH})
- IF(NOT VERINFO_IN)
- MESSAGE(FATAL_ERROR "cannot find version info template")
- ENDIF()
- CONFIGURE_FILE(${VERINFO_IN}
- ${CMAKE_CURRENT_BINARY_DIR}/${target}.rc)
- LIST(APPEND ${sources} ${CMAKE_CURRENT_BINARY_DIR}/${target}.rc)
- ENDIF()
- ENDMACRO()
\ No newline at end of file +ENDFUNCTION()
\ No newline at end of file |