From 53699c189bbc389b5e5926154314273596a69ede Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 31 Jul 2019 13:30:20 +0200 Subject: [PATCH] use selected OpenCV modules only on Windows --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5523fc48..acdb8f67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,12 @@ set(Darknet_PATCH_VERSION 5) set(Darknet_VERSION ${Darknet_MAJOR_VERSION}.${Darknet_MINOR_VERSION}.${Darknet_PATCH_VERSION}) set(CMAKE_VERBOSE_MAKEFILE "FALSE" CACHE BOOL "Create verbose makefile") -set(BUILD_SHARED_LIBS "TRUE" CACHE BOOL "Create dark as a shared library") +set(BUILD_SHARED_LIBS "FALSE" CACHE BOOL "Create dark as a shared library") +if (WIN32) + set(SELECT_OPENCV_MODULES "TRUE" CACHE BOOL "Use only few selected OpenCV modules to circumvent some Ninja+CMake bugs on Windows") +else() + set(SELECT_OPENCV_MODULES "FALSE" CACHE BOOL "Use only few selected OpenCV modules to circumvent some Ninja+CMake bugs on Windows") +endif() set(BUILD_AS_CPP "FALSE" CACHE BOOL "Build Darknet using C++ compiler also for C files") if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) @@ -39,7 +44,6 @@ set(INSTALL_INCLUDE_DIR "include/darknet" CACHE PATH "Path where head set(INSTALL_CMAKE_DIR "share/darknet" CACHE PATH "Path where cmake configs will be installed") set(ENABLE_OPENCV "TRUE" CACHE BOOL "Enable OpenCV integration") -set(SELECT_OPENCV_MODULES "TRUE" CACHE BOOL "Use only few selected OpenCV modules to circumvent some Ninja+CMake bugs on Windows") set(ENABLE_CUDA "TRUE" CACHE BOOL "Enable CUDA support") set(ENABLE_CUDNN "FALSE" CACHE BOOL "Enable CUDNN") set(ENABLE_CUDNN_HALF "FALSE" CACHE BOOL "Enable CUDNN Half precision")