Restructure Mac builds as Nostalgia.app

This commit is contained in:
Gary Talent 2017-10-20 22:14:33 -05:00
parent 2915b48130
commit b6b9181c66
6 changed files with 49 additions and 8 deletions

View File

@ -28,11 +28,21 @@ if(NOSTALGIA_IDE_BUILD STREQUAL "ON")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif() endif()
if (APPLE) if(APPLE)
set(CMAKE_MACOSX_RPATH ON) set(CMAKE_MACOSX_RPATH OFF)
set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Library/nostalgia")
set(NOSTALGIA_DIST_BIN Nostalgia.app/Contents/MacOS)
set(NOSTALGIA_DIST_LIB Nostalgia.app/Contents/Library)
set(NOSTALGIA_DIST_PLUGIN Nostalgia.app/Contents/Plugins)
set(NOSTALGIA_DIST_RESOURCES Nostalgia.app/Contents/Resources)
set(NOSTALGIA_DIST_MAC_APP_CONTENTS Nostalgia.app/Contents)
else() else()
set(CMAKE_INSTALL_RPATH "$ORIGIN" "$ORIGIN/../lib/nostalgia") set(CMAKE_INSTALL_RPATH "$ORIGIN" "$ORIGIN/../lib/nostalgia")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(NOSTALGIA_DIST_BIN bin)
set(NOSTALGIA_DIST_LIB lib)
set(NOSTALGIA_DIST_PLUGIN lib)
set(NOSTALGIA_DIST_RESOURCES share)
endif() endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release") if (CMAKE_BUILD_TYPE STREQUAL "Release")

View File

@ -21,7 +21,7 @@ install(
TARGETS TARGETS
NostalgiaCore-Studio NostalgiaCore-Studio
LIBRARY DESTINATION LIBRARY DESTINATION
lib/nostalgia ${NOSTALGIA_DIST_PLUGIN}/nostalgia
) )
install( install(

View File

@ -24,18 +24,27 @@ target_link_libraries(
NostalgiaTool NostalgiaTool
) )
if(APPLE)
install(
FILES
Info.plist
DESTINATION
${NOSTALGIA_DIST_MAC_APP_CONTENTS}
)
endif()
install( install(
FILES FILES
nostalgia-studio.json nostalgia-studio.json
DESTINATION DESTINATION
share ${NOSTALGIA_DIST_RESOURCES}
) )
install( install(
TARGETS TARGETS
nostalgia-studio nostalgia-studio
RUNTIME DESTINATION RUNTIME DESTINATION
bin ${NOSTALGIA_DIST_BIN}
) )
add_subdirectory(lib) add_subdirectory(lib)

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>nostalgia-studio</string>
<key>CFBundleGetInfoString</key>
<string>Nostalgia Studio</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>net.drinkingtea.nostalgia.studio</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>1.2.8</string>
<key>LSMinimumSystemVersion</key>
<string>10.13.0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) 2016-2017 Gary Talent &lt;gtalent2@gmail.com&gt;</string>
</dict>
</plist>

View File

@ -16,7 +16,7 @@ add_library(
) )
install(TARGETS NostalgiaStudio install(TARGETS NostalgiaStudio
LIBRARY DESTINATION lib/nostalgia) LIBRARY DESTINATION ${NOSTALGIA_DIST_LIB}/nostalgia)
target_link_libraries( target_link_libraries(
NostalgiaStudio NostalgiaStudio

View File

@ -29,6 +29,6 @@ install(
install( install(
TARGETS TARGETS
NostalgiaTool NostalgiaTool
LIBRARY DESTINATION lib/nostalgia LIBRARY DESTINATION ${NOSTALGIA_DIST_LIB}/nostalgia
ARCHIVE DESTINATION lib/nostalgia ARCHIVE DESTINATION ${NOSTALGIA_DIST_LIB}/nostalgia
) )