forked from AMICI-dev/AMICI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
31 lines (27 loc) · 1.21 KB
/
Copy pathCMakeLists.txt
File metadata and controls
31 lines (27 loc) · 1.21 KB
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
if(DEFINED ENV{PYTHON_EXECUTABLE})
set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE})
endif()
find_package(Python3 COMPONENTS Interpreter)
add_custom_target(
install-python
COMMENT "Installing AMICI base python package"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sdist
COMMAND ${Python3_EXECUTABLE} setup.py install --prefix= --user)
# Create python wheel Note that we have to run build_ext explicitely before
# bdist_wheel, otherwise the swig-generated amici.py will not be added to the
# module build folder, because it does not yet exist at the build_py stage
add_custom_target(
python-wheel
COMMENT "Creating wheel for AMICI base python package"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sdist
COMMAND ${Python3_EXECUTABLE} setup.py build_ext
COMMAND ${Python3_EXECUTABLE} setup.py bdist_wheel
--dist-dir=${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(
python-sdist
COMMENT "Creating sdist for AMICI base python package"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sdist
COMMAND ${Python3_EXECUTABLE} -m pip install build
COMMAND ${Python3_EXECUTABLE} -m build --sdist
--outdir=${CMAKE_CURRENT_BINARY_DIR})
add_custom_command(OUTPUT always_rebuild COMMAND cmake -E echo)