Revision 9048:4e5425c6eedb,
1.3 KB
checked in by Noughmad <Noughmad@…>, 3 years ago
(diff) 
Enable compilation with Python3 as default (on Arch)

Line  

1  # This file is copied from Avogadro 

2  # Home page at http://avogadro.openmolecules.net 

3  # Code repository at https://github.com/cryos/avogadro 

4  

5  

6  #  Find numpy 

7  # Find the native numpy includes 

8  # This module defines 

9  # NUMPY_INCLUDE_DIR, where to find numpy/arrayobject.h, etc. 

10  # NUMPY_FOUND, If false, do not try to use numpy headers. 

11  

12  #if (NUMPY_INCLUDE_DIR) 

13  # in cache already 

14  # set (NUMPY_FIND_QUIETLY TRUE) 

15  #endif (NUMPY_INCLUDE_DIR) 

16  

17  EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} c 

18  "import numpy; print numpy.get_include()" 

19  OUTPUT_VARIABLE NUMPY_INCLUDE_DIR 

20  OUTPUT_STRIP_TRAILING_WHITESPACE) 

21  

22  

23  if (NUMPY_INCLUDE_DIR) 

24  if(EXISTS ${NUMPY_INCLUDE_DIR}/numpy/arrayobject.h) 

25  # successful 

26  set (NUMPY_FOUND TRUE) 

27  set (NUMPY_INCLUDE_DIR ${NUMPY_INCLUDE_DIR} CACHE STRING "Numpy include path") 

28  else() 

29  set(NUMPY_FOUND FALSE) 

30  endif() 

31  else (NUMPY_INCLUDE_DIR) 

32  # Did not successfully include numpy 

33  set(NUMPY_FOUND FALSE) 

34  endif (NUMPY_INCLUDE_DIR) 

35  

36  if (NUMPY_FOUND) 

37  if (NOT NUMPY_FIND_QUIETLY) 

38  message (STATUS "Numpy headers found") 

39  endif (NOT NUMPY_FIND_QUIETLY) 

40  else (NUMPY_FOUND) 

41  if (NUMPY_FIND_REQUIRED) 

42  message (FATAL_ERROR "Numpy headers missing") 

43  endif (NUMPY_FIND_REQUIRED) 

44  endif (NUMPY_FOUND) 

45  

46  MARK_AS_ADVANCED (NUMPY_INCLUDE_DIR) 

Note: See
TracBrowser
for help on using the repository browser.