@@ -62,14 +62,8 @@ else (NOT APPLE)
62
62
set (rt "" )
63
63
endif (NOT APPLE )
64
64
65
- # This setting mirrors FindPythonInterp behavior on Windows/macOS, which did not consult registry/frameworks first.
66
- if (NOT DEFINED Python_FIND_REGISTRY)
67
- set (Python_FIND_REGISTRY "LAST" )
68
- endif ()
69
- if (NOT DEFINED Python_FIND_FRAMEWORK)
70
- set (Python_FIND_FRAMEWORK "LAST" )
71
- endif ()
72
- find_package (Python REQUIRED COMPONENTS Interpreter Development)
65
+ find_package (PythonInterp REQUIRED)
66
+ find_package (PythonLibs REQUIRED)
73
67
find_package (Threads REQUIRED)
74
68
find_package (Proton 0.33.0 REQUIRED COMPONENTS Core Proactor)
75
69
message (STATUS "Found Proton: ${Proton_LIBRARIES} (found version \" ${Proton_VERSION} \" )" )
@@ -108,29 +102,31 @@ if (LIBWEBSOCKETS_FOUND AND LIBWEBSOCKETS_VERSION_STRING)
108
102
endif (LIBWEBSOCKETS_FOUND AND LIBWEBSOCKETS_VERSION_STRING)
109
103
110
104
# Python
111
- if (Python_VERSION_MAJOR STREQUAL 3)
105
+ if (PYTHON_VERSION_MAJOR STREQUAL 3)
112
106
set (PY_STRING "python3" )
113
- elseif (Python_VERSION_MAJOR STREQUAL 2)
107
+ elseif (PYTHON_VERSION_MAJOR STREQUAL 2)
114
108
set (PY_STRING "python" )
115
109
endif ()
116
110
111
+ enable_testing ()
112
+
117
113
# python unittest
118
114
# For versions < 2.7 the developer needs to install the unittest2
119
115
# module (available via 'yum install python-unittest2' or 'pip install unittest2'
120
116
#
121
- if (Python_VERSION_MAJOR EQUAL 2 AND Python_VERSION_MINOR LESS 7)
117
+ if (PYTHON_VERSION_MAJOR EQUAL 2 AND PYTHON_VERSION_MINOR LESS 7)
122
118
set (PYTHON_TEST_COMMAND "unit2" )
123
- execute_process (COMMAND "${Python_EXECUTABLE } " "-c" "import unittest2"
119
+ execute_process (COMMAND "${PYTHON_EXECUTABLE } " "-c" "import unittest2"
124
120
RESULT_VARIABLE UNITTEST_MISSING
125
121
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
126
122
if (UNITTEST_MISSING)
127
123
message (WARNING "python-unittest2 is not installed. ***unit tests cannot be run***\n try 'pip install python-unittest2' to install python-unittest2" )
128
124
# add bogus test for folk who may have missed the cmake warning
129
125
add_test (WARNING_python_unittest2_module_NOT_INSTALLED false )
130
126
endif (UNITTEST_MISSING)
131
- else (Python_VERSION_MAJOR EQUAL 2 AND Python_VERSION_MINOR LESS 7)
127
+ else (PYTHON_VERSION_MAJOR EQUAL 2 AND PYTHON_VERSION_MINOR LESS 7)
132
128
set (PYTHON_TEST_COMMAND "-m" "unittest" )
133
- endif (Python_VERSION_MAJOR EQUAL 2 AND Python_VERSION_MINOR LESS 7)
129
+ endif (PYTHON_VERSION_MAJOR EQUAL 2 AND PYTHON_VERSION_MINOR LESS 7)
134
130
135
131
if (NOT UNITTEST_MISSING)
136
132
if (NOT DEFINED DISPATCH_TEST_TIMEOUT)
@@ -166,7 +162,7 @@ set(CONSOLE_BASE_INSTALL_DIR "share/qpid-dispatch/console")
166
162
set (CONSOLE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX} /${CONSOLE_BASE_INSTALL_DIR} " )
167
163
set (CONSOLE_STAND_ALONE_INSTALL_DIR "${CONSOLE_INSTALL_DIR} " )
168
164
169
- set (RUN ${Python_EXECUTABLE } ${CMAKE_BINARY_DIR} /run.py)
165
+ set (RUN ${PYTHON_EXECUTABLE } ${CMAKE_BINARY_DIR} /run.py)
170
166
171
167
# define the configuration directory based on whether or not the install prefix is defined
172
168
if (NOT DEFINED SYSCONF_INSTALL_DIR)
@@ -197,7 +193,7 @@ include_directories(
197
193
${CMAKE_CURRENT_BINARY_DIR} /include
198
194
${Proton_Proactor_INCLUDE_DIRS}
199
195
${Proton_Core_INCLUDE_DIRS}
200
- ${Python_INCLUDE_DIRS }
196
+ ${PYTHON_INCLUDE_PATH }
201
197
)
202
198
203
199
# Originally from the LLVM project, https://opensource.apple.com/source/llvmCore/llvmCore-2358.3/CMakeLists.txt.auto.html
0 commit comments