2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 18:52:26 +00:00
Files
python/libs/numpy/example/CMakeLists.txt
Jonas Hoersch c8798676f6 cmake: switch from using deprecated linklibraries to target_linklibraries
the total information duplication actually decreases and it
facilitates reusing CMake instructions from outer projects.
2013-10-06 20:03:51 +02:00

52 lines
1.6 KiB
CMake

# custom macro with most of the redundant code for making a python example module
macro( addPythonExe _name _srccpp )
ADD_EXECUTABLE(${_name} ${_srccpp})
# make the pyd library link against boost_numpy python and boost
TARGET_LINK_LIBRARIES(${_name} boost_numpy)
# put the example target into a VS solution folder named example (should
# be a no-op for Linux)
SET_PROPERTY(TARGET ${_name} PROPERTY FOLDER "example")
endmacro()
macro( addPythonMod _name _srccpp )
PYTHON_ADD_MODULE(${_name} ${_srccpp})
# make the pyd library link against boost_numpy python and boost
TARGET_LINK_LIBRARIES(${_name} boost_numpy)
# put the example target into a VS solution folder named example (should
# be a no-op for Linux)
SET_PROPERTY(TARGET ${_name} PROPERTY FOLDER "example")
endmacro()
addPythonMod(gaussian gaussian.cpp)
addPythonExe(dtype dtype.cpp)
addPythonExe(fromdata fromdata.cpp)
addPythonExe(ndarray ndarray.cpp)
addPythonExe(simple simple.cpp)
addPythonExe(ufunc ufunc.cpp)
addPythonExe(wrap wrap.cpp)
# # installation logic (skip until it is better thought out)
# set(DEST_EXAMPLE boost.numpy/example)
#
# # install executables demonstrating embedding python
# install(TARGETS dtype fromdata ndarray simple ufunc wrap RUNTIME
# DESTINATION ${DEST_EXAMPLE}
# ${INSTALL_PERMSSIONS_RUNTIME}
# )
#
# # install extension module
# install(TARGETS gaussian LIBRARY
# DESTINATION ${DEST_EXAMPLE}
# ${INSTALL_PERMSSIONS_RUNTIME}
# )
#
# # install source file using the extension module
# install(FILES demo_gaussian.py
# DESTINATION ${DEST_EXAMPLE}
# ${INSTALL_PERMSSIONS_SRC}
# )