Путь к каталогу со сторонними модулями

This commit is contained in:
Andrei Astafev 2019-02-19 12:06:30 +03:00
parent cee2aea787
commit 6d491b1728
2 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,7 @@
option(USE_PVS_STUDIO "Use PVS-Studio for static analysis" OFF) option(USE_PVS_STUDIO "Use PVS-Studio for static analysis" OFF)
if(USE_PVS_STUDIO) if(USE_PVS_STUDIO)
include(3rdparty/PVS-Studio) include(PVS-Studio)
find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer) find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer)
if(PVS_STUDIO_ANALYZER_EXE AND NOT TARGET pvs-global-checker) if(PVS_STUDIO_ANALYZER_EXE AND NOT TARGET pvs-global-checker)
pvs_studio_add_target(TARGET pvs-global-checker pvs_studio_add_target(TARGET pvs-global-checker

View File

@ -4,7 +4,6 @@ string(REGEX REPLACE "[ -]" "_" _project_name_fixed ${_project_name_uppercase})
set(CMLIB_PROJECT_NAME_CANONICAL ${_project_name_fixed}) set(CMLIB_PROJECT_NAME_CANONICAL ${_project_name_fixed})
# CMLIB_MODULE_DIR # CMLIB_MODULE_DIR
set(CMLIB_MODULE_DIR "")
foreach(_m ${CMAKE_MODULE_PATH}) foreach(_m ${CMAKE_MODULE_PATH})
if(EXISTS ${_m}/CMLibCommon.cmake) if(EXISTS ${_m}/CMLibCommon.cmake)
get_filename_component(CMLIB_MODULE_DIR ${_m}/CMLibCommon.cmake DIRECTORY) get_filename_component(CMLIB_MODULE_DIR ${_m}/CMLibCommon.cmake DIRECTORY)
@ -12,3 +11,12 @@ foreach(_m ${CMAKE_MODULE_PATH})
endif() endif()
endforeach() 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()