From 6d491b17283ff50b99ece91fdc0145c5cf1464f2 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Tue, 19 Feb 2019 12:06:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=83=D1=82=D1=8C=20=D0=BA=20=D0=BA?= =?UTF-8?q?=D0=B0=D1=82=D0=B0=D0=BB=D0=BE=D0=B3=D1=83=20=D1=81=D0=BE=20?= =?UTF-8?q?=D1=81=D1=82=D0=BE=D1=80=D0=BE=D0=BD=D0=BD=D0=B8=D0=BC=D0=B8=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8F=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCodeAnalysisPvsStudio.cmake | 2 +- CMLibGlobalVariables.cmake | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMLibCodeAnalysisPvsStudio.cmake b/CMLibCodeAnalysisPvsStudio.cmake index a9d4da6..511dfbd 100644 --- a/CMLibCodeAnalysisPvsStudio.cmake +++ b/CMLibCodeAnalysisPvsStudio.cmake @@ -1,7 +1,7 @@ option(USE_PVS_STUDIO "Use PVS-Studio for static analysis" OFF) if(USE_PVS_STUDIO) - include(3rdparty/PVS-Studio) + include(PVS-Studio) find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer) if(PVS_STUDIO_ANALYZER_EXE AND NOT TARGET pvs-global-checker) pvs_studio_add_target(TARGET pvs-global-checker diff --git a/CMLibGlobalVariables.cmake b/CMLibGlobalVariables.cmake index 78eb3a7..15ffa03 100644 --- a/CMLibGlobalVariables.cmake +++ b/CMLibGlobalVariables.cmake @@ -4,7 +4,6 @@ string(REGEX REPLACE "[ -]" "_" _project_name_fixed ${_project_name_uppercase}) set(CMLIB_PROJECT_NAME_CANONICAL ${_project_name_fixed}) # CMLIB_MODULE_DIR -set(CMLIB_MODULE_DIR "") foreach(_m ${CMAKE_MODULE_PATH}) if(EXISTS ${_m}/CMLibCommon.cmake) get_filename_component(CMLIB_MODULE_DIR ${_m}/CMLibCommon.cmake DIRECTORY) @@ -12,3 +11,12 @@ foreach(_m ${CMAKE_MODULE_PATH}) endif() endforeach() +if(CMLIB_MODULE_DIR) + if(NOT DEFINED CMLIB_3RDPARTY_DIR) + set(CMLIB_3RDPARTY_DIR "${CMLIB_MODULE_DIR}/3rdparty") + list(APPEND CMAKE_MODULE_PATH ${CMLIB_3RDPARTY_DIR}) + endif() +else() + message(FATAL_ERROR "CMLib directory not found.") +endif() +