cmake_minimum_required(VERSION 3.18) project(blockgame_linux) file (GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS "*.cc" ) file (GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS "*.hh" "../server/*.hh" "../shared/*.hh" ) add_executable(${PROJECT_NAME} ${SOURCE_FILES} ) find_library(LIB_SDL2 sdl2 SDL2 REQUIRED) find_library(LIB_EPOXY epoxy epoxy EPOXY libepoxy REQUIRED) find_library(LIB_SQLITE3 sqlite3 SQLITE3 REQUIRED) find_library(LIB_FREETYPE freetype libfreetype REQUIRED) find_library(LIB_ASSIMP assimp libassimp REQUIRED) find_library(LIB_PROTOBUF protobuf libprotobuf REQUIRED) find_package(Boost COMPONENTS iostreams REQUIRED) find_package(Threads REQUIRED) find_package(Backtrace REQUIRED) find_package(Freetype REQUIRED) target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wshadow -Wdouble-promotion -Wformat=2 -Wundef -fno-common -Wconversion -Wpedantic -std=c++20 -O2 -Wno-exceptions -Wno-missing-field-initializers -Wno-unknown-pragmas ) target_compile_options(${PROJECT_NAME} PRIVATE -fstack-protector-strong -fno-omit-frame-pointer #-fsanitize=undefined -fsanitize-trap=undefined ) target_link_options(${PROJECT_NAME} PRIVATE -fstack-protector-strong #-fsanitize=undefined -fsanitize-trap=undefined ) target_include_directories(${PROJECT_NAME} PRIVATE "../../src" ${FREETYPE_INCLUDE_DIRS} ) target_link_libraries(${PROJECT_NAME} PRIVATE ${LIB_SDL2} ${LIB_EPOXY} ${LIB_FREETYPE} ${LIB_ASSIMP} ${LIB_PROTOBUF} ${LIB_SQLITE3} ${Backtrace_LIBRARIES} ${Threads_LIBRARIES} ${Boost_LIBRARIES} ${FREETYPE_LIBRARIES} shared server ) target_precompile_headers(${PROJECT_NAME} PRIVATE ${HEADER_FILES} )