Skip to content

Commit

Permalink
Simplify cmake check for Ninja multi-config (openvinotoolkit#24651)
Browse files Browse the repository at this point in the history
### Details:
 - *item1*
 - *...*

### Tickets:
 - *ticket-id*
  • Loading branch information
ilya-lavrenov authored May 24, 2024
1 parent 3ca4919 commit e2b646f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if(OV_GENERATOR_MULTI_CONFIG)
string(REPLACE ";" " " config_types "${CMAKE_CONFIGURATION_TYPES}")
message (STATUS "CMAKE_CONFIGURATION_TYPES ............. " ${config_types})
unset(config_types)
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
message (STATUS "CMAKE_DEFAULT_BUILD_TYPE .............. " ${CMAKE_DEFAULT_BUILD_TYPE})
endif()
else()
Expand Down
2 changes: 1 addition & 1 deletion cmake/developer_package/cross_compile/native_compile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function(ov_native_compile_external_project)
endif()

if(OV_GENERATOR_MULTI_CONFIG)
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
list(APPEND ARG_CMAKE_ARGS "-DCMAKE_CONFIGURATION_TYPES=${CMAKE_DEFAULT_BUILD_TYPE}")
list(APPEND ARG_CMAKE_ARGS "-DCMAKE_DEFAULT_BUILD_TYPE=${CMAKE_DEFAULT_BUILD_TYPE}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/templates/OpenVINODeveloperPackageConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif()
get_property(_OV_GENERATOR_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_OV_GENERATOR_MULTI_CONFIG)
list(APPEND ov_options CMAKE_CONFIGURATION_TYPES)
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
list(APPEND ov_options CMAKE_DEFAULT_BUILD_TYPE)
endif()
else()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif()
get_property(_OV_GENERATOR_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_OV_GENERATOR_MULTI_CONFIG)
list(APPEND ov_options CMAKE_CONFIGURATION_TYPES)
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
list(APPEND ov_options CMAKE_DEFAULT_BUILD_TYPE)
endif()
else()
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif()
project(Samples)

get_property(OV_GENERATOR_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
# Ninja-Multi specific, see:
# https://cmake.org/cmake/help/latest/variable/CMAKE_DEFAULT_BUILD_TYPE.html
set(CMAKE_DEFAULT_BUILD_TYPE "Release" CACHE STRING "CMake default build type")
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_gpu/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(ENABLE_ONEDNN_FOR_GPU)
endforeach()

if(OV_GENERATOR_MULTI_CONFIG)
if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$")
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
list(APPEND cmake_extra_args "-DCMAKE_CONFIGURATION_TYPES=${CMAKE_DEFAULT_BUILD_TYPE}")
list(APPEND cmake_extra_args "-DCMAKE_DEFAULT_BUILD_TYPE=${CMAKE_DEFAULT_BUILD_TYPE}")
endif()
Expand Down

0 comments on commit e2b646f

Please sign in to comment.