uncrustify выполняется только с файлом настройки из каталога CMAKE_SOURCE_DIR
This commit is contained in:
parent
969667e9b1
commit
5086bfe47c
@ -9,10 +9,6 @@ function(myx_uncrustify TARGET_NAME)
|
||||
set(CMAKE_CURRENT_FUNCTION_LIST_DIR ${MYX_CMAKE_LIB_UNCRUSTIFY_DIR_BACKPORT})
|
||||
endif()
|
||||
|
||||
if(NOT ${PROJECT_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(options)
|
||||
set(oneValueArgs CONFIG)
|
||||
set(multiValueArgs)
|
||||
@ -32,6 +28,12 @@ function(myx_uncrustify TARGET_NAME)
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_filename_component(CONFIG_DIR ${ARG_CONFIG} DIRECTORY)
|
||||
if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CONFIG_DIR}")
|
||||
myx_message("MyxCMake: skip uncrustify for project ${PROJECT_NAME}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET myx-uncrustify)
|
||||
add_custom_target(myx-uncrustify)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user