update all cmake files to version 3.9

other misc cmake fixes

version 3.9 allows for ipo (lto)
This commit is contained in:
Green Sky 2022-05-03 18:53:24 +02:00
parent 052bdb45ec
commit 6b06d5cb99
38 changed files with 96 additions and 45 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
# cmake setup begin
project(MushMachine C CXX)
@ -19,6 +19,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# add this to your projects cmake to enable ipo
#include(CheckIPOSupported)
#check_ipo_supported()
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
# enable test
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
# external libs

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
add_library(imgui_color_text_edit
"${CMAKE_CURRENT_LIST_DIR}/ImGuiColorTextEdit/TextEditor.h"

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(SquirrelNoise)
add_library(squirrel_noise

2
external/entt.cmake vendored
View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
add_library(entt INTERFACE)
target_include_directories(entt INTERFACE "${CMAKE_CURRENT_LIST_DIR}/entt/src")
target_compile_features(entt INTERFACE cxx_std_17)

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(glad C)
set(C_FILES
@ -15,8 +16,6 @@ add_library(glad ${C_FILES} ${H_FILES})
target_include_directories(glad PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
if(UNIX)
target_link_libraries(glad
dl
)
target_link_libraries(glad dl)
endif()

2
external/glm.cmake vendored
View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
add_library(glm INTERFACE)
target_include_directories(glm INTERFACE "${CMAKE_CURRENT_LIST_DIR}/glm")

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
add_library(icon_font_cpp_headers INTERFACE)
target_include_directories(icon_font_cpp_headers INTERFACE "${CMAKE_CURRENT_LIST_DIR}/IconFontCppHeaders/")

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
##
## PROJECT

View File

@ -13,7 +13,7 @@
# compile, using preprocessor checks for platform-specific bits instead of
# testing in here.
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(PhysicsFS)
set(PHYSFS_VERSION 3.1.0)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(soloud CXX)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(stb CXX)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
if(NOT EMSCRIPTEN)
add_library(tracy_client

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.2)
project(framework CXX)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(framework)
add_subdirectory(engine)
add_subdirectory(logger)

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(common_components CXX)
add_library(common_components INTERFACE)

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(engine CXX)
add_library(engine

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(filesystem_service CXX)
add_library(filesystem_service

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(imgui_lib CXX)

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(input_service CXX)
add_library(input_service

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(logger CXX)
file(GLOB_RECURSE CPP_FILES src/*.cpp)

View File

@ -1,10 +1,33 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(opengl_primitives CXX)
file(GLOB_RECURSE CPP_FILES src/*.cpp)
file(GLOB_RECURSE HPP_FILES src/*.hpp)
add_library(opengl_primitives ${CPP_FILES} ${HPP_FILES})
add_library(opengl_primitives
src/mm/opengl/buffer.hpp
src/mm/opengl/buffer.cpp
src/mm/opengl/fbo_builder.hpp
src/mm/opengl/fbo_builder.cpp
src/mm/opengl/frame_buffer_object.hpp
src/mm/opengl/frame_buffer_object.cpp
src/mm/opengl/instance_buffer.hpp
src/mm/opengl/shader.hpp
src/mm/opengl/shader.cpp
src/mm/opengl/shader_builder.hpp
src/mm/opengl/shader_builder.cpp
src/mm/opengl/spritesheet.hpp
src/mm/opengl/texture.hpp
src/mm/opengl/texture.cpp
src/mm/opengl/texture_loader.hpp
src/mm/opengl/texture_loader.cpp
src/mm/opengl/vertex_array_object.hpp
src/mm/opengl/vertex_array_object.cpp
src/mm/opengl/components/texture.hpp
)
target_include_directories(opengl_primitives PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(opengl_renderer CXX)
add_library(opengl_renderer_s

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(organizer_scene CXX)
add_library(organizer_scene

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(random CXX)
add_library(random

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(resource_manager CXX)
add_library(resource_manager INTERFACE)

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(screen_director CXX)
add_library(screen_director

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(sdl_service CXX)
add_library(sdl_service

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(simple_sdl_renderer_service CXX)
add_library(simple_sdl_renderer_service

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(sound_service CXX)
add_library(sound_service

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(std_utils CXX)
add_library(std_utils INTERFACE)

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(tilemap CXX)
add_library(tilemap

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.2)
project(screens CXX)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(screens)
if(NOT MM_HEADLESS)
add_subdirectory(mm_logo)

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(mm_logo_screen CXX)
add_library(mm_logo_screen

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.8)
project(systems CXX)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(systems)
add_subdirectory(transform)
add_subdirectory(simple_velocity)

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(fast_sky_sun_system CXX)
add_library(fast_sky_sun_system

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(player_velocity_system CXX)
add_library(player_velocity_system

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(simple_velocity_system CXX)
add_library(simple_velocity_system

View File

@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(transfrom_system CXX)
add_library(transform_system