speed-dreams-code/cmake/packagemaker-dmg.cmake
xavi92 014f82c37c Fix trailing whitespaces and ending newlines
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9552 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: f126eada2ef5b97c10fbb59d74901bcc03303a19
Former-commit-id: df90a174acb9bc1810f0f24cfc186ff2bc36d420
2024-09-30 05:23:49 +00:00

75 lines
3.1 KiB
CMake

#==============================================================================
#
# file : packagemaker-dmg.cmake
# copyright : (C) 2020 Joe Thompson
# email : beaglejoe@users.sourceforge.net
# web : www.speed-dreams.org
#
#==============================================================================
#
# 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, see <http://www.gnu.org/licenses/>.
#
#==============================================================================
IF((APPLE) AND ("${CMAKE_INSTALL_PREFIX}" MATCHES "\\.app$"))
MESSAGE(STATUS "TODO - need to clean this up.")
#ADD_CUSTOM_TARGET(package_base DEPENDS install)
# can't depend on built-in target install, so we ADD_CUSTOM_COMMAND
# below to make sure install is done
ADD_CUSTOM_TARGET(packing_install)
MESSAGE(STATUS "TODO - fix up the dependencies. Try to not run the install multiple times.")
#[[
ADD_CUSTOM_TARGET(package_all DEPENDS package_base
package_full)
ADD_CUSTOM_TARGET(package_base DEPENDS install_base)
ADD_CUSTOM_TARGET(package_full DEPENDS packing_install)
ADD_CUSTOM_TARGET(install_base DEPENDS packing_install)
]]
ADD_CUSTOM_TARGET(package_full)
ADD_CUSTOM_TARGET(package_base)
ADD_CUSTOM_TARGET(install_base)
ADD_CUSTOM_COMMAND(TARGET packing_install
COMMAND "${CMAKE_COMMAND}" --build . --target install --config $<CONFIG>
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Building install...")
ADD_CUSTOM_COMMAND(TARGET install_base
COMMAND "${CMAKE_COMMAND}" -P createbaseapp.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Creating base app...")
ADD_CUSTOM_COMMAND(TARGET package_base
COMMAND "${CMAKE_COMMAND}" -P packagebasedmg.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Building base package...")
# COMMAND ${CMAKE_CPACK_COMMAND} -G "DragNDrop" --config ../CPackDMGFullConfig.cmake
ADD_CUSTOM_COMMAND(TARGET package_full
COMMAND "${CMAKE_COMMAND}" -P packagefulldmg.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Building full package...")
ELSE((APPLE) AND ("${CMAKE_INSTALL_PREFIX}" MATCHES "\\.app$"))
MESSAGE(WARNING "Custom DMG creation requires *.app")
ENDIF((APPLE) AND ("${CMAKE_INSTALL_PREFIX}" MATCHES "\\.app$"))