diff --git a/CMakeLists.txt b/CMakeLists.txt index 008443ae..ae4068f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,9 +100,16 @@ endif() add_executable( treesheets + MACOSX_BUNDLE src/main.cpp ) +if(APPLE) + set_target_properties(treesheets PROPERTIES + MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/osx/Info.plist" + ) +endif() + target_include_directories(treesheets PUBLIC lobster/src) target_link_libraries( @@ -142,6 +149,10 @@ if(LINUX AND NOT TREESHEETS_RELOCATABLE_INSTALLATION) install(FILES linux/com.strlen.TreeSheets.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) install(FILES linux/com.strlen.TreeSheets.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES linux/com.strlen.TreeSheets.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages) +elseif(APPLE) + set(TREESHEETS_BINDIR ${CMAKE_INSTALL_PREFIX}) + set(TREESHEETS_DOCDIR ${CMAKE_INSTALL_PREFIX}/treesheets.app/Contents/Resources) + set(TREESHEETS_PKGDATADIR ${CMAKE_INSTALL_PREFIX}/treesheets.app/Contents/Resources) else() set(TREESHEETS_BINDIR ${CMAKE_INSTALL_PREFIX}) set(TREESHEETS_DOCDIR ${CMAKE_INSTALL_PREFIX}) @@ -179,7 +190,7 @@ elseif(APPLE) foreach(locale ${locales}) install( FILES "TS/translations/${locale}/ts.mo" - DESTINATION "${CMAKE_INSTALL_PREFIX}/translations/${locale}.lproj" + DESTINATION "${CMAKE_INSTALL_PREFIX}/treesheets.app/Contents/Resources/translations/${locale}.lproj" ) endforeach() else() diff --git a/README.md b/README.md index 651162f9..2ae7f2cc 100755 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Windows: the wxWidgets libraries. 7. To distribute, build an installer with `TS_installer.nsi` (requires nsis.sourceforge.net) -Linux: +Linux / MacOS X: 1. Configure the build process with `cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release` or similar. - If you have `git` installed, the submodules for wxWidgets will be automatically updated and wxWidgets will be compiled as a CMake subproject. TreeSheets will be then statically linked against this wxWidgets build. @@ -85,20 +85,14 @@ Linux: - You can use the version of wxWidgets from https://github.com/wxWidgets/wxWidgets.git. - Follow the instructions to build there, but add `--enable-unicode` and `--disable-shared` to the `configure` step. - You can change the default installation prefix (`/usr/local`) by passing something like `-DCMAKE_INSTALL_PREFIX=/usr`. + - If you are MacOS X user, a bundle will be installed to the installation prefix. 2. Build using `cmake --build _build`. 3. Install using `sudo cmake --install _build`. -OSX: - -1. Build wxWidgets as follows (inside the wxWidgets dir): - 1. `mkdir build_osx` - 2. `cd build_osx` - 3. `../configure --enable-unicode --disable-shared --disable-sys-libs --without-libtiff --with-osx_cocoa --enable-universal_binary=x86_64,arm64 CXXFLAGS="-stdlib=libc++" LDFLAGS="-stdlib=libc++" OBJCXXFLAGS="-stdlib=libc++" --disable-mediactrl CC=clang CXX=clang++` - 4. `make -j8` - 5. `sudo make install` -2. use the XCode project in `osx/TreeSheets` to build treesheets. put the resulting - .app together with the files from the `TS` folder in `osx/TreeSheetsBeta` to distribute. - Note to use the "Archive" operation to create a release executable. +For Mac OS X users: + +4. Run the application bundle that has been installed to the installation prefix. You might consider to drag-and-drop it to Applications. + Contributing: ------------- diff --git a/osx/Info.plist b/osx/Info.plist new file mode 100644 index 00000000..bd397f6d --- /dev/null +++ b/osx/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + treesheets + CFBundleGetInfoString + + CFBundleIconFile + App.icns + CFBundleIdentifier + com.strlen.TreeSheets + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + + CFBundleName + + CFBundlePackageType + APPL + CFBundleShortVersionString + + CFBundleSignature + ???? + CFBundleVersion + + CSResourcesFileMapped + + NSHumanReadableCopyright + Wouter van Oortmersen + CFBundleLocalizations + + English + German + French + Chinese + Portuguese + Russian + + +