Skip to content

Commit

Permalink
Beautification
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Sep 30, 2023
1 parent 8ab5aad commit 98d85bd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
9 changes: 2 additions & 7 deletions cmake/developer_package/cpplint/cpplint.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ endif()
if(ENABLE_CPPLINT AND NOT TARGET cpplint_all)
add_custom_target(cpplint_all ALL)
set_target_properties(cpplint_all PROPERTIES FOLDER cpplint)
set(CPPLINT_ALL_OUTPUT_FILES "" CACHE INTERNAL "All cpplint output files")
endif()

function(add_cpplint_target TARGET_NAME)
Expand Down Expand Up @@ -58,6 +57,7 @@ function(add_cpplint_target TARGET_NAME)
endif()

file(RELATIVE_PATH source_file_relative "${CMAKE_CURRENT_SOURCE_DIR}" "${source_file}")
file(RELATIVE_PATH source_file_relative_root "${CMAKE_SOURCE_DIR}" "${source_file}")
set(output_file "${CMAKE_CURRENT_BINARY_DIR}/cpplint/${source_file_relative}.cpplint")
string(REPLACE ".." "__" output_file "${output_file}")
get_filename_component(output_dir "${output_file}" DIRECTORY)
Expand All @@ -81,17 +81,12 @@ function(add_cpplint_target TARGET_NAME)
"${IEDevScripts_DIR}/cpplint/cpplint.py"
"${IEDevScripts_DIR}/cpplint/cpplint_run.cmake"
COMMENT
"[cpplint] ${source_file}"
"[cpplint] ${source_file_relative_root}"
VERBATIM)

list(APPEND all_output_files "${output_file}")
endforeach()

set(CPPLINT_ALL_OUTPUT_FILES
${CPPLINT_ALL_OUTPUT_FILES} ${all_output_files}
CACHE INTERNAL
"All cpplint output files")

add_custom_target(${TARGET_NAME} ALL
DEPENDS ${all_output_files}
COMMENT "[cpplint] ${TARGET_NAME}")
Expand Down
24 changes: 12 additions & 12 deletions cmake/developer_package/frontends/frontends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,33 +127,33 @@ macro(ov_add_frontend)
# Generate protobuf file on build time for each '.proto' file in src/proto
file(GLOB proto_files ${frontend_root_dir}/src/proto/*.proto)

foreach(INFILE IN LISTS proto_files)
get_filename_component(FILE_DIR ${INFILE} DIRECTORY)
get_filename_component(FILE_WE ${INFILE} NAME_WE)
foreach(proto_file IN LISTS proto_files)
file(RELATIVE_PATH proto_file_relative "${CMAKE_SOURCE_DIR}" "${proto_file}")
get_filename_component(FILE_DIR ${proto_file} DIRECTORY)
get_filename_component(FILE_WE ${proto_file} NAME_WE)
set(OUTPUT_PB_SRC ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}.pb.cc)
set(OUTPUT_PB_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}.pb.h)
set(GENERATED_PROTO ${INFILE})
add_custom_command(
OUTPUT "${OUTPUT_PB_SRC}" "${OUTPUT_PB_HEADER}"
COMMAND ${PROTOC_EXECUTABLE} ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${FILE_DIR} ${FILE_WE}.proto
DEPENDS ${PROTOC_DEPENDENCY} ${GENERATED_PROTO}
COMMENT "Running C++ protocol buffer compiler (${PROTOC_EXECUTABLE}) on ${GENERATED_PROTO}"
DEPENDS ${PROTOC_DEPENDENCY} ${proto_file}
COMMENT "Running C++ protocol buffer compiler (${PROTOC_EXECUTABLE}) on ${proto_file_relative}"
VERBATIM
COMMAND_EXPAND_LISTS)
list(APPEND PROTO_SRCS "${OUTPUT_PB_SRC}")
list(APPEND PROTO_HDRS "${OUTPUT_PB_HEADER}")
endforeach()

file(GLOB flatbuffers_schema_files ${frontend_root_dir}/src/schema/*.fbs)
foreach(INFILE IN LISTS flatbuffers_schema_files)
get_filename_component(FILE_WE ${INFILE} NAME_WE)
foreach(flatbuffers_schema_file IN LISTS flatbuffers_schema_files)
file(RELATIVE_PATH flatbuffers_schema_file_relative "${CMAKE_SOURCE_DIR}" "${flatbuffers_schema_file}")
get_filename_component(FILE_WE "${flatbuffers_schema_file}" NAME_WE)
set(OUTPUT_FC_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${FILE_WE}_generated.h)
set(GENERATED_PROTO ${INFILE})
add_custom_command(
OUTPUT "${OUTPUT_FC_HEADER}"
COMMAND ${flatbuffers_COMPILER} ARGS -c --gen-mutable -o ${CMAKE_CURRENT_BINARY_DIR} ${INFILE}
DEPENDS ${flatbuffers_DEPENDENCY} ${GENERATED_PROTO}
COMMENT "Running C++ flatbuffers compiler (${flatbuffers_COMPILER}) on ${GENERATED_PROTO}"
COMMAND ${flatbuffers_COMPILER} ARGS -c --gen-mutable -o ${CMAKE_CURRENT_BINARY_DIR} ${flatbuffers_schema_file}
DEPENDS ${flatbuffers_DEPENDENCY} ${flatbuffers_schema_file}
COMMENT "Running C++ flatbuffers compiler (${flatbuffers_COMPILER}) on ${flatbuffers_schema_file_relative}"
VERBATIM
COMMAND_EXPAND_LISTS)
list(APPEND PROTO_HDRS "${OUTPUT_FC_HEADER}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ if(CYTHON_EXIT_CODE EQUAL 0)
string(REGEX REPLACE "^Cython version ([0-9]+\\.[0-9]+(\\.[0-9]+)?).*" "\\1" CYTHON_VERSION "${CYTHON_OUTPUT}")
else()
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
set(CYTHON_MESSAGE_MODE TRACE)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
set(CYTHON_MESSAGE_MODE TRACE)
else()
set(CYTHON_MESSAGE_MODE WARNING)
endif()
endif()
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
set(CYTHON_MESSAGE_MODE FATAL_ERROR)
Expand Down
6 changes: 3 additions & 3 deletions src/core/tests/frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set(SRC ${CMAKE_CURRENT_SOURCE_DIR}/mock_frontend.cpp)
set(MOCK1_FE_NAME openvino_mock1_frontend)
add_library(${MOCK1_FE_NAME} SHARED EXCLUDE_FROM_ALL ${SRC})
add_library(${MOCK1_FE_NAME} SHARED ${SRC})

ov_add_library_version(${MOCK1_FE_NAME})

Expand All @@ -18,5 +18,5 @@ add_dependencies(ov_core_unit_tests ${MOCK1_FE_NAME})
ov_add_clang_format_target(${MOCK1_FE_NAME}_clang FOR_TARGETS ${MOCK1_FE_NAME})

install(TARGETS ${MOCK1_FE_NAME}
RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL)
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

0 comments on commit 98d85bd

Please sign in to comment.