Polish compilation on Windows (#56)

This commit is contained in:
Jason
2022-07-29 10:11:12 +08:00
committed by GitHub
parent a9b5c6ed85
commit 31c1beca81
5 changed files with 56 additions and 38 deletions

View File

@@ -12,8 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set(OPENCV_INSTALL_DIR ${THIRD_PARTY_PATH}/install/)
if(WIN32)
set(OPENCV_URL https://bj.bcebos.com/paddle2onnx/libs/opencv-win-x64-3.4.16.zip)
download_and_decompress(${OPENCV_URL} ${CMAKE_CURRENT_BINARY_DIR}/opencv-win-x64-3.4.16.zip ${THIRD_PARTY_PATH}/install/)
set(OpenCV_DIR ${THIRD_PARTY_PATH}/install/opencv-win-x64-3.4.16/build)
find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR})
include_directories(${OpenCV_INCLUDE_DIRS})
list(APPEND DEPEND_LIBS ${OpenCV_LIBS})
else()