Added logic to generate a mac osx drag and drop package.

This commit is contained in:
mjbudd77 2020-07-12 11:50:18 -04:00
parent 1a3427685e
commit 70a2b3023a
3 changed files with 51 additions and 12 deletions

BIN
fceux.icns Normal file

Binary file not shown.

View File

@ -6,6 +6,10 @@ pwd
uname -a
sw_vers
FCEUX_VERSION_MAJOR=2
FCEUX_VERSION_MINOR=2
FCEUX_VERSION_PATCH=3
SCRIPT_DIR=$( cd $(dirname $BASH_SOURCE[0]); pwd );
NPROC=`getconf _NPROCESSORS_ONLN`;
@ -53,23 +57,21 @@ cd build;
#$QMAKE ..
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX/usr \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_PROJECT_VERSION_MAJOR=$FCEUX_VERSION_MAJOR \
-DCMAKE_PROJECT_VERSION_MINOR=$FCEUX_VERSION_MINOR \
-DCMAKE_PROJECT_VERSION_PATCH=$FCEUX_VERSION_PATCH \
-DCPACK_PACKAGE_VERSION_MAJOR=$FCEUX_VERSION_MAJOR \
-DCPACK_PACKAGE_VERSION_MINOR=$FCEUX_VERSION_MINOR \
-DCPACK_PACKAGE_VERSION_PATCH=$FCEUX_VERSION_PATCH \
.. || exit 1
make -j $NPROC || exit 1
make install || exit 1
cpack -G DragNDrop || exit 1
# Debug via ssh if necessary
if [ ! -z $APPVEYOR_SSH_BLOCK ]; then
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
fi
if [ -e $INSTALL_PREFIX/usr/bin/fceux ]; then
echo '**************************************************************'
echo 'Printing Shared Object Dependencies for fceux Executable'
echo '**************************************************************'
otool -L $INSTALL_PREFIX/usr/bin/fceux
else
echo "Error: Executable Failed to build: $INSTALL_PREFIX/usr/bin/fceux";
exit 1;
fi

View File

@ -3,6 +3,8 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set( APP_NAME fceux)
if(WIN32)
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_WIN})
include_directories( ${CMAKE_SOURCE_DIR}/src/drivers/win/directx ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib )
@ -410,9 +412,20 @@ add_custom_command(
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp PROPERTY SKIP_AUTOGEN ON)
add_executable( fceux ${SOURCES} ../resources.qrc
if (APPLE)
set(MACOSX_BUNDLE_ICON_FILE fceux.icns)
set(APP_ICON ${CMAKE_SOURCE_DIR}/fceux.icns )
set_source_files_properties( ${APP_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources" )
add_executable( ${APP_NAME} MACOSX_BUNDLE ${APP_ICON} ${SOURCES} ../resources.qrc
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
else()
add_executable( ${APP_NAME} ${SOURCES} ../resources.qrc
${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp)
endif()
target_link_libraries( fceux
${Qt5Widgets_LIBRARIES}
${Qt5OpenGL_LIBRARIES}
@ -423,7 +436,29 @@ target_link_libraries( fceux
${SYS_LIBS}
)
install( TARGETS fceux
if (APPLE)
install( TARGETS ${APP_NAME}
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime )
set( APPS ${CMAKE_INSTALL_PREFIX}/${APP_NAME}.app)
set( DIRS ${CMAKE_BINARY_DIR} /usr/local/lib)
message(STATUS APPS: ${APPS})
message(STATUS DIRS: ${DIRS} )
#set(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/fceux.icns )
#set(CPACK_BUNDLE_ICON ${CMAKE_SOURCE_DIR}/fceux.icns )
set(CPACK_GENERATOR "DRAGNDROP")
include(CPACK)
install( CODE "include(BundleUtilities)
fixup_bundle( \"${APPS}\" \"\" \"${DIRS}\") ")
else(APPLE)
install( TARGETS ${APP_NAME}
RUNTIME DESTINATION bin )
install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/auxlib.lua DESTINATION share/fceux/luaScripts )
@ -432,3 +467,5 @@ install( FILES ${CMAKE_SOURCE_DIR}/fceux.png DESTINA
install( FILES ${CMAKE_SOURCE_DIR}/fceux.desktop DESTINATION share/applications )
install( FILES ${CMAKE_SOURCE_DIR}/documentation/fceux.6 DESTINATION share/man/man6 )
install( FILES ${CMAKE_SOURCE_DIR}/documentation/fceux-net-server.6 DESTINATION share/man/man6 )
endif(APPLE)