myxx/MyxxCMake/MyxxCMakeConfig.cmake

26 lines
716 B
CMake
Raw Normal View History

2022-10-05 14:12:28 +00:00
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # IN_LIST operator
get_filename_component(MYXX_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
if(NOT MyxCMake_DIR)
message(FATAL_ERROR "MyxxCMake library required MyxCMake to work")
endif()
set(MYXX_CMAKE_LIB_DIR "${MYXX_CMAKE_SOURCE_DIR}/lib" CACHE PATH "")
include(${MYXX_CMAKE_LIB_DIR}/CodeAnalyzeClangTidy.cmake)
function(myxx)
get_property(targets DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} PROPERTY BUILDSYSTEM_TARGETS)
foreach(iter ${targets})
get_target_property(target_type ${iter} TYPE)
if(NOT ${target_type} STREQUAL "UTILITY")
myxx_analyze_clang_tidy(${iter})
endif()
endforeach()
endfunction(myxx)
cmake_policy(POP)