@@ -37,46 +37,40 @@ add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${PUBLIC_HEADERS})
37
37
add_library (openvino::util ALIAS ${TARGET_NAME} )
38
38
set_target_properties (${TARGET_NAME} PROPERTIES EXPORT_NAME util)
39
39
40
- file (
41
- WRITE ${CMAKE_CURRENT_BINARY_DIR} /main.cpp
42
- "#include <experimental/filesystem>\n int main(int argc, char ** argv) {\n std::experimental::filesystem::path p(argv[0]);\n return p.string().length();\n }"
43
- )
44
- try_compile (
45
- STD_FS_NO_LIB_NEEDED ${CMAKE_CURRENT_BINARY_DIR}
46
- SOURCES ${CMAKE_CURRENT_BINARY_DIR} /main.cpp
47
- COMPILE_DEFINITIONS -std=c++11)
48
- try_compile (
49
- STD_FS_NEEDS_STDCXXFS ${CMAKE_CURRENT_BINARY_DIR}
50
- SOURCES ${CMAKE_CURRENT_BINARY_DIR} /main.cpp
51
- COMPILE_DEFINITIONS -std=c++11
52
- LINK_LIBRARIES stdc++fs)
53
- try_compile (
54
- STD_FS_NEEDS_CXXFS ${CMAKE_CURRENT_BINARY_DIR}
55
- SOURCES ${CMAKE_CURRENT_BINARY_DIR} /main.cpp
56
- COMPILE_DEFINITIONS -std=c++11
57
- LINK_LIBRARIES c++fs)
58
-
59
- if (MSVC )
60
- message (INFO "MSVC - No explicit filesystem linker setting required." )
61
- set (STD_FS_LIB "" )
40
+ file (WRITE ${CMAKE_CURRENT_BINARY_DIR} /main.cpp
41
+ "#include <experimental/filesystem>\n int main(int argc, char ** argv) {\n std::experimental::filesystem::path p(argv[0]);\n return p.string().length();\n }" )
42
+
43
+ try_compile (STD_FS_NO_LIB_NEEDED ${CMAKE_CURRENT_BINARY_DIR}
44
+ SOURCES ${CMAKE_CURRENT_BINARY_DIR} /main.cpp
45
+ COMPILE_DEFINITIONS -std=c++11)
46
+ try_compile (STD_FS_NEEDS_STDCXXFS ${CMAKE_CURRENT_BINARY_DIR}
47
+ SOURCES ${CMAKE_CURRENT_BINARY_DIR} /main.cpp
48
+ COMPILE_DEFINITIONS -std=c++11
49
+ LINK_LIBRARIES stdc++fs)
50
+ try_compile (STD_FS_NEEDS_CXXFS ${CMAKE_CURRENT_BINARY_DIR}
51
+ SOURCES ${CMAKE_CURRENT_BINARY_DIR} /main.cpp
52
+ COMPILE_DEFINITIONS -std=c++11
53
+ LINK_LIBRARIES c++fs)
54
+
55
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
56
+ message (STATUS "MSVC - No explicit filesystem linker setting required." )
62
57
elseif (STD_FS_NEEDS_STDCXXFS)
63
- message (INFO "STD_FS_NEEDS_STDCXXFS - Add explicit filesystem linker setting: 'stdc++fs'." )
58
+ message (STATUS "STD_FS_NEEDS_STDCXXFS - Add explicit filesystem linker setting: 'stdc++fs'." )
64
59
set (STD_FS_LIB stdc++fs)
65
60
elseif (STD_FS_NEEDS_CXXFS)
66
- message (INFO "STD_FS_NEEDS_CXXFS - Add explicit filesystem linker setting: 'c++fs'." )
61
+ message (STATUS "STD_FS_NEEDS_CXXFS - Add explicit filesystem linker setting: 'c++fs'." )
67
62
set (STD_FS_LIB c++fs)
68
63
elseif (STD_FS_NO_LIB_NEEDED)
69
- message (INFO "STD_FS_NO_LIB_NEEDED - No explicit filesystem linker setting required." )
70
- set (STD_FS_LIB "" )
64
+ message (STATUS "STD_FS_NO_LIB_NEEDED - No explicit filesystem linker setting required." )
71
65
else ()
72
66
message (WARNING "Unknown C++ build setup - No explicit filesystem linker setting set" )
73
- set (STD_FS_LIB "" )
74
67
endif ()
75
68
76
- target_link_libraries (${TARGET_NAME} PRIVATE ${CMAKE_DL_LIBS} PUBLIC openvino::pugixml ${STD_FS_LIB} )
69
+ target_link_libraries (${TARGET_NAME} PRIVATE ${CMAKE_DL_LIBS} PUBLIC openvino::pugixml ${STD_FS_LIB} )
77
70
if (WIN32 )
78
71
target_link_libraries (${TARGET_NAME} PRIVATE Shlwapi)
79
72
endif ()
73
+
80
74
target_include_directories (${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${UTIL_INCLUDE_DIR} >)
81
75
82
76
ov_add_clang_format_target(${TARGET_NAME} _clang FOR_TARGETS ${TARGET_NAME} )
0 commit comments