From ea79bd733df8278d3fc33d4a014f74fc1d60a1b9 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 16 Nov 2019 16:27:36 -0500 Subject: [PATCH] cmake add a few include guards - this is a minor cmake configure time optimization --- cmake/px4_find_python_module.cmake | 6 ++++++ cmake/px4_git.cmake | 6 ++++++ cmake/px4_parse_function_args.cmake | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/cmake/px4_find_python_module.cmake b/cmake/px4_find_python_module.cmake index 4412abd1beaf..55155e2d9a99 100644 --- a/cmake/px4_find_python_module.cmake +++ b/cmake/px4_find_python_module.cmake @@ -31,6 +31,12 @@ # ############################################################################ +# cmake include guard +if(px4_find_python_module_included) + return() +endif(px4_find_python_module_included) +set(px4_find_python_module_included true) + # # px4_find_python_module # diff --git a/cmake/px4_git.cmake b/cmake/px4_git.cmake index 1f35203ccd9b..22fb7d358bd6 100644 --- a/cmake/px4_git.cmake +++ b/cmake/px4_git.cmake @@ -31,6 +31,12 @@ # ############################################################################ +# cmake include guard +if(px4_git_included) + return() +endif(px4_git_included) +set(px4_git_included true) + #============================================================================= # # px4_add_git_submodule diff --git a/cmake/px4_parse_function_args.cmake b/cmake/px4_parse_function_args.cmake index cee0827c7808..d7a23344dbff 100644 --- a/cmake/px4_parse_function_args.cmake +++ b/cmake/px4_parse_function_args.cmake @@ -31,6 +31,12 @@ # ############################################################################ +# cmake include guard +if(px4_parse_function_args_included) + return() +endif(px4_parse_function_args_included) +set(px4_parse_function_args_included true) + #============================================================================= # # px4_parse_function_args