summaryrefslogtreecommitdiff
path: root/cmake/install_macros.cmake
diff options
context:
space:
mode:
authorSachin Setiya <sachinsetia1001@gmail.com>2017-11-03 12:34:05 +0530
committerSachin Setiya <sachinsetia1001@gmail.com>2017-11-03 12:34:05 +0530
commit3cecb1bab381c256e43f0f095a7a02b115dfc7bc (patch)
treea0793f42f4e1d9269dba2d08acb5a4a917470ab9 /cmake/install_macros.cmake
parent53b4185e5823d784c9f358ac01ec18c5bab7e208 (diff)
parentc3592ca7b8864a2492d98db4d45a7684e979301d (diff)
downloadmariadb-git-3cecb1bab381c256e43f0f095a7a02b115dfc7bc.tar.gz
Merge tag 'mariadb-10.0.33' into bb-10.0-galerabb-10.0-sachin-galera
Diffstat (limited to 'cmake/install_macros.cmake')
-rw-r--r--cmake/install_macros.cmake64
1 files changed, 19 insertions, 45 deletions
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index 24659781b26..0d3e0607cf7 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -57,17 +57,8 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
ENDIF()
SET(targets ${ARG_DEFAULT_ARGS})
FOREACH(target ${targets})
- GET_TARGET_PROPERTY(type ${target} TYPE)
- GET_TARGET_PROPERTY(location ${target} LOCATION)
- STRING(REPLACE ".exe" ".pdb" pdb_location ${location})
- STRING(REPLACE ".dll" ".pdb" pdb_location ${pdb_location})
- STRING(REPLACE ".lib" ".pdb" pdb_location ${pdb_location})
- IF(CMAKE_GENERATOR MATCHES "Visual Studio")
- STRING(REPLACE
- "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
- pdb_location ${pdb_location})
- ENDIF()
-
+ GET_TARGET_PROPERTY(target_type ${target} TYPE)
+
set(comp "")
IF(ARG_COMPONENT STREQUAL "Server")
IF(target MATCHES "mysqld" OR type MATCHES "MODULE")
@@ -87,11 +78,9 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
IF(NOT comp)
SET(comp Debuginfo_archive_only) # not in MSI
ENDIF()
- IF(type MATCHES "STATIC")
- # PDB for static libraries might be unsupported http://public.kitware.com/Bug/view.php?id=14600
- SET(opt OPTIONAL)
- ENDIF()
- INSTALL(FILES ${pdb_location} DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp} ${opt})
+ IF(NOT target_type MATCHES "STATIC")
+ INSTALL(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp})
+ ENDIF()
ENDFOREACH()
ENDIF()
ENDFUNCTION()
@@ -243,37 +232,22 @@ IF(WIN32)
ENDIF()
ENDIF()
-MACRO(SIGN_TARGET)
- MYSQL_PARSE_ARGUMENTS(ARG "COMPONENT" "" ${ARGN})
- SET(target ${ARG_DEFAULT_ARGS})
- IF(ARG_COMPONENT)
- SET(comp COMPONENT ${ARG_COMPONENT})
- ELSE()
- SET(comp)
- ENDIF()
- GET_TARGET_PROPERTY(target_type ${target} TYPE)
- IF(target_type AND NOT target_type MATCHES "STATIC")
- GET_TARGET_PROPERTY(target_location ${target} LOCATION)
- IF(CMAKE_GENERATOR MATCHES "Visual Studio")
- STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
- target_location ${target_location})
- ENDIF()
- INSTALL(CODE
- "EXECUTE_PROCESS(COMMAND
- \"${SIGNTOOL_EXECUTABLE}\" verify /pa /q \"${target_location}\"
- RESULT_VARIABLE ERR)
- IF(NOT \${ERR} EQUAL 0)
- EXECUTE_PROCESS(COMMAND
- \"${SIGNTOOL_EXECUTABLE}\" sign ${SIGNTOOL_PARAMETERS} \"${target_location}\"
- RESULT_VARIABLE ERR)
+
+FUNCTION(SIGN_TARGET target)
+ IF(NOT SIGNCODE)
+ RETURN()
ENDIF()
- IF(NOT \${ERR} EQUAL 0)
- MESSAGE(FATAL_ERROR \"Error signing '${target_location}'\")
+ GET_TARGET_PROPERTY(target_type ${target} TYPE)
+ IF((NOT target_type) OR (target_type MATCHES "STATIC"))
+ RETURN()
ENDIF()
- " ${comp})
- ENDIF()
-ENDMACRO()
-
+ # Mark executable for signing by creating empty *.signme file
+ # The actual signing happens in preinstall step
+ # (which traverses
+ ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E touch "$<TARGET_FILE:${target}>.signme"
+ )
+ENDFUNCTION()
# Installs targets, also installs pdbs on Windows.
#