Skip to content

Commit 50f2fe9

Browse files
committed
build: rename cmake functions to avoid name conflicts
1 parent 999710d commit 50f2fe9

15 files changed

+35
-29
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ if(${PNAME_UPPER}_BUILD_DOCS)
174174
"mscgen"
175175
)
176176

177-
use_doxygen_awesome_sidebar_only_theme()
177+
strpy_use_doxygen_awesome_sidebar_only_theme()
178178
doxygen_add_docs("${PNAME_LOWER}_docs" "include")
179179
endif()
180180

@@ -206,7 +206,7 @@ endif()
206206
#-------------------------------------------------------------------------------
207207

208208
if(${PNAME_UPPER}_INSTALL AND NOT CMAKE_SKIP_INSTALL_RULES)
209-
generate_install_target()
209+
strpy_generate_install_target()
210210
endif()
211211

212212
#-------------------------------------------------------------------------------
@@ -215,5 +215,5 @@ endif()
215215

216216
if(PROJECT_IS_TOP_LEVEL)
217217
# Run Clang-Format on the source files of a target before building it.
218-
format_target_sources(TARGETS "${PNAME_LOWER}")
218+
strpy_format_target_sources(TARGETS "${PNAME_LOWER}")
219219
endif()

cmake/ClangFormat.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# @param TARGETS The list of target names to run Clang-Format on.
44
# @param STYLE [optional] The coding style option to pass to Clang-Format.
55
# @param WORKING_DIRECTORY [optional] The working directory for the Clang-Format.
6-
function(format_target_sources)
6+
function(strpy_format_target_sources)
77
# Parse the arguments passed to the function
88
cmake_parse_arguments("FTS" "" "STYLE;WORKING_DIRECTORY" "TARGETS" ${ARGN})
99

cmake/Coverage.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(FILTERED_COVERAGE_INFO "filtered_coverage.info")
77
# Generates a coverage target for the specified target using LCOV and genhtml.
88
#
99
# @param target The name of the target to generate a coverage target for.
10-
function(generate_coverage_target target)
10+
function(strpy_generate_coverage_target target)
1111
# Find the LCOV and genhtml programs
1212
find_program(LCOV_PATH "lcov" REQUIRED)
1313
find_program(GENHTML_PATH "genhtml" REQUIRED)

cmake/Doxygen.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ set(DOXYGEN_USE_PDFLATEX YES)
6262
# Enable or disable verbatim copy of header files for classes with includes.
6363
set(DOXYGEN_VERBATIM_HEADERS NO)
6464

65-
macro(use_doxygen_awesome)
65+
macro(strpy_use_doxygen_awesome)
6666
# Fetch and make available DoxygenAwesome content
6767
FetchContent_MakeAvailable(DoxygenAwesome)
6868

@@ -88,9 +88,9 @@ macro(use_doxygen_awesome)
8888
set(DOXYGEN_HTML_EXTRA_STYLESHEET "${doxygenawesome_SOURCE_DIR}/doxygen-awesome.css")
8989
endmacro()
9090

91-
macro(use_doxygen_awesome_sidebar_only_theme)
91+
macro(strpy_use_doxygen_awesome_sidebar_only_theme)
9292
# Call macro
93-
use_doxygen_awesome()
93+
strpy_use_doxygen_awesome()
9494

9595
# Enable treeview generation
9696
set(DOXYGEN_GENERATE_TREEVIEW YES)

cmake/GoogleTest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ FetchContent_Declare(
1212
# First checks if GTest is already installed on the system.
1313
# If GTest is not found on the system, calls FetchContent_MakeAvailable(GoogleTest)
1414
# to fetch GTest from the repository and make it available for use.
15-
function(fetch_gtest)
15+
function(strpy_fetch_gtest)
1616
find_package(GTest)
1717

1818
if(NOT GTest_FOUND)

cmake/Install.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if(NOT DEFINED ${PNAME_UPPER}_INSTALL_CMAKEDIR)
1010
endif()
1111

1212
# Generates an install target for the project.
13-
function(generate_install_target)
13+
function(strpy_generate_install_target)
1414
set(rt_component "${PNAME_LOWER}")
1515
set(dev_component "${rt_component}-dev")
1616
set(targets_export "${PNAME_CAPITALIZED}Targets")

examples/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,22 @@ add_dependencies("examples" ${TARGET_LIST})
8989

9090
if(${PNAME_UPPER}_ENABLE_CLANG_TIDY)
9191
# Enable Clang-Tidy for "stringpy" and all other targets in the current directory
92-
enable_clang_tidy(TARGETS "stringpy" ${TARGET_LIST})
92+
strpy_enable_clang_tidy(TARGETS "stringpy" ${TARGET_LIST})
9393
endif()
9494

9595
if(${PNAME_UPPER}_ENABLE_CPPCHECK)
9696
# Enable Cppcheck for "stringpy" and all other targets in the current directory
97-
enable_cppcheck(TARGETS "stringpy" ${TARGET_LIST})
97+
strpy_enable_cppcheck(TARGETS "stringpy" ${TARGET_LIST})
9898
endif()
9999

100100
if(${PNAME_UPPER}_ENABLE_PVS_STUDIO)
101101
# Enable PVS-Studio for "stringpy" and all other targets in the current directory
102-
enable_pvs_studio(TARGETS "stringpy" ${TARGET_LIST})
102+
strpy_enable_pvs_studio(TARGETS "stringpy" ${TARGET_LIST})
103103
endif()
104104

105105
if(${PNAME_UPPER}_ENABLE_IWYU)
106106
# Enable Include What You Use for "stringpy" and all other targets in the current directory
107-
enable_iwyu(TARGETS "stringpy" ${TARGET_LIST})
107+
strpy_enable_iwyu(TARGETS "stringpy" ${TARGET_LIST})
108108
endif()
109109

110110
#-------------------------------------------------------------------------------
@@ -113,5 +113,5 @@ endif()
113113

114114
if(PROJECT_IS_TOP_LEVEL)
115115
# Run Clang-Format on the source files of a target before building it.
116-
format_target_sources(TARGETS ${TARGET_LIST})
116+
strpy_format_target_sources(TARGETS ${TARGET_LIST})
117117
endif()

examples/cmake/ClangTidy.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# @param TARGETS The list of target names to enable Clang-Tidy for.
44
# @param OPTIONS [optional] The options to pass to Clang-Tidy.
55
# @param EXTRA_ARGS [optional] The additional arguments to append to the compiler command line.
6-
function(enable_clang_tidy)
6+
function(strpy_enable_clang_tidy)
77
# Parse the arguments passed to the function
88
cmake_parse_arguments("CT" "" "" "TARGETS;OPTIONS;EXTRA_ARGS" ${ARGN})
99

examples/cmake/CompileOptions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# @param compiler_id The ID of the compiler to include options for.
44
# @param lang The language to include options for.
5-
function(include_compiler_options compiler_id lang)
5+
function(strpy_include_compiler_options compiler_id lang)
66
# Return early if the compiler ID is not provided or is empty.
77
if(NOT compiler_id OR "${compiler_id}" STREQUAL "")
88
return()

examples/cmake/CompileOptionsLinux.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,5 @@ endif()
139139
# Compiler-Specific Options
140140
#-------------------------------------------------------------------------------
141141

142-
include_compiler_options("${CMAKE_C_COMPILER_ID}" "C")
143-
include_compiler_options("${CMAKE_CXX_COMPILER_ID}" "CXX")
142+
strpy_include_compiler_options("${CMAKE_C_COMPILER_ID}" "C")
143+
strpy_include_compiler_options("${CMAKE_CXX_COMPILER_ID}" "CXX")

0 commit comments

Comments
 (0)