Skip to content

Commit

Permalink
Merge pull request #1053 from MathiasPaulin/cmake-version-318
Browse files Browse the repository at this point in the history
[cmake] request version 3.18
  • Loading branch information
dlyr authored Jun 28, 2023
2 parents 88aca60 + 0b8bc7c commit fe7d934
Show file tree
Hide file tree
Showing 41 changed files with 71 additions and 100 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ jobs:
echo "${{ env.ext-dir }}/bin" >> $GITHUB_PATH
echo "${{ env.ext-dir }}/glbinding" >> $GITHUB_PATH
echo "${{ env.ext-dir }}/globjects" >> $GITHUB_PATH
echo "${{ env.ext-dir }}/cpplocate" >> $GITHUB_PATH
- name: Prepare directories
run: |
mkdir -p install/
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)

# ------------------------------------------------------------------------------
# Policies and global parameters for CMake
Expand Down
39 changes: 22 additions & 17 deletions cmake/ExternalInclude.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
#set the compile definition for current directory (i.e. externals)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
else()
set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
endif()

# if we are in a radium process, use radium specific option, else use cmake option.
set(EXTERNAL_INSTALL_MESSAGE ${CMAKE_INSTALL_MESSAGE})

set(RADIUM_EXTERNAL_CMAKE_OPTIONS
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
-DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}
Expand All @@ -21,17 +8,35 @@ set(RADIUM_EXTERNAL_CMAKE_OPTIONS
-DCMAKE_INSTALL_MESSAGE=${EXTERNAL_INSTALL_MESSAGE}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${EXTERNAL_CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
-DCMAKE_MACOSX_RPATH=TRUE
--no-warn-unused-cli
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
set(RADIUM_EXTERNAL_CMAKE_OPTIONS ${RADIUM_EXTERNAL_CMAKE_OPTIONS}
-DCMAKE_CXX_FLAGS=${EXTERNAL_CMAKE_CXX_FLAGS}
)
else()
set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
set(RADIUM_EXTERNAL_CMAKE_OPTIONS
${RADIUM_EXTERNAL_CMAKE_OPTIONS}
-DCMAKE_CXX_FLAGS=${EXTERNAL_CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
)
endif()

# if we are in a radium process, use radium specific option, else use cmake option.
set(EXTERNAL_INSTALL_MESSAGE ${CMAKE_INSTALL_MESSAGE})

# First message formating function, need other to have better consistency
macro(status_message MODULE NAME VAR)
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindFilesystem.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if(TARGET std::filesystem)
return()
endif()

cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)

include(CMakePushCheckState)
include(CheckIncludeFileCXX)
Expand Down
2 changes: 1 addition & 1 deletion cmake/QtFunctions.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)

# Find Qt5 or Qt6 packages Parameters: COMPONENTS <component_list>: optional parameter listing the
# Qt packages (e.g. Core, Widgets REQUIRED: optional parameter propagated to find_package
Expand Down
2 changes: 1 addition & 1 deletion cmake/RadiumSetupFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Minimum version: 3.16: install target from different directory see
# https://github.com/STORM-IRIT/Radium-Engine/pull/550#issuecomment-637415860

cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)

if(MSVC OR MSVC_IDE OR MINGW)
include(${CMAKE_CURRENT_LIST_DIR}/Windeployqt.cmake)
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# * dot = for automatically generated UML diagrams (class, include, caller, call, collaboration)
# * PlantUML = for easy generation of custom diagrams

cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
project(radium-doc)

if(POLICY CMP0077)
Expand Down
10 changes: 5 additions & 5 deletions doc/basics/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
The following platforms and tool chains have been tested and should work :

* *Windows* : IDEs: Visual Studio 2019, 2022 (2017 is not supported due to embedded cmake version), QtCreator. Command Line: cmake+ninja+MSVC(2017, 2019, 2022) .
* *Mac OSX* : gcc 10 or higher, Apple clang
* *Mac OSX* : gcc 10 or higher, Apple clang, llvm clang 11 or higher
* *Linux* : gcc 8 or higher, clang

See also our Continuous Integration system at <https://github.com/STORM-IRIT/Radium-Engine/actions>.

Minimal requirements

* OpenGL 4.1+ / GLSL 410+
* CMake 3.16+
* CMake 3.18+
* Qt5 (minimal version 5.15) or Qt6 (experimental)

# Build instructions
Expand Down Expand Up @@ -205,7 +205,7 @@ For instance, with directory structure for externals as defined in \ref dependen
{
"QtDir": "C:/Qt/6.3.0/msvc2019_64/"
"glfwDir" : "C:/path/to/glfwInstallation",
"ExternalInstallDir": "${projectDir}/../radium-externals/install"
"ExternalInstallDir": "${projectDir}/../radium-externals/install;${projectDir}/../radium-externals/install/${name}/cpplocate;"
}
],
"configurations": [
Expand All @@ -222,7 +222,7 @@ For instance, with directory structure for externals as defined in \ref dependen
"environments": [
{
"environment": "RadiumDllsLocations",
"ExternalDllsDIR": "${env.ExternalInstallDir}/${name}/bin;${env.ExternalInstallDir}/${name}/glbinding;${env.ExternalInstallDir}/${name}/globjects",
"ExternalDllsDIR": "${env.ExternalInstallDir}/${name}/bin;${env.ExternalInstallDir}/${name}/cpplocate;${env.ExternalInstallDir}/${name}/glbinding;${env.ExternalInstallDir}/${name}/globjects",
"QtDllsDIR": "${env.QtDir}/bin",
"RadiumDlls": "${buildRoot}/src/Core;${buildRoot}/src/Engine;${buildRoot}/src/Gui;${buildRoot}/src/Headless;${buildRoot}/src/IO;${buildRoot}/src/PluginBase"
}
Expand All @@ -241,7 +241,7 @@ For instance, with directory structure for externals as defined in \ref dependen
"environments": [
{
"environment": "RadiumDllsLocations",
"ExternalDllsDIR": "${env.ExternalInstallDir}/${name}/bin;${env.ExternalInstallDir}/${name}/glbinding;${env.ExternalInstallDir}/${name}/globjects",
"ExternalDllsDIR": "${env.ExternalInstallDir}/${name}/bin;${env.ExternalInstallDir}/${name}/cpplocate;${env.ExternalInstallDir}/${name}/glbinding;${env.ExternalInstallDir}/${name}/globjects",
"QtDllsDIR": "${env.QtDir}/bin",
"RadiumDlls": "${buildRoot}/src/Core;${buildRoot}/src/Engine;${buildRoot}/src/Gui;${buildRoot}/src/Headless;${buildRoot}/src/IO;${buildRoot}/src/PluginBase"
}
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/cmakeutilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ Note that these are only guidelines and that you can always write your cmake scr
# -------------------------------------------------------
# Recommended preamble for cmake configuration
# -------------------------------------------------------
# Radium package requires cmake minimum version 3.13
cmake_minimum_required(3.13)
# Radium package requires cmake minimum version 3.18
cmake_minimum_required(3.18)
# It is recommended to disable in-source build
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
Expand Down
2 changes: 1 addition & 1 deletion doc/developer/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To compile and use a plugin, the Radium libraries must be configured, compiled a
Example CMakeLists.txt setup to compile a Radium plugin:

```cmake
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.18)
#------------------------------------------------------------------------------
# Policies and global parameters for CMake
if (POLICY CMP0077)
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)

# -------------------------------------------------------------------------------
# exampleApp executables setup
Expand Down
2 changes: 1 addition & 1 deletion examples/CoreExample/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(CoreExample VERSION 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/CustomCameraManipulator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0042 NEW)

Expand Down
2 changes: 1 addition & 1 deletion examples/DrawPrimitives/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0042 NEW)

Expand Down
2 changes: 1 addition & 1 deletion examples/EntityAnimation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(EntityAnimation VERSION 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/EnvMap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.16)
if(APPLE)
cmake_policy(SET CMP0042 NEW)
endif(APPLE)
Expand Down
2 changes: 1 addition & 1 deletion examples/HeadlessExample/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(HeadlessExample VERSION 1.0.2)
Expand Down
2 changes: 1 addition & 1 deletion examples/HelloRadium/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(HelloRadium VERSION 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/KeyEvent/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0042 NEW)

Expand Down
2 changes: 1 addition & 1 deletion examples/MaterialEdition/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(MaterialEdition VERSION 0.0.1)
Expand Down
2 changes: 1 addition & 1 deletion examples/ParameterEdition/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(ParameterEdition VERSION 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/Picking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0042 NEW)

Expand Down
2 changes: 1 addition & 1 deletion examples/PluginsWithLib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
# ------------------------------------------------------------------------------
# Policies and global parameters for CMake
if(POLICY CMP0077)
Expand Down
2 changes: 1 addition & 1 deletion examples/PluginsWithLib/Downstream/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
# ------------------------------------------------------------------------------
# Policies and global parameters for CMake
if(POLICY CMP0077)
Expand Down
2 changes: 1 addition & 1 deletion examples/PluginsWithLib/Upstream/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
# ------------------------------------------------------------------------------
# Standard "Radium" cmake preamble Policies and global parameters for CMake
if(POLICY CMP0077)
Expand Down
2 changes: 1 addition & 1 deletion examples/PluginsWithLib/Upstream/Library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
# ------------------------------------------------------------------------------
# Policies and global parameters for CMake
if(POLICY CMP0077)
Expand Down
2 changes: 1 addition & 1 deletion examples/PluginsWithLib/Upstream/Plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
# ------------------------------------------------------------------------------
# Policies and global parameters for CMake
if(POLICY CMP0077)
Expand Down
2 changes: 1 addition & 1 deletion examples/RawShaderMaterial/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0042 NEW)

Expand Down
2 changes: 1 addition & 1 deletion examples/SimpleAnimation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0042 NEW)

Expand Down
2 changes: 1 addition & 1 deletion examples/SimpleSimulation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0042 NEW)

Expand Down
2 changes: 1 addition & 1 deletion examples/SimpleSkinning/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(SimpleSkinning VERSION 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/TexturedQuad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(TexturedQuad VERSION 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/TexturedQuadDynamic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)
cmake_policy(SET CMP0042 NEW)

project(TexturedQuadDynamic VERSION 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/Volume/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)

cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0042 NEW)
Expand Down
2 changes: 1 addition & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
set(RADIUM_DEPENDENCIES_PROJECT_NAME radium_externals)
project(${RADIUM_DEPENDENCIES_PROJECT_NAME})

Expand Down
12 changes: 6 additions & 6 deletions external/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.18)

project(radiumcore-external VERSION 1.0.0)

Expand Down Expand Up @@ -70,15 +70,15 @@ if(NOT DEFINED cpplocate_DIR OR NOT cpplocate_DIR)
GIT_TAG tags/v2.2.0
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
PATCH_COMMAND git reset --hard && git apply -v --ignore-whitespace
"${CMAKE_CURRENT_LIST_DIR}/patches/cpplocate.patch"
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cpplocate"
CMAKE_ARGS ${RADIUM_EXTERNAL_CMAKE_OPTIONS} -DOPTION_BUILD_TESTS=OFF
-DOPTION_BUILD_DOCS=OFF -DCMAKE_MESSAGE_INDENT=${indent_string}\;
-DOPTION_BUILD_DOCS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
"-DCMAKE_MESSAGE_INDENT=${indent_string}\;"
)
add_dependencies(CoreExternals cpplocate)
set_external_dir(cpplocate "share/cpplocate/")
set_external_dir(cpplocate "cpplocate/")
else()
add_custom_target(cpplocate)
status_message("" "cpplocate" ${cpplocate_DIR})
endif()

Expand Down
35 changes: 0 additions & 35 deletions external/Core/patches/cpplocate.patch

This file was deleted.

2 changes: 1 addition & 1 deletion external/Engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.18)

project(radiumengine-external VERSION 1.0.0)

Expand Down
2 changes: 1 addition & 1 deletion external/Gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.18)

project(radiumgui-external VERSION 1.0.0)

Expand Down
Loading

0 comments on commit fe7d934

Please sign in to comment.