Skip to content

Commit 5a0eaa1

Browse files
authored
[Compile] Fix compile on windows (#765)
Fix compile on windows
1 parent 63f60aa commit 5a0eaa1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,11 @@ target_link_libraries(${LIBRARY_NAME} ${DEPEND_LIBS})
508508

509509
if(WIN32)
510510
if(ENABLE_VISION)
511-
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/third_party/yaml-cpp/Release)
511+
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
512+
add_custom_target(copy_yaml_library ALL COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/third_party/yaml-cpp ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/yaml-cpp/lib DEPENDS ${LIBRARY_NAME})
513+
else()
512514
add_custom_target(copy_yaml_library ALL COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/third_party/yaml-cpp/Release ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/yaml-cpp/lib DEPENDS ${LIBRARY_NAME})
513515
add_custom_target(copy_yaml_include ALL COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/third_party/yaml-cpp/include ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/yaml-cpp/include DEPENDS ${LIBRARY_NAME})
514-
else()
515-
add_custom_target(copy_yaml_library ALL COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/third_party/yaml-cpp ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install/yaml-cpp/lib DEPENDS ${LIBRARY_NAME})
516516
endif()
517517
endif()
518518
endif()

0 commit comments

Comments
 (0)