linphone-desktop/linphone-app/cmake_builder/linphone_package/packaging.cmake.in
2020-03-26 16:44:31 +01:00

70 lines
2.7 KiB
CMake

############################################################################
# packaging.cmake
# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
set(DO_TGZ @CPACK_BINARY_TGZ@)
set(DO_TZ @CPACK_BINARY_TZ@)
set(DO_STGZ @CPACK_BINARY_STGZ@)
set(DO_DRAGANDDROP @CPACK_BINARY_DRAGNDROP@)
set(DO_GENERATOR @DO_GENERATOR@)
if (NOT "${CMAKE_INSTALL_PREFIX}" MATCHES .*/_CPack_Packages/.*)
if(DO_TGZ)
execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G TGZ RESULT_VARIABLE CPACK_COMMAND_RESULT)
if(CPACK_COMMAND_RESULT)
message(FATAL_ERROR "Failed to create TGZ package!")
endif()
endif()
if(DO_TZ)
execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G TZ RESULT_VARIABLE CPACK_COMMAND_RESULT)
if(CPACK_COMMAND_RESULT)
message(FATAL_ERROR "Failed to create TZ package!")
endif()
endif()
if(DO_STGZ)
execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G STGZ RESULT_VARIABLE CPACK_COMMAND_RESULT)
if(CPACK_COMMAND_RESULT)
message(FATAL_ERROR "Failed to create STGZ package!")
endif()
endif()
if(DO_DRAGANDDROP)
execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G DragAndDrop RESULT_VARIABLE CPACK_COMMAND_RESULT)
if(CPACK_COMMAND_RESULT)
message(FATAL_ERROR "Failed to create DragAndDrop package!")
endif()
endif()
if(DO_GENERATOR)
execute_process( COMMAND ${CMAKE_CPACK_COMMAND} -G @CPACK_GENERATOR@ RESULT_VARIABLE CPACK_COMMAND_RESULT)
if(CPACK_COMMAND_RESULT)
message(FATAL_ERROR "Failed to create @CPACK_GENERATOR@ package!")
endif()
endif()
if (@PERFORM_SIGNING@)
execute_process(
COMMAND @SIGNTOOL_COMMAND@ @CMAKE_CURRENT_BINARY_DIR@/@CPACK_PACKAGE_FILE_NAME@.@PACKAGE_EXT@
RESULT_VARIABLE SIGNING_RESULT
)
if(SIGNING_RESULT)
message(FATAL_ERROR "Failed to sign the package!")
endif()
endif ()
endif ()