CMakeLists.txt 846 Bytes
Newer Older
Baptiste Esteban's avatar
Baptiste Esteban committed
1
2
3
4
5
6
7
8
9
10
11
find_package(pybind11 REQUIRED)
pybind11_find_import(numpy REQUIRED)

# Python module for testing
set(PYTHON_PYLENE_SRC ${CMAKE_SOURCE_DIR}/pylene-python/src)
pybind11_add_module(pylena_test pylena_test.cpp
                                ${PYTHON_PYLENE_SRC}/core/image_cast.cpp
                                ${PYTHON_PYLENE_SRC}/core/numpy_format.cpp)
target_link_libraries(pylena_test PRIVATE Pylene ImagePath)
target_include_directories(pylena_test PRIVATE ${CMAKE_SOURCE_DIR}/pylene-python/include)

12
13
14
15
16
17
18
19
20
function(add_python_test filename)
    file(COPY ${filename} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endfunction(add_python_test)

# PYTHON FILES TO MOVE HERE
add_python_test(test_pylena_numpy.py)

add_test(NAME test_python
         COMMAND ${PYTHON_EXECUTABLE} -m unittest discover
Baptiste Esteban's avatar
Baptiste Esteban committed
21
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})