Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
4ff44232
Commit
4ff44232
authored
Dec 08, 2017
by
Davis King
Browse files
cleaned up cmake
parent
ac292309
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
24 deletions
+21
-24
tools/python/CMakeLists.txt
tools/python/CMakeLists.txt
+21
-24
No files found.
tools/python/CMakeLists.txt
View file @
4ff44232
...
@@ -9,20 +9,21 @@ add_definitions(-DDLIB_NO_ABORT_ON_2ND_FATAL_ERROR)
...
@@ -9,20 +9,21 @@ add_definitions(-DDLIB_NO_ABORT_ON_2ND_FATAL_ERROR)
include
(
../../dlib/cmake_utils/add_python_module
)
include
(
../../dlib/cmake_utils/add_python_module
)
# Test for numpy
# Test for numpy
FIND_PACKAGE
(
PythonInterp
)
find_package
(
PythonInterp
)
IF
(
PYTHONINTERP_FOUND
)
if
(
PYTHONINTERP_FOUND
)
EXECUTE_PROCESS
(
COMMAND
${
PYTHON_EXECUTABLE
}
-c
"import numpy"
OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NUMPYRC
)
execute_process
(
COMMAND
${
PYTHON_EXECUTABLE
}
-c
"import numpy"
OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NUMPYRC
)
IF
(
NUMPYRC EQUAL 1
)
if
(
NUMPYRC EQUAL 1
)
MESSAGE
(
WARNING
"Numpy not found. Functions that return numpy arrays will throw exceptions!"
)
message
(
WARNING
"Numpy not found. Functions that return numpy arrays will throw exceptions!"
)
ELSE
(
NUMPYRC EQUAL 1
)
else
(
)
MESSAGE
(
STATUS
"Found Python with installed numpy package"
)
message
(
STATUS
"Found Python with installed numpy package"
)
EXECUTE_PROCESS
(
COMMAND
${
PYTHON_EXECUTABLE
}
-c
"import sys; from numpy import get_include; sys.stdout.write(get_include())"
OUTPUT_VARIABLE NUMPY_INCLUDE_PATH
)
execute_process
(
COMMAND
${
PYTHON_EXECUTABLE
}
-c
"import sys; from numpy import get_include; sys.stdout.write(get_include())"
OUTPUT_VARIABLE NUMPY_INCLUDE_PATH
)
MESSAGE
(
STATUS
"Numpy include path '
${
NUMPY_INCLUDE_PATH
}
'"
)
message
(
STATUS
"Numpy include path '
${
NUMPY_INCLUDE_PATH
}
'"
)
include_directories
(
${
NUMPY_INCLUDE_PATH
}
)
include_directories
(
${
NUMPY_INCLUDE_PATH
}
)
ENDIF
(
NUMPYRC EQUAL 1
)
endif
()
ELSE
(
PYTHONINTERP_FOUND
)
else
()
MESSAGE
(
FATAL_ERROR
"Could not find Python interpreter"
)
message
(
WARNING
"Numpy not found. Functions that return numpy arrays will throw exceptions!"
)
ENDIF
(
PYTHONINTERP_FOUND
)
set
(
NUMPYRC 1
)
endif
()
add_definitions
(
-DDLIB_VERSION=
${
DLIB_VERSION
}
)
add_definitions
(
-DDLIB_VERSION=
${
DLIB_VERSION
}
)
...
@@ -50,20 +51,16 @@ set(python_srcs
...
@@ -50,20 +51,16 @@ set(python_srcs
)
)
# Only add the Numpy returning functions if Numpy is present
# Only add the Numpy returning functions if Numpy is present
IF
(
NUMPYRC EQUAL 1
)
if
(
NUMPYRC EQUAL 1
)
list
(
APPEND python_srcs src/numpy_returns_stub.cpp
)
list
(
APPEND python_srcs src/numpy_returns_stub.cpp
)
ELSE
(
NUMPYRC EQUAL 1
)
else
(
)
list
(
APPEND python_srcs src/numpy_returns.cpp
)
list
(
APPEND python_srcs src/numpy_returns.cpp
)
ENDIF
(
NUMPYRC EQUAL 1
)
endif
()
if
(
NOT
${
DLIB_NO_GUI_SUPPORT
}
)
list
(
APPEND python_srcs src/gui.cpp
)
endif
(
NOT
${
DLIB_NO_GUI_SUPPORT
}
)
# Only add the GUI module if requested
# Only add the GUI module if requested
if
(
NOT
${
DLIB_NO_GUI_SUPPORT
}
)
if
(
NOT
${
DLIB_NO_GUI_SUPPORT
}
)
list
(
APPEND python_srcs src/gui.cpp
)
list
(
APPEND python_srcs src/gui.cpp
)
endif
(
NOT
${
DLIB_NO_GUI_SUPPORT
}
)
endif
()
add_python_module
(
dlib
${
python_srcs
}
)
add_python_module
(
dlib
${
python_srcs
}
)
...
...
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