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 # cmake setup begin
project(MushMachine C CXX) 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_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") 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 # enable test
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest) 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 # 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 add_library(imgui_color_text_edit
"${CMAKE_CURRENT_LIST_DIR}/ImGuiColorTextEdit/TextEditor.h" "${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) project(SquirrelNoise)
add_library(squirrel_noise 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) add_library(entt INTERFACE)
target_include_directories(entt INTERFACE "${CMAKE_CURRENT_LIST_DIR}/entt/src") target_include_directories(entt INTERFACE "${CMAKE_CURRENT_LIST_DIR}/entt/src")
target_compile_features(entt INTERFACE cxx_std_17) 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) project(glad C)
set(C_FILES set(C_FILES
@ -15,8 +16,6 @@ add_library(glad ${C_FILES} ${H_FILES})
target_include_directories(glad PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(glad PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
if(UNIX) if(UNIX)
target_link_libraries(glad target_link_libraries(glad dl)
dl
)
endif() 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) add_library(glm INTERFACE)
target_include_directories(glm INTERFACE "${CMAKE_CURRENT_LIST_DIR}/glm") 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) add_library(icon_font_cpp_headers INTERFACE)
target_include_directories(icon_font_cpp_headers INTERFACE "${CMAKE_CURRENT_LIST_DIR}/IconFontCppHeaders/") 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 ## PROJECT

View File

@ -13,7 +13,7 @@
# compile, using preprocessor checks for platform-specific bits instead of # compile, using preprocessor checks for platform-specific bits instead of
# testing in here. # testing in here.
cmake_minimum_required(VERSION 3.0.2) cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(PhysicsFS) project(PhysicsFS)
set(PHYSFS_VERSION 3.1.0) 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) 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) 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) if(NOT EMSCRIPTEN)
add_library(tracy_client add_library(tracy_client

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.2) cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(framework CXX)
project(framework)
add_subdirectory(engine) add_subdirectory(engine)
add_subdirectory(logger) 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) project(common_components CXX)
add_library(common_components INTERFACE) 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) project(engine CXX)
add_library(engine 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) project(filesystem_service CXX)
add_library(filesystem_service 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) 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) project(input_service CXX)
add_library(input_service 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) project(logger CXX)
file(GLOB_RECURSE CPP_FILES src/*.cpp) 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) project(opengl_primitives CXX)
file(GLOB_RECURSE CPP_FILES src/*.cpp) file(GLOB_RECURSE CPP_FILES src/*.cpp)
file(GLOB_RECURSE HPP_FILES src/*.hpp) 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") 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) project(opengl_renderer CXX)
add_library(opengl_renderer_s 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) project(organizer_scene CXX)
add_library(organizer_scene 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) project(random CXX)
add_library(random 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) project(resource_manager CXX)
add_library(resource_manager INTERFACE) 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) project(screen_director CXX)
add_library(screen_director 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) project(sdl_service CXX)
add_library(sdl_service 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) project(simple_sdl_renderer_service CXX)
add_library(simple_sdl_renderer_service 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) project(sound_service CXX)
add_library(sound_service 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) project(std_utils CXX)
add_library(std_utils INTERFACE) 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) project(tilemap CXX)
add_library(tilemap add_library(tilemap

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.2) cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(screens CXX)
project(screens)
if(NOT MM_HEADLESS) if(NOT MM_HEADLESS)
add_subdirectory(mm_logo) 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) project(mm_logo_screen CXX)
add_library(mm_logo_screen add_library(mm_logo_screen

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.8) cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(systems CXX)
project(systems)
add_subdirectory(transform) add_subdirectory(transform)
add_subdirectory(simple_velocity) 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) project(fast_sky_sun_system CXX)
add_library(fast_sky_sun_system 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) project(player_velocity_system CXX)
add_library(player_velocity_system 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) project(simple_velocity_system CXX)
add_library(simple_velocity_system 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) project(transfrom_system CXX)
add_library(transform_system add_library(transform_system