Skip to content

Commit bd3279c

Browse files
a-andreGabrielcarvfer
authored andcommitted
build: remove unneeded cmake version switches
1 parent 6661c04 commit bd3279c

File tree

3 files changed

+3
-57
lines changed

3 files changed

+3
-57
lines changed

build-support/custom-modules/ns3-find-external-library.cmake

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,6 @@ function(find_external_library)
162162
# cmake-format: on
163163
# Or enable NS3_VERBOSE to print the searched paths
164164

165-
# Print tested paths to the searched library and if it was found
166-
if(${NS3_VERBOSE} AND (${CMAKE_VERSION} VERSION_LESS "3.17.0"))
167-
log_find_searched_paths(
168-
TARGET_TYPE
169-
Library
170-
TARGET_NAME
171-
${library}
172-
SEARCH_RESULT
173-
${name}_library_internal_${library}
174-
SEARCH_PATHS
175-
${library_search_paths}
176-
SEARCH_SUFFIXES
177-
${suffixes}
178-
)
179-
endif()
180-
181165
# After searching the library, the internal variable should have either the
182166
# absolute path to the library or the name of the variable appended with
183167
# -NOTFOUND
@@ -260,22 +244,6 @@ function(find_external_library)
260244
PATH_SUFFIXES ${suffixes}
261245
)
262246

263-
# Print tested paths to the searched header and if it was found
264-
if(${NS3_VERBOSE} AND (${CMAKE_VERSION} VERSION_LESS "3.17.0"))
265-
log_find_searched_paths(
266-
TARGET_TYPE
267-
Header
268-
TARGET_NAME
269-
${header}
270-
SEARCH_RESULT
271-
${name}_header_internal_${header}
272-
SEARCH_PATHS
273-
${header_search_paths}
274-
SEARCH_SUFFIXES
275-
${suffixes}
276-
)
277-
endif()
278-
279247
# If the header file was not found, append to the not-found list
280248
if("${${name}_header_internal_${header}}" STREQUAL
281249
"${name}_header_internal_${header}-NOTFOUND"

build-support/macros-and-definitions.cmake

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -530,14 +530,7 @@ macro(process_options)
530530

531531
set(ENABLE_SQLITE False)
532532
if(${NS3_SQLITE})
533-
# find_package(SQLite3 QUIET) # unsupported in CMake 3.10 We emulate the
534-
# behavior of find_package below
535-
find_external_library(
536-
DEPENDENCY_NAME SQLite3
537-
HEADER_NAME sqlite3.h
538-
LIBRARY_NAME sqlite3
539-
OUTPUT_VARIABLE "ENABLE_SQLITE_REASON"
540-
)
533+
find_package(SQLite3 QUIET)
541534

542535
if(${SQLite3_FOUND})
543536
set(ENABLE_SQLITE True)
@@ -1230,7 +1223,7 @@ macro(process_options)
12301223
${HIGHLIGHTED_STATUS}
12311224
"Clang-tidy is incompatible with precompiled headers. Continuing without them."
12321225
)
1233-
elseif(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
1226+
else()
12341227
# If ccache is not enable or was not found, we can continue with
12351228
# precompiled headers
12361229
if((NOT ${NS3_CCACHE}) OR ("${CCACHE}" STREQUAL "CCACHE-NOTFOUND"))
@@ -1260,11 +1253,6 @@ macro(process_options)
12601253
)
12611254
endif()
12621255
endif()
1263-
else()
1264-
message(
1265-
STATUS
1266-
"CMake ${CMAKE_VERSION} does not support precompiled headers. Continuing without them"
1267-
)
12681256
endif()
12691257
endif()
12701258

scratch/CMakeLists.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,7 @@ function(create_scratch source_files)
4040
string(REPLACE "/" "_" scratch_dirname "${scratch_dirname}")
4141

4242
# Get source name
43-
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.0")
44-
get_filename_component(scratch_name ${scratch_src} NAME_WLE)
45-
else()
46-
get_filename_component(scratch_name ${scratch_src} NAME)
47-
string(FIND "${scratch_name}" "." ext_position REVERSE)
48-
if(${ext_position} EQUAL -1)
49-
message(FATAL_ERROR "Source file has no extension: ${scratch_src}")
50-
else()
51-
string(SUBSTRING "${scratch_name}" 0 ${ext_position} scratch_name)
52-
endif()
53-
endif()
43+
get_filename_component(scratch_name ${scratch_src} NAME_WLE)
5444

5545
set(target_prefix scratch_)
5646
if(scratch_dirname)

0 commit comments

Comments
 (0)