Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
diff --git b/CMakeLists.txt a/CMakeLists.txt
index d879164a8..e92b21e70 100644
--- b/CMakeLists.txt
+++ a/CMakeLists.txt
@@ -83,7 +83,7 @@ set( target-bits-split "standard" CACHE STRING "Split of the 64-bit target neuro
################################################################################
# In general use the CMAKE_INSTALL_<dir> and CMAKE_INSTALL_FULL_<dir> vars from
-# GNUInstallDirs (included after calling nest_process_with_python()), but the
+# GNUInstallDirs (included after calling nest_process_with_python()), but the
# CMAKE_INSTALL_DATADIR is usually just CMAKE_INSTALL_DATAROOTDIR
# and we want it to be CMAKE_INSTALL_DATAROOTDIR/PROJECT_NAME
set( CMAKE_INSTALL_DATADIR "share/${PROJECT_NAME}" CACHE STRING "Relative directory, where NEST installs its data (share/nest)" )
@@ -130,6 +130,7 @@ nest_set_default_compiler_flags()
# of GNUInstallDirs defining CMAKE_INSTALL_<dir> and CMAKE_INSTALL_FULL_<dir>.
nest_process_with_python()
include( GNUInstallDirs )
+nest_post_process_with_python()
nest_process_with_optimize()
nest_process_with_debug()
nest_process_with_intel_compiler_flags()
diff --git b/cmake/ProcessOptions.cmake a/cmake/ProcessOptions.cmake
index 1d69c1a84..7e47db25b 100644
--- b/cmake/ProcessOptions.cmake
+++ a/cmake/ProcessOptions.cmake
@@ -399,25 +399,25 @@ function( NEST_PROCESS_WITH_PYTHON )
execute_process( COMMAND "${Python_EXECUTABLE}" "-c"
"import sys, os; print(int(bool(os.environ.get('CONDA_DEFAULT_ENV', False)) or (sys.prefix != sys.base_prefix)))"
OUTPUT_VARIABLE Python_InVirtualEnv OUTPUT_STRIP_TRAILING_WHITESPACE )
-
+
if ( NOT Python_InVirtualEnv AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
message( FATAL_ERROR "No virtual Python environment found and no installation prefix specified. "
"Please either build and install NEST in a virtual Python environment or specify CMake option -DCMAKE_INSTALL_PREFIX=<nest_install_dir>.")
endif()
-
+
# Setting CMAKE_INSTALL_PREFIX effects the inclusion of GNUInstallDirs defining CMAKE_INSTALL_<dir> and CMAKE_INSTALL_FULL_<dir>
get_filename_component( Python_EnvRoot "${Python_SITELIB}/../../.." ABSOLUTE)
set ( CMAKE_INSTALL_PREFIX "${Python_EnvRoot}" CACHE PATH "Default install prefix for the active Python interpreter" FORCE )
endif ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
- set( HAVE_PYTHON ON PARENT_SCOPE )
-
# export found variables to parent scope
+ set( HAVE_PYTHON ON PARENT_SCOPE )
set( Python_FOUND "${Python_FOUND}" PARENT_SCOPE )
set( Python_EXECUTABLE ${Python_EXECUTABLE} PARENT_SCOPE )
set( PYTHON ${Python_EXECUTABLE} PARENT_SCOPE )
set( Python_VERSION ${Python_VERSION} PARENT_SCOPE )
-
+ set( Python_VERSION_MAJOR ${Python_VERSION_MAJOR} PARENT_SCOPE )
+ set( Python_VERSION_MINOR ${Python_VERSION_MINOR} PARENT_SCOPE )
set( Python_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" PARENT_SCOPE )
set( Python_LIBRARIES "${Python_LIBRARIES}" PARENT_SCOPE )
@@ -431,7 +431,6 @@ function( NEST_PROCESS_WITH_PYTHON )
set( CYTHON_VERSION "${CYTHON_VERSION}" PARENT_SCOPE )
endif ()
endif ()
- set( PYEXECDIR "lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages" PARENT_SCOPE )
endif ()
elseif ( ${with-python} STREQUAL "OFF" )
else ()
@@ -439,6 +438,12 @@ function( NEST_PROCESS_WITH_PYTHON )
endif ()
endfunction()
+function( NEST_POST_PROCESS_WITH_PYTHON )
+ if ( Python_FOUND )
+ set( PYEXECDIR "${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages" PARENT_SCOPE )
+ endif()
+endfunction()
+
function( NEST_PROCESS_WITH_OPENMP )
# Find OPENMP
if ( with-openmp )