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() +