1- # Version 0.5 (21/6/23 , support Python 2/Python 3, répertoire d'installation des modules python fourni par le python utilisé)
1+ # Version 0.7 (26/11/24 , support Python 2/Python 3, répertoire d'installation des modules python fourni par le python utilisé)
22
3- # Par défaut on utilise Python 2
3+ # On utilise Python 3 sauf si python 2 est demandé
44
55include (GNUInstallDirs)
66find_package (SWIG 3 REQUIRED)
77
88
99#find_package (Python REQUIRED COMPONENTS Interpreter Development) # Rem : Python3 a la priorité => inutilisé car empêche l'accès à Python2
10- if (USE_PYTHON_3)
11- message (STATUS "========================================= UTILISATION DE PYTHON 3 =========================================" )
12- set (Python3_FIND_STRATEGY LOCATION ) # Nécessaire pour python >= 3.10
13- find_package (Python3 REQUIRED COMPONENTS Interpreter Development)
14- set (Python_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} )
15- set (Python_EXECUTABLE ${Python3_EXECUTABLE} )
16- set (Python_VERSION ${Python3_VERSION} )
17- set (Python_LIBRARIES ${Python3_LIBRARIES} )
18- set (Python_LIBRARY_DIRS ${Python3_LIBRARY_DIRS} )
19- set (PYTHON_MAJOR_VERSION 3)
20- elseif (USE_PYTHON_2)
10+ if (USE_PYTHON_2)
2111 message (STATUS "========================================= UTILISATION DE PYTHON 2 =========================================" )
2212 find_package (Python2 REQUIRED COMPONENTS Interpreter Development)
2313 set (Python_INCLUDE_DIRS ${Python2_INCLUDE_DIRS} )
@@ -27,9 +17,17 @@ elseif (USE_PYTHON_2)
2717 set (Python_LIBRARY_DIRS ${Python2_LIBRARY_DIRS} )
2818 set (PYTHON_MAJOR_VERSION 2)
2919else ( )
30- message (STATUS "========================================= VERSION DE PYTHON NON DEFINIE =========================================" )
31- message (FATAL_ERROR "==> UTILISEZ -DUSE_PYTHON_2 OU -DUSE_PYTHON_3 A LA LIGNE DE COMMANDE" )
32- endif (USE_PYTHON_3)
20+ message (STATUS "========================================= UTILISATION DE PYTHON 3 =========================================" )
21+ set (USE_PYTHON_3 ON )
22+ set (Python3_FIND_STRATEGY LOCATION ) # Nécessaire pour python >= 3.10
23+ find_package (Python3 REQUIRED COMPONENTS Interpreter Development)
24+ set (Python_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} )
25+ set (Python_EXECUTABLE ${Python3_EXECUTABLE} )
26+ set (Python_VERSION ${Python3_VERSION} )
27+ set (Python_LIBRARIES ${Python3_LIBRARIES} )
28+ set (Python_LIBRARY_DIRS ${Python3_LIBRARY_DIRS} )
29+ set (PYTHON_MAJOR_VERSION 3)
30+ endif (USE_PYTHON_2)
3331
3432
3533# Recherche du répertoire d'installation des modules (procédure spack organizer) :
0 commit comments