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é)
2
2
3
- # Par défaut on utilise Python 2
3
+ # On utilise Python 3 sauf si python 2 est demandé
4
4
5
5
include (GNUInstallDirs)
6
6
find_package (SWIG 3 REQUIRED)
7
7
8
8
9
9
#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)
21
11
message (STATUS "========================================= UTILISATION DE PYTHON 2 =========================================" )
22
12
find_package (Python2 REQUIRED COMPONENTS Interpreter Development)
23
13
set (Python_INCLUDE_DIRS ${Python2_INCLUDE_DIRS} )
@@ -27,9 +17,17 @@ elseif (USE_PYTHON_2)
27
17
set (Python_LIBRARY_DIRS ${Python2_LIBRARY_DIRS} )
28
18
set (PYTHON_MAJOR_VERSION 2)
29
19
else ( )
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)
33
31
34
32
35
33
# Recherche du répertoire d'installation des modules (procédure spack organizer) :
0 commit comments