nuclear-plant-sim/CMakeLists.txt

39 lines
1001 B
CMake

cmake_minimum_required(VERSION 3.25)
project(NuclearPlantSim LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 20)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/freetype2")
endif()
if(NOT WIN32)
if(NOT DEFINED SIGFPE_ENABLED)
set(SIGFPE_ENABLED 1)
endif()
set(libs stdc++ m GLEW glfw GL freetype assimp jsoncpp openal vorbisfile alut atomic)
else()
set(libs stdc++ m brotlidec assimp-5 glew32 opengl32 glfw3 freetype jsoncpp zlibstatic soft_oal vorbisfile vorbis ogg alut atomic)
endif()
if(SIGFPE_ENABLED)
add_compile_definitions(SIGFPE_ENABLED=1)
endif()
if(DEBUG_ENABLED)
message("-- Enabled: Runtime debug checks")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
add_compile_definitions(NO_DEBUG)
endif()
message("-- Using cmake flags: ${CMAKE_CXX_FLAGS}")
message("-- Using libs: ${libs}")
include(src/files.cmake)
add_executable(NuclearPlantSim ${SOURCES})
target_link_libraries(NuclearPlantSim PUBLIC ${libs})