summary refs log tree commit diff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-01-22 00:04:20 -0500
committerJune McEnroe <june@causal.agency>2022-01-22 00:04:20 -0500
commit63c6b7519d2b062ec3df0da99ca27b0ff846df84 (patch)
treee1e6299af5bb7fcbd329e22b33f3e335d44e673e /CMakeLists.txt
parentOnly use cells for moveColumn (diff)
downloadwep-63c6b7519d2b062ec3df0da99ca27b0ff846df84.tar.gz
wep-63c6b7519d2b062ec3df0da99ca27b0ff846df84.zip
Build macOS .app bundles
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
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)
td>Color both nicks in a changeJune McEnroe 2019-12-31Implement nick-colored outputJune McEnroe 2019-12-31Only enable highlighting on terminal outputJune McEnroe 2019-12-31Set up pager pipeJune McEnroe 2019-12-30Normalize date inputJune McEnroe Mostly this just allows the use of 'now'. 2019-12-30Add initial rough version of scoopJune McEnroe 2019-12-30Join with USING wherever possibleJune McEnroe 2019-12-30Add -D flag to prospective scoop manualJune McEnroe 2019-12-30Order results by ID in outer query in litterboxJune McEnroe 2019-12-30Use X macro for Type enumJune McEnroe 2019-12-30Remove scoop -ABCJune McEnroe I can almost get these to work with an inner and outer SQL query, but when contexts starts overlapping it becomes a disaster, so I'm leavin it out at least for now. 2019-12-30Add limit option for litterbox's search query interfaceJune McEnroe