FindPythonLibs3.cmake 769 Bytes
Newer Older
Minh Ngo's avatar
Minh Ngo committed
1
2
3
4
5
6
7
find_package(PkgConfig)
pkg_check_modules(PYTHONLIBS3 QUIET python3)
set(PYTHONLIBS3_DEFINITIONS ${PYTHONLIBS3_CFLAGS_OTHER})

find_path(PYTHONLIBS3_INCLUDE_DIR Python.h
          HINTS ${PYTHONLIBS3_INCLUDEDIR} ${PYTHONLIBS3_INCLUDE_DIRS})

Rex Dieter's avatar
Rex Dieter committed
8
find_library(PYTHONLIBS3_LIBRARY NAMES python3.2m python3.3m python3.4m python3.5m python3.6m python3.7m
Minh Ngo's avatar
Minh Ngo committed
9
10
11
12
13
14
             HINTS ${PYTHONLIBS3_LIBDIR} ${PYTHONLIBS3_LIBRARY_DIRS} )

set(PYTHONLIBS3_LIBRARIES ${PYTHONLIBS3_LIBRARY} )
set(PYTHONLIBS3_INCLUDE_DIRS ${PYTHONLIBS3_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
15
find_package_handle_standard_args(PythonLibs3  DEFAULT_MSG
Minh Ngo's avatar
Minh Ngo committed
16
17
18
                                  PYTHONLIBS3_LIBRARY PYTHONLIBS3_INCLUDE_DIR)

mark_as_advanced(PYTHONLIBS3_INCLUDE_DIR PYTHONLIBS3_LIBRARY)