chess_board_sim/CMakeLists.txt

34 lines
959 B
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.8)
project(Chess C CXX)
find_package(SDL2 REQUIRED)
file(GLOB_RECURSE cpp_sources
CONFIGURE_DEPENDS
2024-09-14 09:40:43 -04:00
"src/*.cpp")
file(GLOB_RECURSE c_sources
CONFIGURE_DEPENDS
"src/*.c")
2024-09-14 09:40:43 -04:00
file (GLOB_RECURSE headers CONFIGURE_DEPENDS "src/*.h")
set (include_dirs "")
foreach (_headerFile ${headers})
get_filename_component(_dir ${_headerFile} PATH)
list (APPEND include_dirs ${_dir})
endforeach()
add_executable(Chess ${cpp_sources} ${c_sources})
set_target_properties(Chess PROPERTIES CXX_STANDARD 17) # set standard level
2024-09-14 09:40:43 -04:00
target_include_directories(Chess PRIVATE ${include_dirs})
target_compile_options(Chess PRIVATE
-Wall -Wextra -Wredundant-decls -Wcast-align
-Wshadow -Wnon-virtual-dtor
-Wunused -Woverloaded-virtual -Wpedantic -Wconversion
-Wsign-conversion -Wmisleading-indentation
-Wnull-dereference -Wformat=2
)
target_link_libraries(Chess SDL2::SDL2)