From b6b9181c66e01ef002c9a483f149d607d7396877 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 20 Oct 2017 22:14:33 -0500 Subject: [PATCH] Restructure Mac builds as Nostalgia.app --- CMakeLists.txt | 14 ++++++++++++-- src/nostalgia/core/studio/CMakeLists.txt | 2 +- src/nostalgia/studio/CMakeLists.txt | 13 +++++++++++-- src/nostalgia/studio/Info.plist | 22 ++++++++++++++++++++++ src/nostalgia/studio/lib/CMakeLists.txt | 2 +- src/nostalgia/tools/lib/CMakeLists.txt | 4 ++-- 6 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 src/nostalgia/studio/Info.plist diff --git a/CMakeLists.txt b/CMakeLists.txt index 6246c1b9..4c9ad213 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,11 +28,21 @@ if(NOSTALGIA_IDE_BUILD STREQUAL "ON") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) endif() -if (APPLE) - set(CMAKE_MACOSX_RPATH ON) +if(APPLE) + 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() set(CMAKE_INSTALL_RPATH "$ORIGIN" "$ORIGIN/../lib/nostalgia") 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() if (CMAKE_BUILD_TYPE STREQUAL "Release") diff --git a/src/nostalgia/core/studio/CMakeLists.txt b/src/nostalgia/core/studio/CMakeLists.txt index 461bed3a..33624e90 100644 --- a/src/nostalgia/core/studio/CMakeLists.txt +++ b/src/nostalgia/core/studio/CMakeLists.txt @@ -21,7 +21,7 @@ install( TARGETS NostalgiaCore-Studio LIBRARY DESTINATION - lib/nostalgia + ${NOSTALGIA_DIST_PLUGIN}/nostalgia ) install( diff --git a/src/nostalgia/studio/CMakeLists.txt b/src/nostalgia/studio/CMakeLists.txt index 4df4daf2..09539e52 100644 --- a/src/nostalgia/studio/CMakeLists.txt +++ b/src/nostalgia/studio/CMakeLists.txt @@ -24,18 +24,27 @@ target_link_libraries( NostalgiaTool ) +if(APPLE) + install( + FILES + Info.plist + DESTINATION + ${NOSTALGIA_DIST_MAC_APP_CONTENTS} + ) +endif() + install( FILES nostalgia-studio.json DESTINATION - share + ${NOSTALGIA_DIST_RESOURCES} ) install( TARGETS nostalgia-studio RUNTIME DESTINATION - bin + ${NOSTALGIA_DIST_BIN} ) add_subdirectory(lib) diff --git a/src/nostalgia/studio/Info.plist b/src/nostalgia/studio/Info.plist new file mode 100644 index 00000000..0911a12d --- /dev/null +++ b/src/nostalgia/studio/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleExecutable + nostalgia-studio + CFBundleGetInfoString + Nostalgia Studio + CFBundleIconFile + + CFBundleIdentifier + net.drinkingtea.nostalgia.studio + CFBundlePackageType + APPL + CFBundleVersion + 1.2.8 + LSMinimumSystemVersion + 10.13.0 + NSHumanReadableCopyright + Copyright (c) 2016-2017 Gary Talent <gtalent2@gmail.com> + + diff --git a/src/nostalgia/studio/lib/CMakeLists.txt b/src/nostalgia/studio/lib/CMakeLists.txt index aa861fa7..6a79e508 100644 --- a/src/nostalgia/studio/lib/CMakeLists.txt +++ b/src/nostalgia/studio/lib/CMakeLists.txt @@ -16,7 +16,7 @@ add_library( ) install(TARGETS NostalgiaStudio - LIBRARY DESTINATION lib/nostalgia) + LIBRARY DESTINATION ${NOSTALGIA_DIST_LIB}/nostalgia) target_link_libraries( NostalgiaStudio diff --git a/src/nostalgia/tools/lib/CMakeLists.txt b/src/nostalgia/tools/lib/CMakeLists.txt index aa484f5d..448ff7f8 100644 --- a/src/nostalgia/tools/lib/CMakeLists.txt +++ b/src/nostalgia/tools/lib/CMakeLists.txt @@ -29,6 +29,6 @@ install( install( TARGETS NostalgiaTool - LIBRARY DESTINATION lib/nostalgia - ARCHIVE DESTINATION lib/nostalgia + LIBRARY DESTINATION ${NOSTALGIA_DIST_LIB}/nostalgia + ARCHIVE DESTINATION ${NOSTALGIA_DIST_LIB}/nostalgia )