Skip to content

Commit 5183de2

Browse files
WalltedCompute-Runtime-Automation
authored andcommitted
fix finding metrics when found empty
Do not try to include empty directories, as cmake will not explicitely return directiories, which would be searched by compiler anyway. Such found should still be considered as successful. Signed-off-by: Grzegorz Choinski <[email protected]>
1 parent c6e27bd commit 5183de2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cmake/find_metrics.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2021 Intel Corporation
2+
# Copyright (C) 2021-2022 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
#
@@ -36,7 +36,7 @@ function(dependency_detect COMPONENT_NAME DLL_NAME VAR_NAME REL_LOCATION IS_THIR
3636
if(NEO__${VAR_NAME}_FOUND)
3737
if(DEFINED __tmp_LIBDIR)
3838
if(NOT NEO__${VAR_NAME}_INCLUDE_DIRS STREQUAL "")
39-
string(REPLACE "${NEO__${VAR_NAME}_INCLUDEDIR}" "${LIBRARY_DIR}/include/${DLL_NAME}" NEO__${VAR_NAME}_INCLUDE_DIRS "${NEO__${VAR_NAME}_INCLUDE_DIRS}")
39+
string(REPLACE "${NEO__${VAR_NAME}_INCLUDEDIR}" "${LIBRARY_DIR}/include" NEO__${VAR_NAME}_INCLUDE_DIRS "${NEO__${VAR_NAME}_INCLUDE_DIRS}")
4040
else()
4141
set(NEO__${VAR_NAME}_INCLUDE_DIRS "${LIBRARY_DIR}/include")
4242
endif()
@@ -71,9 +71,13 @@ endfunction()
7171

7272
# Metrics Library Detection
7373
dependency_detect("Metrics Library" libigdml METRICS_LIBRARY "../metrics/library" TRUE)
74-
include_directories("${NEO__METRICS_LIBRARY_INCLUDE_DIR}")
74+
if(NOT NEO__METRICS_LIBRARY_INCLUDE_DIR STREQUAL "")
75+
include_directories("${NEO__METRICS_LIBRARY_INCLUDE_DIR}")
76+
endif()
7577

7678
# Metrics Discovery Detection
7779
dependency_detect("Metrics Discovery" libmd METRICS_DISCOVERY "../metrics/discovery" TRUE)
78-
include_directories("${NEO__METRICS_DISCOVERY_INCLUDE_DIR}")
80+
if(NOT NEO__METRICS_DISCOVERY_INCLUDE_DIR STREQUAL "")
81+
include_directories("${NEO__METRICS_DISCOVERY_INCLUDE_DIR}")
82+
endif()
7983

0 commit comments

Comments
 (0)