diff options
author | June McEnroe <june@causal.agency> | 2022-01-19 20:31:26 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2022-01-19 20:31:26 -0500 |
commit | cb8d1b637275434b64bdcd448afd2e9a2e269f80 (patch) | |
tree | 4db93b9aae7bc36c0cc6340f533cf2bb948b35e4 /CMakeLists.txt | |
parent | Allow choosing freecell game on command line (diff) | |
download | wep-cb8d1b637275434b64bdcd448afd2e9a2e269f80.tar.gz wep-cb8d1b637275434b64bdcd448afd2e9a2e269f80.zip |
Replace build system with cmake
Thanks to cr1901 for helping to test this on Windows.
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..926fed0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.10) + +project(WEP) + +find_package(SDL2 REQUIRED) +include_directories(${SDL2_INCLUDE_DIRS}) + +if(NOT MSVC) + add_compile_options(-Wall -Wextra -pedantic) +endif() + +include_directories(cards) +add_library(cards STATIC cards/cards.c) + +add_executable(sol sol.c) +add_executable(freecell freecell.c) + +target_link_libraries(sol cards SDL2::SDL2 SDL2::SDL2main) +target_link_libraries(freecell cards SDL2::SDL2 SDL2::SDL2main) + +# Avoid conflicting with SOL.EXE, FREECELL.EXE on Windows +if(WIN32) + set_target_properties(sol PROPERTIES OUTPUT_NAME wepsol) + set_target_properties(freecell PROPERTIES OUTPUT_NAME wepfreecell) +endif() |