33 lines
696 B
CMake
33 lines
696 B
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(cordle C)
|
|
|
|
set(CMAKE_C_STANDARD 90)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90 -pedantic")
|
|
|
|
# Find ncurses library
|
|
find_package(Curses REQUIRED)
|
|
|
|
# Include directories
|
|
include_directories(include)
|
|
include_directories(${CURSES_INCLUDE_DIR})
|
|
|
|
# Source files
|
|
set(SOURCES
|
|
src/main.c
|
|
src/game.c
|
|
src/words.c
|
|
src/ui.c
|
|
)
|
|
|
|
# Create executable
|
|
add_executable(cordle ${SOURCES})
|
|
|
|
# Link ncurses
|
|
target_link_libraries(cordle ${CURSES_LIBRARIES})
|
|
|
|
# Set compiler flags for C90 compliance
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
|
target_compile_options(cordle PRIVATE -Wpedantic -Wextra -pedantic)
|
|
endif()
|