Skip to content

Commit 05c02a1

Browse files
committed
Add an option
1 parent bc84086 commit 05c02a1

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ foreach (PKG MPC MPFR PIRANHA FLINT LLVM)
4444
set(HAVE_SYMENGINE_${PKG} False)
4545
endif()
4646
endforeach()
47+
option(SYMENGINE_INSTALL_PY_FILES "Install python files" ON)
4748

4849
message("CMAKE_SYSTEM_PROCESSOR : ${CMAKE_SYSTEM_PROCESSOR}")
4950
message("CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE}")

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ def cmake_build(self):
112112
os.remove("CMakeCache.txt")
113113

114114
cmake_cmd = ["cmake", source_dir,
115-
"-DCMAKE_BUILD_TYPE=" + cmake_build_type[0]]
115+
"-DCMAKE_BUILD_TYPE=" + cmake_build_type[0],
116+
"-DSYMENGINE_INSTALL_PY_FILES=OFF",
117+
]
116118
cmake_cmd.extend(process_opts(cmake_opts))
117119
if not path.exists(path.join(build_dir, "CMakeCache.txt")):
118120
cmake_cmd.extend(self.get_generator())

symengine/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
add_subdirectory(lib)
2+
3+
if (SYMENGINE_INSTALL_PY_FILES)
4+
add_subdirectory(tests)
5+
6+
set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine)
7+
install(FILES __init__.py utilities.py sympy_compat.py functions.py printing.py
8+
DESTINATION ${PY_PATH}
9+
)
10+
endif ()

symengine/lib/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ install(FILES
3636
DESTINATION ${PY_PATH}
3737
)
3838

39+
if (SYMENGINE_INSTALL_PY_FILES)
40+
install(FILES __init__.py DESTINATION ${PY_PATH})
41+
endif ()
42+
3943
if (${SYMENGINE_COPY_EXTENSION})
4044
if ("${PYTHON_EXTENSION_SOABI}" MATCHES "ppc64le")
4145
string(REPLACE "ppc64le" "powerpc64le" COPY_PYTHON_EXTENSION_SOABI "${PYTHON_EXTENSION_SOABI}")

symengine/tests/CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine/tests)
2+
install(FILES __init__.py
3+
test_arit.py
4+
test_dict_basic.py
5+
test_eval.py
6+
test_expr.py
7+
test_functions.py
8+
test_number.py
9+
test_matrices.py
10+
test_ntheory.py
11+
test_printing.py
12+
test_sage.py
13+
test_series_expansion.py
14+
test_sets.py
15+
test_solve.py
16+
test_subs.py
17+
test_symbol.py
18+
test_sympify.py
19+
test_sympy_conv.py
20+
test_var.py
21+
test_lambdify.py
22+
test_sympy_compat.py
23+
test_logic.py
24+
DESTINATION ${PY_PATH}
25+
)

0 commit comments

Comments
 (0)