Skip to content

Commit 2da8c8f

Browse files
authored
cmake use 'Development.Module' when available (#117)
1 parent 59e6b0b commit 2da8c8f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@ set(CMAKE_BUILD_TYPE "Release")
1010
set(Python3_FIND_STRATEGY "LOCATION")
1111
set(Python3_FIND_REGISTRY "LAST")
1212
set(Python3_FIND_FRAMEWORK "LAST")
13-
find_package(Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
13+
14+
# Development vs. Development.Module
15+
# https://cmake.org/cmake/help/latest/module/FindPython3.html?highlight=Development.Module
16+
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18.0")
17+
set(DEVELOPMENT_COMPONENT "Development.Module")
18+
else()
19+
set(DEVELOPMENT_COMPONENT "Development")
20+
endif()
21+
22+
# find Python3
23+
find_package(Python3 COMPONENTS Interpreter "${DEVELOPMENT_COMPONENT}" NumPy REQUIRED)
1424

1525
# find PDAL. Require 2.1+
1626
find_package(PDAL 2.4 REQUIRED)

0 commit comments

Comments
 (0)