Index: cmake/OpenCVCompilerOptions.cmake --- cmake/OpenCVCompilerOptions.cmake.orig 2017-12-15 23:30:43.000000000 +0100 +++ cmake/OpenCVCompilerOptions.cmake 2017-12-16 19:20:54.395389000 +0100 @@ -100,24 +100,6 @@ if(CMAKE_COMPILER_IS_GNUCXX) # High level of warnings. - add_extra_compiler_option(-W) - add_extra_compiler_option(-Wall) - add_extra_compiler_option(-Werror=return-type) - add_extra_compiler_option(-Werror=non-virtual-dtor) - add_extra_compiler_option(-Werror=address) - add_extra_compiler_option(-Werror=sequence-point) - add_extra_compiler_option(-Wformat) - add_extra_compiler_option(-Werror=format-security -Wformat) - add_extra_compiler_option(-Wmissing-declarations) - add_extra_compiler_option(-Wmissing-prototypes) - add_extra_compiler_option(-Wstrict-prototypes) - add_extra_compiler_option(-Wundef) - add_extra_compiler_option(-Winit-self) - add_extra_compiler_option(-Wpointer-arith) - add_extra_compiler_option(-Wshadow) - add_extra_compiler_option(-Wsign-promo) - add_extra_compiler_option(-Wuninitialized) - add_extra_compiler_option(-Winit-self) if(ENABLE_NOISY_WARNINGS) add_extra_compiler_option(-Wcast-align) @@ -125,7 +107,6 @@ else() add_extra_compiler_option(-Wno-narrowing) add_extra_compiler_option(-Wno-delete-non-virtual-dtor) - add_extra_compiler_option(-Wno-unnamed-type-template-args) add_extra_compiler_option(-Wno-comment) add_extra_compiler_option(-Wno-implicit-fallthrough) if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.2.0) Index: modules/core/src/utils/filesystem.cpp --- modules/core/src/utils/filesystem.cpp.orig 2017-12-15 23:30:43.000000000 +0100 +++ modules/core/src/utils/filesystem.cpp 2017-12-16 19:54:15.168153000 +0100 @@ -33,7 +33,7 @@ #include #include #include -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __FreeBSD__ #include #include #include @@ -156,7 +156,7 @@ sz = GetCurrentDirectoryA((DWORD)buf.size(), (char*)buf); return cv::String((char*)buf, (size_t)sz); #endif -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __FreeBSD__ for(;;) { char* p = ::getcwd((char*)buf, buf.size()); @@ -190,7 +190,7 @@ #else int result = _mkdir(path.c_str()); #endif -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __FreeBSD__ int result = mkdir(path.c_str(), 0777); #else int result = -1; @@ -305,7 +305,7 @@ Impl& operator=(const Impl&); // disabled }; -#elif defined __linux__ || defined __APPLE__ +#elif defined __linux__ || defined __APPLE__ || defined __FreeBSD__ struct FileLock::Impl { Index: modules/dnn/src/torch/THGeneral.cpp --- modules/dnn/src/torch/THGeneral.cpp.orig 2017-12-15 23:30:43.000000000 +0100 +++ modules/dnn/src/torch/THGeneral.cpp 2017-12-16 19:20:54.395537000 +0100 @@ -3,7 +3,7 @@ #if defined(TH_DISABLE_HEAP_TRACKING) #elif (defined(__unix) || defined(_WIN32)) -#include +#include #elif defined(__APPLE__) #include #endif