forked from mwarusz/drops.py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (33 loc) · 920 Bytes
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
project(drops.py NONE)
find_package(PythonInterp REQUIRED)
install(
FILES drops.py
DESTINATION bin
PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
)
execute_process (
COMMAND ${PYTHON_EXECUTABLE} -c
"import site, sys; sys.stdout.write(site.PREFIXES[-1])"
OUTPUT_VARIABLE PYTHON_PREFIX
)
file ( TO_CMAKE_PATH "${PYTHON_PREFIX}" PYTHON_PREFIX )
execute_process (
COMMAND ${PYTHON_EXECUTABLE} -c
"import site, sys; sys.stdout.write(site.getsitepackages()[-1])"
OUTPUT_VARIABLE PYTHON_SITE_DIR
)
file ( TO_CMAKE_PATH "${PYTHON_SITE_DIR}" PYTHON_SITE_DIR )
string ( REGEX REPLACE "^${PYTHON_PREFIX}/" ""
PYTHON_SITE_DIR "${PYTHON_SITE_DIR}"
)
install(
DIRECTORY drops_py/
DESTINATION "${PYTHON_SITE_DIR}/drops_py"
PATTERN "drops_py/*.py"
)
enable_testing()
add_subdirectory(tests)