summaryrefslogtreecommitdiff
path: root/cmake/install_macros.cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-12-12 02:03:05 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-12-12 02:03:05 +0100
commitcedb6101db403430d593431478fddd3c3da9b267 (patch)
tree4007236a6bd4922f17a327fd7e196d8bda1a9350 /cmake/install_macros.cmake
parenta6f6932e26f74557f674bc848271ed6a28de5bb6 (diff)
downloadmariadb-git-cedb6101db403430d593431478fddd3c3da9b267.tar.gz
Cleanup, use MYSQL_INSTALL_TARGETS macro instead of INSTALL(TARGETS) combined with
INSTALL_DEBUG_SYMBOLS
Diffstat (limited to 'cmake/install_macros.cmake')
-rw-r--r--cmake/install_macros.cmake28
1 files changed, 28 insertions, 0 deletions
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index 3925ce292de..b1f03b40fe6 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -13,6 +13,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
MACRO (INSTALL_DEBUG_SYMBOLS targets)
IF(MSVC)
FOREACH(target ${targets})
@@ -69,3 +71,29 @@ IF(UNIX)
ENDIF()
ENDMACRO()
+# Installs targets, also installs pdbs on Windows.
+#
+# More stuff can be added later, e.g signing
+# or pre-link custom targets (one example is creating
+# version resource for windows executables)
+
+FUNCTION(MYSQL_INSTALL_TARGETS)
+ CMAKE_PARSE_ARGUMENTS(ARG
+ "DESTINATION"
+ ""
+ ${ARGN}
+ )
+ SET(TARGETS ${ARG_DEFAULT_ARGS})
+ IF(NOT TARGETS)
+ MESSAGE(FATAL_ERROR "Need target list for MYSQL_INSTALL_TARGETS")
+ ENDIF()
+ IF(NOT ARG_DESTINATION)
+ MESSAGE(FATAL_ERROR "Need DESTINATION parameter for MYSQL_INSTALL_TARGETS")
+ ENDIF()
+ MESSAGE("INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION})")
+ INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION})
+ SET(INSTALL_LOCATION ${ARG_DESTINATION} )
+ INSTALL_DEBUG_SYMBOLS("${TARGETS}")
+ SET(INSTALL_LOCATION)
+ENDFUNCTION()
+