fix vcpkg build
authoralfadur
Sun, 06 Sep 2020 00:21:37 +0300
changeset 15738 027a56b3895e
parent 15737 6832dab555ae
child 15739 94f4d0a96143
fix vcpkg build
QTfrontend/CMakeLists.txt
misc/libphyslayer/CMakeLists.txt
--- a/QTfrontend/CMakeLists.txt	Mon Aug 10 12:56:53 2020 +0300
+++ b/QTfrontend/CMakeLists.txt	Sun Sep 06 00:21:37 2020 +0300
@@ -236,7 +236,7 @@
 
 if(WIN32 AND NOT UNIX)
     if(NOT SDL2_LIBRARIES)
-        list(APPEND HW_LINK_LIBS SDL2)
+        list(APPEND HW_LINK_LIBS SDL2::SDL2)
     endif()
 
     list(APPEND HW_LINK_LIBS
--- a/misc/libphyslayer/CMakeLists.txt	Mon Aug 10 12:56:53 2020 +0300
+++ b/misc/libphyslayer/CMakeLists.txt	Sun Sep 06 00:21:37 2020 +0300
@@ -17,7 +17,11 @@
 set_target_properties(physlayer PROPERTIES
                           VERSION 1.0
                           SOVERSION 1.0)
-target_link_libraries(physlayer ${SDL2_LIBRARIES} lua physfs)
+if(WIN32 AND VCPKG_TOOLCHAIN)                          
+    target_link_libraries(physlayer SDL2::SDL2 lua physfs)
+else()
+    target_link_libraries(physlayer ${SDL2_LIBRARIES} lua physfs)
+endif()
 install(TARGETS physlayer RUNTIME DESTINATION ${target_binary_install_dir}
                           LIBRARY DESTINATION ${target_library_install_dir}
                           ARCHIVE DESTINATION ${target_library_install_dir})