Skip to content

Commit

Permalink
remove conditions about CMAKE_VERSION < 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Sep 16, 2023
1 parent dc7efae commit 5f61443
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 625 deletions.
41 changes: 13 additions & 28 deletions base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,13 @@ endmacro(
# LIST : the list. VALUE : the value to be appended.
#
macro(_ADD_TO_LIST_IF_NOT_PRESENT LIST VALUE)
if(CMAKE_VERSION VERSION_GREATER "3.3.0")
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW)
# To be more robust, value should be stripped
if(NOT "${VALUE}" IN_LIST ${LIST})
list(APPEND ${LIST} "${VALUE}")
endif()
cmake_policy(POP)
else()
list(FIND LIST "${VALUE}" _index)
if(${_index} EQUAL -1)
list(APPEND LIST "${VALUE}")
endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW)
# To be more robust, value should be stripped
if(NOT "${VALUE}" IN_LIST ${LIST})
list(APPEND ${LIST} "${VALUE}")
endif()
cmake_policy(POP)
endmacro(
_ADD_TO_LIST_IF_NOT_PRESENT
LIST
Expand Down Expand Up @@ -355,22 +348,14 @@ macro(COMPUTE_PROJECT_ARGS _project_VARIABLE)
set(_project_LANGUAGES "CXX")
endif()

if(CMAKE_VERSION VERSION_GREATER "3.0.0")
# CMake >= 3.0
cmake_policy(SET CMP0048 NEW)
set(${_project_VARIABLE} VERSION ${PROJECT_VERSION_FULL} LANGUAGES
${_project_LANGUAGES})

# Append description for CMake >= 3.9
if(CMAKE_VERSION VERSION_GREATER "3.9.0")
set(${_project_VARIABLE} ${${_project_VARIABLE}} DESCRIPTION
${PROJECT_DESCRIPTION})
endif(CMAKE_VERSION VERSION_GREATER "3.9.0")
else(CMAKE_VERSION VERSION_GREATER "3.0.0")
# CMake >= 3.0
cmake_policy(SET CMP0048 NEW)
set(${_project_VARIABLE} VERSION ${PROJECT_VERSION_FULL} LANGUAGES
${_project_LANGUAGES})

# CMake < 3.0
set(${_project_VARIABLE} ${_project_LANGUAGES})
endif(CMAKE_VERSION VERSION_GREATER "3.0.0")
# Append description for CMake >= 3.9
set(${_project_VARIABLE} ${${_project_VARIABLE}} DESCRIPTION
${PROJECT_DESCRIPTION})
endmacro(COMPUTE_PROJECT_ARGS)

# .rst: .. ifmode:: user
Expand Down
12 changes: 2 additions & 10 deletions cxx11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,8 @@ macro(PROJECT_USE_CXX11)
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX0X OR COMPILER_SUPPORTS_CXX11)
if(CMAKE_VERSION VERSION_LESS "3.1")
if(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
elseif(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
else()
set(CMAKE_CXX_STANDARD 11)
set(CXX_STANDARD_REQUIRED ON)
endif()
set(CMAKE_CXX_STANDARD 11)
set(CXX_STANDARD_REQUIRED ON)
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
endif()
Expand Down
6 changes: 1 addition & 5 deletions logging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ endif(UNIX)
#
function(LOGGING_INITIALIZE)
# Retrieve interesting information.
if(${CMAKE_VERSION} VERSION_LESS 2.8)
set(HOSTNAME "unknown (CMake >= 2.8 required)")
else()
site_name(HOSTNAME)
endif()
site_name(HOSTNAME)

# Write logging file.
file(REMOVE ${JRL_CMAKEMODULE_LOGGING_FILENAME})
Expand Down
4 changes: 0 additions & 4 deletions msvc-specific.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ macro(REQUIRE_MINIMUM_MSVC_VERSION VERSION)
endif(${MSVC_TOOLS_VERSION})
endmacro(REQUIRE_MINIMUM_MSVC_VERSION)

if(${CMAKE_VERSION} VERSION_LESS "3.5.0")
include(CMakeParseArguments)
endif()

# GENERATE_MSVC_DOT_USER_FILE(<name> [<additional_path>])
# GENERATE_MSVC_DOT_USER_FILE(NAME <name> [COMMAND <command>] [COMMAND_ARGS
# <args>] [WORKING_DIRECTORY <dir>] [ADDITIONAL_PATH <additional_path>])
Expand Down
8 changes: 0 additions & 8 deletions python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@
# nothing for CMake < 3.12 which doesn't have those. This also export: -
# `FIND_NUMPY` and/or `SEARCH_FOR_BOOST_PYTHON` if necessary.

if(CMAKE_VERSION VERSION_LESS "3.2")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/python ${CMAKE_MODULE_PATH})
message(
STATUS
"CMake versions older than 3.2 do not properly find Python. Custom macros are used to find it."
)
endif(CMAKE_VERSION VERSION_LESS "3.2")

macro(FINDPYTHON)
if(DEFINED FINDPYTHON_ALREADY_CALLED)
message(
Expand Down
171 changes: 0 additions & 171 deletions python/FindPythonInterp.cmake

This file was deleted.

Loading

0 comments on commit 5f61443

Please sign in to comment.