build: remove unneeded cmake version switches
This commit is contained in:
committed by
Gabriel Ferreira
parent
6661c04a74
commit
bd3279cb7b
@@ -162,22 +162,6 @@ function(find_external_library)
|
||||
# cmake-format: on
|
||||
# Or enable NS3_VERBOSE to print the searched paths
|
||||
|
||||
# Print tested paths to the searched library and if it was found
|
||||
if(${NS3_VERBOSE} AND (${CMAKE_VERSION} VERSION_LESS "3.17.0"))
|
||||
log_find_searched_paths(
|
||||
TARGET_TYPE
|
||||
Library
|
||||
TARGET_NAME
|
||||
${library}
|
||||
SEARCH_RESULT
|
||||
${name}_library_internal_${library}
|
||||
SEARCH_PATHS
|
||||
${library_search_paths}
|
||||
SEARCH_SUFFIXES
|
||||
${suffixes}
|
||||
)
|
||||
endif()
|
||||
|
||||
# After searching the library, the internal variable should have either the
|
||||
# absolute path to the library or the name of the variable appended with
|
||||
# -NOTFOUND
|
||||
@@ -260,22 +244,6 @@ function(find_external_library)
|
||||
PATH_SUFFIXES ${suffixes}
|
||||
)
|
||||
|
||||
# Print tested paths to the searched header and if it was found
|
||||
if(${NS3_VERBOSE} AND (${CMAKE_VERSION} VERSION_LESS "3.17.0"))
|
||||
log_find_searched_paths(
|
||||
TARGET_TYPE
|
||||
Header
|
||||
TARGET_NAME
|
||||
${header}
|
||||
SEARCH_RESULT
|
||||
${name}_header_internal_${header}
|
||||
SEARCH_PATHS
|
||||
${header_search_paths}
|
||||
SEARCH_SUFFIXES
|
||||
${suffixes}
|
||||
)
|
||||
endif()
|
||||
|
||||
# If the header file was not found, append to the not-found list
|
||||
if("${${name}_header_internal_${header}}" STREQUAL
|
||||
"${name}_header_internal_${header}-NOTFOUND"
|
||||
|
||||
@@ -530,14 +530,7 @@ macro(process_options)
|
||||
|
||||
set(ENABLE_SQLITE False)
|
||||
if(${NS3_SQLITE})
|
||||
# find_package(SQLite3 QUIET) # unsupported in CMake 3.10 We emulate the
|
||||
# behavior of find_package below
|
||||
find_external_library(
|
||||
DEPENDENCY_NAME SQLite3
|
||||
HEADER_NAME sqlite3.h
|
||||
LIBRARY_NAME sqlite3
|
||||
OUTPUT_VARIABLE "ENABLE_SQLITE_REASON"
|
||||
)
|
||||
find_package(SQLite3 QUIET)
|
||||
|
||||
if(${SQLite3_FOUND})
|
||||
set(ENABLE_SQLITE True)
|
||||
@@ -1230,7 +1223,7 @@ macro(process_options)
|
||||
${HIGHLIGHTED_STATUS}
|
||||
"Clang-tidy is incompatible with precompiled headers. Continuing without them."
|
||||
)
|
||||
elseif(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
|
||||
else()
|
||||
# If ccache is not enable or was not found, we can continue with
|
||||
# precompiled headers
|
||||
if((NOT ${NS3_CCACHE}) OR ("${CCACHE}" STREQUAL "CCACHE-NOTFOUND"))
|
||||
@@ -1260,11 +1253,6 @@ macro(process_options)
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(
|
||||
STATUS
|
||||
"CMake ${CMAKE_VERSION} does not support precompiled headers. Continuing without them"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -40,17 +40,7 @@ function(create_scratch source_files)
|
||||
string(REPLACE "/" "_" scratch_dirname "${scratch_dirname}")
|
||||
|
||||
# Get source name
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.0")
|
||||
get_filename_component(scratch_name ${scratch_src} NAME_WLE)
|
||||
else()
|
||||
get_filename_component(scratch_name ${scratch_src} NAME)
|
||||
string(FIND "${scratch_name}" "." ext_position REVERSE)
|
||||
if(${ext_position} EQUAL -1)
|
||||
message(FATAL_ERROR "Source file has no extension: ${scratch_src}")
|
||||
else()
|
||||
string(SUBSTRING "${scratch_name}" 0 ${ext_position} scratch_name)
|
||||
endif()
|
||||
endif()
|
||||
get_filename_component(scratch_name ${scratch_src} NAME_WLE)
|
||||
|
||||
set(target_prefix scratch_)
|
||||
if(scratch_dirname)
|
||||
|
||||
Reference in New Issue
Block a user