-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (41 loc) · 1.63 KB
/
Copy pathCMakeLists.txt
File metadata and controls
52 lines (41 loc) · 1.63 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
add_executable(ndarray ndarray.cc)
target_link_libraries(ndarray ${Boost_LIBRARIES})
add_executable(views views.cc)
target_link_libraries(views ${Boost_LIBRARIES})
add_executable(ndarray-eigen ndarray-eigen.cc)
target_link_libraries(ndarray-eigen ${Boost_LIBRARIES})
add_executable(ndarray-fft ndarray-fft.cc)
target_link_libraries(ndarray-fft ${Boost_LIBRARIES} ${FFTW_LIBRARIES})
add_test(test_ndarray ndarray)
add_test(test_views views)
add_test(test_ndarray-fft ndarray-fft)
add_test(test_ndarray_eigen ndarray-eigen)
if(NDARRAY_SWIG)
include(${SWIG_USE_FILE})
set_property(SOURCE swig_test_mod.i PROPERTY CPLUSPLUS ON)
swig_add_module(swig_test_mod python swig_test_mod.i)
if (APPLE)
swig_link_libraries(swig_test_mod "-undefined dynamic_lookup")
else ()
swig_link_libraries(swig_test_mod "-shared")
endif()
find_package(PythonInterp REQUIRED)
configure_file(swig_test.py swig_test.py COPYONLY)
add_test(NAME swig_test
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_BINARY_DIR}/swig_test.py)
endif(NDARRAY_SWIG)
if(NDARRAY_PYBIND11)
add_library(pybind11_test_mod.so MODULE pybind11_test_mod.cc)
set_target_properties(pybind11_test_mod.so PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
set_target_properties(pybind11_test_mod.so PROPERTIES SUFFIX "${PYTHON_MODULE_EXTENSION}")
if (APPLE)
target_link_libraries(pybind11_test_mod.so PRIVATE "-undefined dynamic_lookup")
else ()
target_link_libraries(pybind11_test_mod.so "-shared")
endif()
configure_file(pybind11_test.py pybind11_test.py COPYONLY)
add_test(NAME pybind11_test
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_BINARY_DIR}/pybind11_test.py)
endif(NDARRAY_PYBIND11)