@@ -10,7 +10,7 @@ if(${SWIG_VERSION} VERSION_GREATER_EQUAL 4)
10
10
list (APPEND CMAKE_SWIG_FLAGS "-doxygen" )
11
11
endif ()
12
12
13
- if (UNIX AND NOT APPLE )
13
+ if (UNIX AND NOT APPLE AND NOT ( CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" ) )
14
14
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
15
15
list (APPEND CMAKE_SWIG_FLAGS "-DSWIGWORDSIZE64" )
16
16
else ()
@@ -59,7 +59,7 @@ function(search_python_module)
59
59
OUTPUT_VARIABLE MODULE_VERSION
60
60
ERROR_QUIET
61
61
OUTPUT_STRIP_TRAILING_WHITESPACE
62
- )
62
+ )
63
63
endif ()
64
64
if (${_RESULT} STREQUAL "0" )
65
65
message (STATUS "Found python module: \" ${MODULE_NAME} \" (found version \" ${MODULE_VERSION} \" )" )
@@ -69,7 +69,8 @@ function(search_python_module)
69
69
execute_process (
70
70
COMMAND ${Python3_EXECUTABLE} -m pip install --user ${MODULE_PACKAGE}
71
71
OUTPUT_STRIP_TRAILING_WHITESPACE
72
- )
72
+ COMMAND_ERROR_IS_FATAL ANY
73
+ )
73
74
else ()
74
75
message (FATAL_ERROR "Can't find python module: \" ${MODULE_NAME} \" , please install it using your system package manager." )
75
76
endif ()
@@ -113,11 +114,9 @@ if(BUILD_TESTING)
113
114
#search_python_module(NAME virtualenv PACKAGE virtualenv)
114
115
# venv not working on github windows runners
115
116
search_python_internal_module(NAME venv)
116
-
117
117
# Testing using a vitual environment
118
118
#set(VENV_EXECUTABLE ${Python3_EXECUTABLE} -m virtualenv)
119
119
set (VENV_EXECUTABLE ${Python3_EXECUTABLE} -m venv)
120
-
121
120
set (VENV_DIR ${CMAKE_CURRENT_BINARY_DIR} /python/venv)
122
121
if (WIN32 )
123
122
set (VENV_Python3_EXECUTABLE ${VENV_DIR} /Scripts/python.exe)
@@ -186,7 +185,7 @@ file(GENERATE
186
185
# COMMAND ${CMAKE_COMMAND} -E copy setup.py setup.py
187
186
# WORKING_DIRECTORY python)
188
187
189
- # Look for python module wheel
188
+ # Look for python modules
190
189
search_python_module(
191
190
NAME setuptools
192
191
PACKAGE setuptools)
@@ -195,7 +194,7 @@ search_python_module(
195
194
PACKAGE wheel)
196
195
197
196
add_custom_command (
198
- OUTPUT python/dist/timestamp
197
+ OUTPUT python/dist_timestamp
199
198
COMMAND ${CMAKE_COMMAND} -E remove_directory dist
200
199
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_PROJECT} /.libs
201
200
# Don't need to copy static lib on Windows.
@@ -213,7 +212,7 @@ add_custom_command(
213
212
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pyFooBar> ${PYTHON_PROJECT} /foobar
214
213
#COMMAND ${Python3_EXECUTABLE} setup.py bdist_egg bdist_wheel
215
214
COMMAND ${Python3_EXECUTABLE} setup.py bdist_wheel
216
- COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_BINARY_DIR} /python/dist/timestamp
215
+ COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_BINARY_DIR} /python/dist_timestamp
217
216
MAIN_DEPENDENCY
218
217
python/setup.py.in
219
218
DEPENDS
@@ -233,7 +232,7 @@ add_custom_command(
233
232
# Main Target
234
233
add_custom_target (python_package ALL
235
234
DEPENDS
236
- python/dist/timestamp
235
+ python/dist_timestamp
237
236
WORKING_DIRECTORY python)
238
237
239
238
if (BUILD_TESTING)
0 commit comments