Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
6f99447f
Commit
6f99447f
authored
Jan 24, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compiler flags caching in cmake
parent
2042e99c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
74 deletions
+78
-74
CMakeLists.txt
CMakeLists.txt
+53
-53
run.py
modules/ts/misc/run.py
+25
-21
No files found.
CMakeLists.txt
View file @
6f99447f
...
...
@@ -1065,78 +1065,78 @@ if (WIN32 AND ${CMAKE_GENERATOR} MATCHES "(MinGW)|(MSYS)")
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O2 -DNDEBUG"
CACHE STRING
""
)
endif
()
set
(
EXTRA_C_FLAGS
""
)
set
(
EXTRA_C_FLAGS_RELEASE
""
)
set
(
EXTRA_C_FLAGS_DEBUG
""
)
set
(
EXTRA_EXE_LINKER_FLAGS
""
)
set
(
EXTRA_EXE_LINKER_FLAGS_RELEASE
""
)
set
(
EXTRA_EXE_LINKER_FLAGS_DEBUG
""
)
set
(
OPENCV_EXTRA_C_FLAGS
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
)
set
(
OPENCV_EXTRA_C_FLAGS_DEBUG
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG
)
if
(
MSVC
)
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
/D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
/D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS"
)
# 64-bit portability warnings, in MSVC8
if
(
MSVC80
)
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
/Wp64"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
/Wp64"
)
endif
()
#if(MSVC90)
# set(
EXTRA_C_FLAGS "${
EXTRA_C_FLAGS} /D _BIND_TO_CURRENT_CRT_VERSION=1 /D _BIND_TO_CURRENT_VCLIBS_VERSION=1")
# set(
OPENCV_EXTRA_C_FLAGS "${OPENCV_
EXTRA_C_FLAGS} /D _BIND_TO_CURRENT_CRT_VERSION=1 /D _BIND_TO_CURRENT_VCLIBS_VERSION=1")
#endif()
if
(
BUILD_WITH_DEBUG_INFO
)
set
(
EXTRA_EXE_LINKER_FLAGS_RELEASE
"
${
EXTRA_EXE_LINKER_FLAGS_RELEASE
}
/debug"
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_EXE_LINKER_FLAGS_RELEASE
}
/debug"
)
endif
()
# Remove unreferenced functions: function level linking
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
/Gy"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
/Gy"
)
if
(
BUILD_WITH_DEBUG_INFO
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
/Zi"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
/Zi"
)
endif
()
endif
()
if
(
CMAKE_COMPILER_IS_GNUCXX
)
# High level of warnings.
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
-Wall"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
-Wall"
)
# The -Wno-long-long is required in 64bit systems when including sytem headers.
if
(
X86_64
)
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
-Wno-long-long"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
-Wno-long-long"
)
endif
()
# We need pthread's
if
(
UNIX AND NOT ANDROID
)
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
-pthread"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
-pthread"
)
endif
()
if
(
OPENCV_WARNINGS_ARE_ERRORS
)
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
-Werror"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
-Werror"
)
endif
()
if
(
X86 AND NOT MINGW64 AND NOT X86_64 AND NOT APPLE
)
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
-march=i686"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
-march=i686"
)
endif
()
# Other optimizations
if
(
ENABLE_OMIT_FRAME_POINTER
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-fomit-frame-pointer"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-fomit-frame-pointer"
)
else
()
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-fno-omit-frame-pointer"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-fno-omit-frame-pointer"
)
endif
()
if
(
ENABLE_FAST_MATH
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-ffast-math"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-ffast-math"
)
endif
()
if
(
ENABLE_POWERPC
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-mcpu=G3 -mtune=G5"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-mcpu=G3 -mtune=G5"
)
endif
()
if
(
ENABLE_SSE
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-msse"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-msse"
)
endif
()
if
(
ENABLE_SSE2
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-msse2"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-msse2"
)
endif
()
# SSE3 and further should be disabled under MingW because it generates compiler errors
if
(
NOT MINGW
)
if
(
ENABLE_SSE3
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-msse3"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-msse3"
)
endif
()
if
(
${
CMAKE_OPENCV_GCC_VERSION_NUM
}
GREATER 402
)
...
...
@@ -1148,14 +1148,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if
(
HAVE_GCC42_OR_NEWER OR APPLE
)
if
(
ENABLE_SSSE3
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-mssse3"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-mssse3"
)
endif
()
if
(
HAVE_GCC43_OR_NEWER
)
if
(
ENABLE_SSE41
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-msse4.1"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-msse4.1"
)
endif
()
if
(
ENABLE_SSE42
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-msse4.2"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-msse4.2"
)
endif
()
endif
()
endif
()
...
...
@@ -1163,22 +1163,22 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if
(
X86 OR X86_64
)
if
(
NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-mfpmath=387"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-mfpmath=387"
)
endif
()
endif
()
# Profiling?
if
(
ENABLE_PROFILING
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-pg -g"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-pg -g"
)
elseif
(
NOT APPLE
)
# Remove unreferenced functions: function level linking
set
(
EXTRA_C_FLAGS
"
${
EXTRA_C_FLAGS
}
-ffunction-sections"
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_
EXTRA_C_FLAGS
}
-ffunction-sections"
)
endif
()
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
-DNDEBUG"
)
set
(
EXTRA_C_FLAGS_DEBUG
"
${
EXTRA_C_FLAGS_DEBUG
}
-O0 -DDEBUG -D_DEBUG"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
-DNDEBUG"
)
set
(
OPENCV_EXTRA_C_FLAGS_DEBUG
"
${
OPENCV_
EXTRA_C_FLAGS_DEBUG
}
-O0 -DDEBUG -D_DEBUG"
)
if
(
BUILD_WITH_DEBUG_INFO
)
set
(
EXTRA_C_FLAGS_DEBUG
"
${
EXTRA_C_FLAGS_DEBUG
}
-ggdb3"
)
set
(
OPENCV_EXTRA_C_FLAGS_DEBUG
"
${
OPENCV_
EXTRA_C_FLAGS_DEBUG
}
-ggdb3"
)
endif
()
endif
()
...
...
@@ -1186,20 +1186,20 @@ if(MSVC)
# 64-bit MSVC compiler uses SSE/SSE2 by default
if
(
NOT MSVC64
)
if
(
ENABLE_SSE
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
/arch:SSE"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
/arch:SSE"
)
endif
()
if
(
ENABLE_SSE2
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
/arch:SSE2"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
/arch:SSE2"
)
endif
()
endif
()
if
(
ENABLE_SSE3
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
/arch:SSE3"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
/arch:SSE3"
)
endif
()
if
(
ENABLE_SSE4_1
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
/arch:SSE4.1"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
/arch:SSE4.1"
)
endif
()
if
(
ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1
)
set
(
EXTRA_C_FLAGS_RELEASE
"
${
EXTRA_C_FLAGS_RELEASE
}
/Oi"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_
EXTRA_C_FLAGS_RELEASE
}
/Oi"
)
endif
()
endif
()
...
...
@@ -1212,23 +1212,23 @@ endif()
# Add user supplied extra options (optimization, etc...)
# ==========================================================
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
"
CACHE
STRING
"Extra compiler options"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
"
CACHE
STRING
"Extra compiler options for Release build"
)
set
(
OPENCV_EXTRA_C_FLAGS_DEBUG
"
${
OPENCV_EXTRA_C_FLAGS_DEBUG
}
"
CACHE
STRING
"Extra compiler options for Debug build"
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS
"
${
OPENCV_EXTRA_EXE_LINKER_FLAGS
}
"
CACHE
STRING
"Extra linker flags"
FORCE
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
"
${
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
}
"
CACHE
STRING
"Extra linker flags for Release build"
FORCE
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG
"
${
OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG
}
"
CACHE
STRING
"Extra linker flags for Debug build"
FORCE
)
set
(
OPENCV_EXTRA_C_FLAGS
"
${
OPENCV_EXTRA_C_FLAGS
}
"
CACHE
INTERNAL
"Extra compiler options"
)
set
(
OPENCV_EXTRA_C_FLAGS_RELEASE
"
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
"
CACHE
INTERNAL
"Extra compiler options for Release build"
)
set
(
OPENCV_EXTRA_C_FLAGS_DEBUG
"
${
OPENCV_EXTRA_C_FLAGS_DEBUG
}
"
CACHE
INTERNAL
"Extra compiler options for Debug build"
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS
"
${
OPENCV_EXTRA_EXE_LINKER_FLAGS
}
"
CACHE
INTERNAL
"Extra linker flags"
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
"
${
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
}
"
CACHE
INTERNAL
"Extra linker flags for Release build"
)
set
(
OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG
"
${
OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG
}
"
CACHE
INTERNAL
"Extra linker flags for Debug build"
)
#combine all "extra" options
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
EXTRA_C_FLAGS
}
${
OPENCV_EXTRA_C_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
EXTRA_C_FLAGS
}
${
OPENCV_EXTRA_C_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
${
EXTRA_C_FLAGS_RELEASE
}
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
${
EXTRA_C_FLAGS_RELEASE
}
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
${
EXTRA_C_FLAGS_DEBUG
}
${
OPENCV_EXTRA_C_FLAGS_DEBUG
}
"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
${
EXTRA_C_FLAGS_DEBUG
}
${
OPENCV_EXTRA_C_FLAGS_DEBUG
}
"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
${
EXTRA_EXE_LINKER_FLAGS
}
${
OPENCV_EXTRA_EXE_LINKER_FLAGS
}
"
)
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"
${
CMAKE_EXE_LINKER_FLAGS_RELEASE
}
${
EXTRA_EXE_LINKER_FLAGS_RELEASE
}
${
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
}
"
)
set
(
CMAKE_EXE_LINKER_FLAGS_DEBUG
"
${
CMAKE_EXE_LINKER_FLAGS_DEBUG
}
${
EXTRA_EXE_LINKER_FLAGS_DEBUG
}
${
OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG
}
"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
OPENCV_EXTRA_C_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
OPENCV_EXTRA_C_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
${
OPENCV_EXTRA_C_FLAGS_RELEASE
}
"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
${
OPENCV_EXTRA_C_FLAGS_DEBUG
}
"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
${
OPENCV_EXTRA_C_FLAGS_DEBUG
}
"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
${
OPENCV_EXTRA_EXE_LINKER_FLAGS
}
"
)
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"
${
CMAKE_EXE_LINKER_FLAGS_RELEASE
}
${
OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE
}
"
)
set
(
CMAKE_EXE_LINKER_FLAGS_DEBUG
"
${
CMAKE_EXE_LINKER_FLAGS_DEBUG
}
${
OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG
}
"
)
# In case of Makefiles if the user does not setup CMAKE_BUILD_TYPE, assume it's Release:
if
(
CMAKE_GENERATOR MATCHES
".*Makefiles"
AND
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
""
)
...
...
modules/ts/misc/run.py
View file @
6f99447f
...
...
@@ -50,26 +50,29 @@ SIMD_DETECTION_PROGRAM="""
"""
parse_patterns
=
(
{
'name'
:
"has_perf_tests"
,
'default'
:
"OFF"
,
'pattern'
:
re
.
compile
(
"^BUILD_PERF_TESTS:BOOL=(ON)$"
)},
{
'name'
:
"cmake_home"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_HOME_DIRECTORY:INTERNAL=(.+)$"
)},
{
'name'
:
"opencv_home"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^OpenCV_SOURCE_DIR:STATIC=(.+)$"
)},
{
'name'
:
"tests_dir"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^EXECUTABLE_OUTPUT_PATH:PATH=(.+)$"
)},
{
'name'
:
"build_type"
,
'default'
:
"Release"
,
'pattern'
:
re
.
compile
(
"^CMAKE_BUILD_TYPE:STRING=(.*)$"
)},
{
'name'
:
"svnversion_path"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^SVNVERSION_PATH:FILEPATH=(.*)$"
)},
{
'name'
:
"cxx_flags"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_FLAGS:STRING=(.*)$"
)},
{
'name'
:
"cxx_flags_debug"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_FLAGS_DEBUG:STRING=(.*)$"
)},
{
'name'
:
"cxx_flags_release"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_FLAGS_RELEASE:STRING=(.*)$"
)},
{
'name'
:
"cxx_flags_android"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANDROID_CXX_FLAGS:INTERNAL=(.*)$"
)},
{
'name'
:
"cxx_compiler_path"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_COMPILER:FILEPATH=(.*)$"
)},
{
'name'
:
"ndk_path"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^(?:ANDROID_NDK|ANDROID_STANDALONE_TOOLCHAIN)?:PATH=(.*)$"
)},
{
'name'
:
"android_abi"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANDROID_ABI:STRING=(.*)$"
)},
{
'name'
:
"android_executable"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANDROID_EXECUTABLE:FILEPATH=(.*android.*)$"
)},
{
'name'
:
"is_x64"
,
'default'
:
"OFF"
,
'pattern'
:
re
.
compile
(
"^CUDA_64_BIT_DEVICE_CODE:BOOL=(ON)$"
)},
#ugly(
{
'name'
:
"cmake_generator"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_GENERATOR:INTERNAL=(.+)$"
)},
{
'name'
:
"cxx_compiler"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_COMPILER:FILEPATH=(.+)$"
)},
{
'name'
:
"with_cuda"
,
'default'
:
"OFF"
,
'pattern'
:
re
.
compile
(
"^WITH_CUDA:BOOL=(ON)$"
)},
{
'name'
:
"cuda_library"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CUDA_CUDA_LIBRARY:FILEPATH=(.+)$"
)},
{
'name'
:
"core_dependencies"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^opencv_core_LIB_DEPENDS:STATIC=(.+)$"
)},
{
'name'
:
"has_perf_tests"
,
'default'
:
"OFF"
,
'pattern'
:
re
.
compile
(
"^BUILD_PERF_TESTS:BOOL=(ON)$"
)},
{
'name'
:
"cmake_home"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_HOME_DIRECTORY:INTERNAL=(.+)$"
)},
{
'name'
:
"opencv_home"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^OpenCV_SOURCE_DIR:STATIC=(.+)$"
)},
{
'name'
:
"tests_dir"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^EXECUTABLE_OUTPUT_PATH:PATH=(.+)$"
)},
{
'name'
:
"build_type"
,
'default'
:
"Release"
,
'pattern'
:
re
.
compile
(
"^CMAKE_BUILD_TYPE:STRING=(.*)$"
)},
{
'name'
:
"svnversion_path"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^SVNVERSION_PATH:FILEPATH=(.*)$"
)},
{
'name'
:
"cxx_flags"
,
'default'
:
""
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_FLAGS:STRING=(.*)$"
)},
{
'name'
:
"cxx_flags_debug"
,
'default'
:
""
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_FLAGS_DEBUG:STRING=(.*)$"
)},
{
'name'
:
"cxx_flags_release"
,
'default'
:
""
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_FLAGS_RELEASE:STRING=(.*)$"
)},
{
'name'
:
"opencv_cxx_flags"
,
'default'
:
""
,
'pattern'
:
re
.
compile
(
"^OPENCV_EXTRA_C_FLAGS:INTERNAL=(.*)$"
)},
{
'name'
:
"opencv_cxx_flags_debug"
,
'default'
:
""
,
'pattern'
:
re
.
compile
(
"^OPENCV_EXTRA_C_FLAGS_DEBUG:INTERNAL=(.*)$"
)},
{
'name'
:
"opencv_cxx_flags_release"
,
'default'
:
""
,
'pattern'
:
re
.
compile
(
"^OPENCV_EXTRA_C_FLAGS_RELEASE:INTERNAL=(.*)$"
)},
{
'name'
:
"cxx_flags_android"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANDROID_CXX_FLAGS:INTERNAL=(.*)$"
)},
{
'name'
:
"cxx_compiler_path"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_COMPILER:FILEPATH=(.*)$"
)},
{
'name'
:
"ndk_path"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^(?:ANDROID_NDK|ANDROID_STANDALONE_TOOLCHAIN)?:PATH=(.*)$"
)},
{
'name'
:
"android_abi"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANDROID_ABI:STRING=(.*)$"
)},
{
'name'
:
"android_executable"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^ANDROID_EXECUTABLE:FILEPATH=(.*android.*)$"
)},
{
'name'
:
"is_x64"
,
'default'
:
"OFF"
,
'pattern'
:
re
.
compile
(
"^CUDA_64_BIT_DEVICE_CODE:BOOL=(ON)$"
)},
#ugly(
{
'name'
:
"cmake_generator"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_GENERATOR:INTERNAL=(.+)$"
)},
{
'name'
:
"cxx_compiler"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CMAKE_CXX_COMPILER:FILEPATH=(.+)$"
)},
{
'name'
:
"with_cuda"
,
'default'
:
"OFF"
,
'pattern'
:
re
.
compile
(
"^WITH_CUDA:BOOL=(ON)$"
)},
{
'name'
:
"cuda_library"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^CUDA_CUDA_LIBRARY:FILEPATH=(.+)$"
)},
{
'name'
:
"core_dependencies"
,
'default'
:
None
,
'pattern'
:
re
.
compile
(
"^opencv_core_LIB_DEPENDS:STATIC=(.+)$"
)},
)
def
query_yes_no
(
stdout
,
question
,
default
=
"yes"
):
...
...
@@ -447,7 +450,7 @@ class RunInfo(object):
fd
.
write
(
SIMD_DETECTION_PROGRAM
)
fd
.
close
();
options
=
[
self
.
cxx_compiler_path
]
cxx_flags
=
self
.
cxx_flags
+
" "
+
self
.
cxx_flags_release
cxx_flags
=
self
.
cxx_flags
+
" "
+
self
.
cxx_flags_release
+
" "
+
self
.
opencv_cxx_flags
+
" "
+
self
.
opencv_cxx_flags_release
if
self
.
targetos
==
"android"
:
cxx_flags
=
self
.
cxx_flags_android
+
" "
+
cxx_flags
...
...
@@ -464,6 +467,7 @@ class RunInfo(object):
else
:
prev_option
=
prev_option
+
" "
+
opt
options
.
append
(
tmpfile
[
1
])
print
options
output
=
Popen
(
options
,
stdout
=
PIPE
,
stderr
=
PIPE
)
.
communicate
()
compiler_output
=
output
[
1
]
os
.
remove
(
tmpfile
[
1
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment