speed-dreams-code/cmake/packagemaker-dmg.cmake
beaglejoe ccec0ee45f WIP for ticket 1047 Automate the Build and Package cycle for MacOS
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6928 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 4f47f101cd9c62184e1469496a0e2bb3eeca6525
Former-commit-id: 8b036490454775236451f00caf9f78684e8d1181
2020-04-20 02:34:33 +00:00

66 lines
No EOL
2.7 KiB
CMake

#==============================================================================
#
# file : packagemaker-dmg.cmake
# copyright : (C) 2020 Joe Thompson
# email : beaglejoe@users.sourceforge.net
# web : www.speed-dreams.org
# version : $Id:$
#
#==============================================================================
#
# 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)
#[[
ADD_CUSTOM_TARGET(package_all DEPENDS package_base
package_full)
ADD_CUSTOM_TARGET(package_base DEPENDS packing_install)
ADD_CUSTOM_TARGET(package_full DEPENDS packing_install)
]]
ADD_CUSTOM_TARGET(package_full)
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 package_base
COMMAND ${CMAKE_CPACK_COMMAND} -G "DragNDrop"--config ../CPackDMGBaseConfig.cmake
WORKING_DIRECTORY packaging
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$"))