forked from AmbaPant/mantid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
21 lines (16 loc) · 1.04 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Defines a rule to compile all of the Python files that have been installed as part of the package.
# CMake seems to put all of the current-level install commands "before" any sub- directories that you have added, even
# if you add them before the install rule.
# To ensure that this script runs after everything is installed it is in this subdirectory so that it can be the last
# thing added. It is at the Framework level so that a "Framework Only" build is still valid.
# When building the package CPack installs into ${DESTDIR}${CMAKE_INSTALL_PREFIX} but this should be evaluated at CPack
# time so escape the $ to its written literally.
set(PACKAGE_ROOT \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX})
set(EXCLUDE_REGEX ".*_template")
set(COMPILE_SCRIPT "message ( \"Byte-compiling Python in ${PACKAGE_ROOT}\")")
set(COMPILE_SCRIPT
"${COMPILE_SCRIPT}\n execute_process ( COMMAND ${Python_EXECUTABLE} -m compileall -q -j 0 -x \"${EXCLUDE_REGEX}\" \"${PACKAGE_ROOT}\" OUTPUT_QUIET ERROR_QUIET )"
)
if(NOT CONDA_BUILD)
install(CODE ${COMPILE_SCRIPT})
endif()