diff options
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) |