diff options
author | June McEnroe <june@causal.agency> | 2022-01-22 00:04:20 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2022-01-22 00:04:20 -0500 |
commit | 63c6b7519d2b062ec3df0da99ca27b0ff846df84 (patch) | |
tree | e1e6299af5bb7fcbd329e22b33f3e335d44e673e /CMakeLists.txt | |
parent | Only use cells for moveColumn (diff) | |
download | wep-63c6b7519d2b062ec3df0da99ca27b0ff846df84.tar.gz wep-63c6b7519d2b062ec3df0da99ca27b0ff846df84.zip |
Build macOS .app bundles
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ce4e2f0..d56d244 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.13) project(WEP C) @@ -11,8 +11,28 @@ if(NOT MSVC) add_compile_options(-Wall -Wextra -pedantic) endif() -add_executable(sol sol.c) -add_executable(freecell freecell.c) +add_executable(sol MACOSX_BUNDLE sol.c) +add_executable(freecell MACOSX_BUNDLE freecell.c) + +set_target_properties( + sol freecell PROPERTIES + MACOSX_BUNDLE_INFO_PLIST + ${CMAKE_CURRENT_SOURCE_DIR}/MacOSXBundleInfo.plist.in +) +if(CMAKE_MACOSX_BUNDLE OR CMAKE_SYSTEM_NAME STREQUAL Darwin) + set_target_properties(sol PROPERTIES OUTPUT_NAME Solitaire) + set_target_properties(freecell PROPERTIES OUTPUT_NAME FreeCell) +endif() + +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/CARDS.DLL) + target_sources(sol PRIVATE CARDS.DLL) + target_sources(freecell PRIVATE CARDS.DLL) + set_target_properties(sol freecell PROPERTIES RESOURCE CARDS.DLL) +endif() +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/FREECELL.EXE) + target_sources(freecell PRIVATE FREECELL.EXE) + set_target_properties(freecell PROPERTIES RESOURCE "CARDS.DLL;FREECELL.EXE") +endif() # Workaround possible bugs in SDL2Config.cmake if(MINGW) @@ -31,4 +51,4 @@ if(WIN32) set_target_properties(freecell PROPERTIES OUTPUT_NAME wepfreecell) endif() -install(TARGETS sol freecell) +install(TARGETS sol freecell BUNDLE DESTINATION /Applications) |