|
1 |
| -# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
2 |
| -# |
3 |
| -# This program is free software; you can redistribute it and/or modify |
4 |
| -# it under the terms of the GNU General Public License as published by |
5 |
| -# the Free Software Foundation; version 2 of the License. |
6 |
| -# |
7 |
| -# This program is distributed in the hope that it will be useful, |
8 |
| -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 |
| -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 |
| -# GNU General Public License for more details. |
11 |
| -# |
12 |
| -# You should have received a copy of the GNU General Public License |
13 |
| -# along with this program; if not, write to the Free Software |
14 |
| -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
15 |
| - |
16 |
| -# Add executable plus some additional MySQL specific stuff |
17 |
| -# Usage (same as for standard CMake's ADD_EXECUTABLE) |
18 |
| -# |
19 |
| -# MYSQL_ADD_EXECUTABLE(target source1...sourceN) |
20 |
| -# |
21 |
| -# MySQL specifics: |
22 |
| -# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory |
23 |
| -# On Windows : |
24 |
| -# - add version resource |
25 |
| -# - instruct CPack to do autenticode signing if SIGNCODE is set |
26 |
| - |
27 |
| -INCLUDE(cmake_parse_arguments) |
28 |
| - |
29 |
| -FUNCTION (MYSQL_ADD_EXECUTABLE) |
30 |
| - # Pass-through arguments for ADD_EXECUTABLE |
31 |
| - MYSQL_PARSE_ARGUMENTS(ARG |
32 |
| - "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" |
33 |
| - "" |
34 |
| - ${ARGN} |
35 |
| - ) |
36 |
| - LIST(GET ARG_DEFAULT_ARGS 0 target) |
37 |
| - LIST(REMOVE_AT ARG_DEFAULT_ARGS 0) |
38 |
| - |
39 |
| - SET(sources ${ARG_DEFAULT_ARGS}) |
40 |
| - ADD_VERSION_INFO(${target} EXECUTABLE sources) |
41 |
| - ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources}) |
42 |
| - # tell CPack where to install |
43 |
| - IF(NOT ARG_EXCLUDE_FROM_ALL) |
44 |
| - IF(NOT ARG_DESTINATION) |
45 |
| - SET(ARG_DESTINATION ${INSTALL_BINDIR}) |
| 1 | +# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. |
| 2 | +# |
| 3 | +# This program is free software; you can redistribute it and/or modify |
| 4 | +# it under the terms of the GNU General Public License as published by |
| 5 | +# the Free Software Foundation; version 2 of the License. |
| 6 | +# |
| 7 | +# This program is distributed in the hope that it will be useful, |
| 8 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | +# GNU General Public License for more details. |
| 11 | +# |
| 12 | +# You should have received a copy of the GNU General Public License |
| 13 | +# along with this program; if not, write to the Free Software |
| 14 | +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 15 | + |
| 16 | +# Add executable plus some additional MySQL specific stuff |
| 17 | +# Usage (same as for standard CMake's ADD_EXECUTABLE) |
| 18 | +# |
| 19 | +# MYSQL_ADD_EXECUTABLE(target source1...sourceN) |
| 20 | +# |
| 21 | +# MySQL specifics: |
| 22 | +# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory |
| 23 | +# On Windows : |
| 24 | +# - add version resource |
| 25 | +# - instruct CPack to do autenticode signing if SIGNCODE is set |
| 26 | + |
| 27 | +INCLUDE(cmake_parse_arguments) |
| 28 | + |
| 29 | +FUNCTION (MYSQL_ADD_EXECUTABLE) |
| 30 | + # Pass-through arguments for ADD_EXECUTABLE |
| 31 | + MYSQL_PARSE_ARGUMENTS(ARG |
| 32 | + "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" |
| 33 | + "" |
| 34 | + ${ARGN} |
| 35 | + ) |
| 36 | + LIST(GET ARG_DEFAULT_ARGS 0 target) |
| 37 | + LIST(REMOVE_AT ARG_DEFAULT_ARGS 0) |
| 38 | + |
| 39 | + SET(sources ${ARG_DEFAULT_ARGS}) |
| 40 | + ADD_VERSION_INFO(${target} EXECUTABLE sources) |
| 41 | + ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources}) |
| 42 | + # tell CPack where to install |
| 43 | + IF(NOT ARG_EXCLUDE_FROM_ALL) |
| 44 | + IF(NOT ARG_DESTINATION) |
| 45 | + SET(ARG_DESTINATION ${INSTALL_BINDIR}) |
46 | 46 | ENDIF()
|
47 | 47 | IF(ARG_COMPONENT)
|
48 | 48 | SET(COMP COMPONENT ${ARG_COMPONENT})
|
49 | 49 | ELSEIF(MYSQL_INSTALL_COMPONENT)
|
50 | 50 | SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT})
|
51 | 51 | ELSE()
|
52 | 52 | SET(COMP COMPONENT Client)
|
53 |
| - ENDIF() |
54 |
| - MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) |
55 |
| - ENDIF() |
| 53 | + ENDIF() |
| 54 | + MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) |
| 55 | + ENDIF() |
56 | 56 | ENDFUNCTION()
|
0 commit comments