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
b8804ccc
Commit
b8804ccc
authored
May 18, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem with manually set PYTHON_PACKAGES_PATH #1891
parent
639bf3ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
48 deletions
+46
-48
android.toolchain.cmake
android/android.toolchain.cmake
+38
-38
OpenCVDetectPython.cmake
cmake/OpenCVDetectPython.cmake
+8
-10
No files found.
android/android.toolchain.cmake
View file @
b8804ccc
...
...
@@ -766,30 +766,30 @@ set( CMAKE_COMPILER_IS_GNUASM 1)
# NDK flags
if
(
ARMEABI OR ARMEABI_V7A
)
# NDK also defines -ffunction-sections -funwind-tables but they result in worse OpenCV performance
set
(
CMAKE_CXX_FLAGS
"-fPIC -Wno-psabi"
)
set
(
CMAKE_C_FLAGS
"-fPIC -Wno-psabi"
)
set
(
_
CMAKE_CXX_FLAGS
"-fPIC -Wno-psabi"
)
set
(
_
CMAKE_C_FLAGS
"-fPIC -Wno-psabi"
)
remove_definitions
(
-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__
)
add_definitions
(
-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__
)
# extra arm-specific flags
set
(
ANDROID_CXX_FLAGS
"
${
ANDROID_CXX_FLAGS
}
-fsigned-char"
)
elseif
(
X86
)
set
(
CMAKE_CXX_FLAGS
"-funwind-tables"
)
set
(
CMAKE_C_FLAGS
"-funwind-tables"
)
set
(
_
CMAKE_CXX_FLAGS
"-funwind-tables"
)
set
(
_
CMAKE_C_FLAGS
"-funwind-tables"
)
elseif
(
MIPS
)
set
(
CMAKE_CXX_FLAGS
"-fpic -Wno-psabi -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers"
)
set
(
CMAKE_CXX_FLAGS
"-fpic -Wno-psabi -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers"
)
set
(
_
CMAKE_CXX_FLAGS
"-fpic -Wno-psabi -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers"
)
set
(
_
CMAKE_CXX_FLAGS
"-fpic -Wno-psabi -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers"
)
set
(
ANDROID_CXX_FLAGS
"
${
ANDROID_CXX_FLAGS
}
-fsigned-char"
)
else
()
set
(
CMAKE_CXX_FLAGS
""
)
set
(
CMAKE_C_FLAGS
""
)
set
(
_
CMAKE_CXX_FLAGS
""
)
set
(
_
CMAKE_C_FLAGS
""
)
endif
()
if
(
ANDROID_USE_STLPORT
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fno-rtti -fno-exceptions"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fno-rtti -fno-exceptions"
)
set
(
_CMAKE_CXX_FLAGS
"
${
_
CMAKE_CXX_FLAGS
}
-fno-rtti -fno-exceptions"
)
set
(
_CMAKE_C_FLAGS
"
${
_
CMAKE_C_FLAGS
}
-fno-rtti -fno-exceptions"
)
else
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-frtti -fexceptions"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fexceptions"
)
set
(
_CMAKE_CXX_FLAGS
"
${
_
CMAKE_CXX_FLAGS
}
-frtti -fexceptions"
)
set
(
_CMAKE_C_FLAGS
"
${
_
CMAKE_C_FLAGS
}
-fexceptions"
)
endif
()
#release and debug flags
...
...
@@ -798,33 +798,33 @@ if( ARMEABI OR ARMEABI_V7A )
#It is recommended to use the -mthumb compiler flag to force the generation
#of 16-bit Thumb-1 instructions (the default being 32-bit ARM ones).
# O3 instead of O2/Os in release mode - like cmake sets for desktop gcc
set
(
CMAKE_CXX_FLAGS_RELEASE
"-mthumb -O3"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-mthumb -O3"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-marm -Os -finline-limit=64"
)
set
(
CMAKE_C_FLAGS_DEBUG
"-marm -Os -finline-limit=64"
)
set
(
_
CMAKE_CXX_FLAGS_RELEASE
"-mthumb -O3"
)
set
(
_
CMAKE_C_FLAGS_RELEASE
"-mthumb -O3"
)
set
(
_
CMAKE_CXX_FLAGS_DEBUG
"-marm -Os -finline-limit=64"
)
set
(
_
CMAKE_C_FLAGS_DEBUG
"-marm -Os -finline-limit=64"
)
else
()
# always compile ARMEABI_V6 in arm mode; otherwise there is no difference from ARMEABI
# O3 instead of O2/Os in release mode - like cmake sets for desktop gcc
set
(
CMAKE_CXX_FLAGS_RELEASE
"-marm -O3 -fstrict-aliasing"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-marm -O3 -fstrict-aliasing"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-marm -O0 -finline-limit=300"
)
set
(
CMAKE_C_FLAGS_DEBUG
"-marm -O0 -finline-limit=300"
)
set
(
_
CMAKE_CXX_FLAGS_RELEASE
"-marm -O3 -fstrict-aliasing"
)
set
(
_
CMAKE_C_FLAGS_RELEASE
"-marm -O3 -fstrict-aliasing"
)
set
(
_
CMAKE_CXX_FLAGS_DEBUG
"-marm -O0 -finline-limit=300"
)
set
(
_
CMAKE_C_FLAGS_DEBUG
"-marm -O0 -finline-limit=300"
)
endif
()
elseif
(
X86
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -fstrict-aliasing"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-O3 -fstrict-aliasing"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -finline-limit=300"
)
set
(
CMAKE_C_FLAGS_DEBUG
"-O0 -finline-limit=300"
)
set
(
_
CMAKE_CXX_FLAGS_RELEASE
"-O3 -fstrict-aliasing"
)
set
(
_
CMAKE_C_FLAGS_RELEASE
"-O3 -fstrict-aliasing"
)
set
(
_
CMAKE_CXX_FLAGS_DEBUG
"-O0 -finline-limit=300"
)
set
(
_
CMAKE_C_FLAGS_DEBUG
"-O0 -finline-limit=300"
)
elseif
(
MIPS
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -funswitch-loops -finline-limit=300"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-O3 -funswitch-loops -finline-limit=300"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
set
(
CMAKE_C_FLAGS_DEBUG
"-O0 -g"
)
set
(
_
CMAKE_CXX_FLAGS_RELEASE
"-O3 -funswitch-loops -finline-limit=300"
)
set
(
_
CMAKE_C_FLAGS_RELEASE
"-O3 -funswitch-loops -finline-limit=300"
)
set
(
_
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
set
(
_
CMAKE_C_FLAGS_DEBUG
"-O0 -g"
)
endif
()
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
-fomit-frame-pointer -DNDEBUG"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
-fomit-frame-pointer -DNDEBUG"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-fno-strict-aliasing -fno-omit-frame-pointer -DDEBUG -D_DEBUG"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-fno-strict-aliasing -fno-omit-frame-pointer -DDEBUG -D_DEBUG"
)
set
(
_CMAKE_CXX_FLAGS_RELEASE
"
${
_
CMAKE_CXX_FLAGS_RELEASE
}
-fomit-frame-pointer -DNDEBUG"
)
set
(
_CMAKE_C_FLAGS_RELEASE
"
${
_
CMAKE_C_FLAGS_RELEASE
}
-fomit-frame-pointer -DNDEBUG"
)
set
(
_CMAKE_CXX_FLAGS_DEBUG
"
${
_
CMAKE_CXX_FLAGS_DEBUG
}
-fno-strict-aliasing -fno-omit-frame-pointer -DDEBUG -D_DEBUG"
)
set
(
_CMAKE_C_FLAGS_DEBUG
"
${
_
CMAKE_C_FLAGS_DEBUG
}
-fno-strict-aliasing -fno-omit-frame-pointer -DDEBUG -D_DEBUG"
)
#ABI-specific flags
if
(
ARMEABI_V7A
)
...
...
@@ -928,12 +928,12 @@ if( ARMEABI_V7A )
endif
()
#cache flags
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
CACHE STRING
"c++ flags"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
"
CACHE STRING
"c flags"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
"
CACHE STRING
"c++ Release flags"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
"
CACHE STRING
"c Release flags"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
"
CACHE STRING
"c++ Debug flags"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
"
CACHE STRING
"c Debug flags"
)
set
(
CMAKE_CXX_FLAGS
"
${
_
CMAKE_CXX_FLAGS
}
"
CACHE STRING
"c++ flags"
)
set
(
CMAKE_C_FLAGS
"
${
_
CMAKE_C_FLAGS
}
"
CACHE STRING
"c flags"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
_
CMAKE_CXX_FLAGS_RELEASE
}
"
CACHE STRING
"c++ Release flags"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
_
CMAKE_C_FLAGS_RELEASE
}
"
CACHE STRING
"c Release flags"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
_
CMAKE_CXX_FLAGS_DEBUG
}
"
CACHE STRING
"c++ Debug flags"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
_
CMAKE_C_FLAGS_DEBUG
}
"
CACHE STRING
"c Debug flags"
)
set
(
CMAKE_SHARED_LINKER_FLAGS
""
CACHE STRING
"linker flags"
)
set
(
CMAKE_MODULE_LINKER_FLAGS
""
CACHE STRING
"linker flags"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"-Wl,-z,nocopyreloc"
CACHE STRING
"linker flags"
)
...
...
cmake/OpenCVDetectPython.cmake
View file @
b8804ccc
...
...
@@ -12,12 +12,10 @@ if(MSVC AND NOT PYTHON_EXECUTABLE)
)
endforeach
()
endif
()
find_host_package
(
PythonInterp 2.0
)
unset
(
PYTHON_USE_NUMPY CACHE
)
unset
(
HAVE_SPHINX CACHE
)
if
(
PYTHON_EXECUTABLE
)
if
(
PYTHON_VERSION_STRING
)
set
(
PYTHON_VERSION_MAJOR_MINOR
"
${
PYTHON_VERSION_MAJOR
}
.
${
PYTHON_VERSION_MINOR
}
"
)
...
...
@@ -46,16 +44,15 @@ if(PYTHON_EXECUTABLE)
OUTPUT_VARIABLE PYTHON_STD_PACKAGES_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
"
${
PYTHON_STD_PACKAGES_PATH
}
"
MATCHES
"site-packages"
)
set
(
PYTHON_PACKAGES_PATH
"python
${
PYTHON_VERSION_MAJOR_MINOR
}
/site-packages"
)
set
(
_
PYTHON_PACKAGES_PATH
"python
${
PYTHON_VERSION_MAJOR_MINOR
}
/site-packages"
)
else
()
#debian based assumed, install to the dist-packages.
set
(
PYTHON_PACKAGES_PATH
"python
${
PYTHON_VERSION_MAJOR_MINOR
}
/dist-packages"
)
set
(
_
PYTHON_PACKAGES_PATH
"python
${
PYTHON_VERSION_MAJOR_MINOR
}
/dist-packages"
)
endif
()
if
(
EXISTS
"
${
CMAKE_INSTALL_PREFIX
}
/lib
${
LIB_SUFFIX
}
/
${
PYTHON_PACKAGES_PATH
}
"
)
set
(
PYTHON_PACKAGES_PATH
"lib
${
LIB_SUFFIX
}
/
${
PYTHON_PACKAGES_PATH
}
"
)
set
(
_PYTHON_PACKAGES_PATH
"lib
${
LIB_SUFFIX
}
/
${
_
PYTHON_PACKAGES_PATH
}
"
)
else
()
set
(
PYTHON_PACKAGES_PATH
"lib/
${
PYTHON_PACKAGES_PATH
}
"
)
set
(
_PYTHON_PACKAGES_PATH
"lib/
${
_
PYTHON_PACKAGES_PATH
}
"
)
endif
()
set
(
PYTHON_PACKAGES_PATH
"
${
PYTHON_PACKAGES_PATH
}
"
CACHE PATH
"Where to install the python packages."
)
elseif
(
CMAKE_HOST_WIN32
)
get_filename_component
(
PYTHON_PATH
"
${
PYTHON_EXECUTABLE
}
"
PATH
)
file
(
TO_CMAKE_PATH
"
${
PYTHON_PATH
}
"
PYTHON_PATH
)
...
...
@@ -67,8 +64,9 @@ if(PYTHON_EXECUTABLE)
endif
()
file
(
TO_CMAKE_PATH
"
${
PYTHON_PATH
}
"
PYTHON_PATH
)
endif
()
set
(
PYTHON_PACKAGES_PATH
"
${
PYTHON_PATH
}
/Lib/site-packages"
)
set
(
_
PYTHON_PACKAGES_PATH
"
${
PYTHON_PATH
}
/Lib/site-packages"
)
endif
()
SET
(
PYTHON_PACKAGES_PATH
"
${
_PYTHON_PACKAGES_PATH
}
"
CACHE PATH
"Where to install the python packages."
)
if
(
NOT PYTHON_NUMPY_INCLUDE_DIR
)
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
...
...
@@ -78,8 +76,8 @@ if(PYTHON_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
PYTHON_NUMPY_PROCESS EQUAL 0
)
file
(
TO_CMAKE_PATH
"
${
PYTHON_NUMPY_INCLUDE_DIR
}
"
PYTHON_NUMPY_INCLUDE_DIR
)
set
(
PYTHON_NUMPY_INCLUDE_DIR
${
PYTHON_NUMPY_INCLUDE_DIR
}
CACHE PATH
"Path to numpy headers"
)
file
(
TO_CMAKE_PATH
"
${
PYTHON_NUMPY_INCLUDE_DIR
}
"
_
PYTHON_NUMPY_INCLUDE_DIR
)
set
(
PYTHON_NUMPY_INCLUDE_DIR
${
_
PYTHON_NUMPY_INCLUDE_DIR
}
CACHE PATH
"Path to numpy headers"
)
endif
()
endif
()
...
...
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