CMakeLists.txt 1.37 KB
Newer Older
1
2
find_package(fmt 6.0 REQUIRED)

3
4
5
add_library(Pylene-numpy)
add_library(Pylene::Pylene-numpy ALIAS Pylene-numpy)
target_include_directories(Pylene-numpy PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Baptiste Esteban's avatar
Baptiste Esteban committed
6
                                               $<INSTALL_INTERFACE:include>
7
                                        # PYBIND11 INCLUDES TO REMOVE WHEN cmake_find_package FOR PYBIND11 WILL BE FIXED
Baptiste Esteban's avatar
Baptiste Esteban committed
8
                                        PRIVATE
Baptiste Esteban's avatar
Baptiste Esteban committed
9
10
                                               ${CONAN_INCLUDE_DIRS_PYBIND11}
                                               ${PYTHON_INCLUDE_DIRS})
11
target_sources(Pylene-numpy PRIVATE src/core/image_cast.cpp
Baptiste Esteban's avatar
Baptiste Esteban committed
12
                                    src/core/numpy_format.cpp)
13
14
# REPLACE PYTHON_LIBRARIES BY pybind11::pybind11 WHEN cmake_find_package FOR PYBIND11 WILL BE FIXED
target_link_libraries(Pylene-numpy PUBLIC Pylene ${PYTHON_LIBRARIES})
15
target_link_libraries(Pylene-numpy PRIVATE fmt::fmt)
16

17
pybind11_add_module(pylena)
18
target_link_libraries(pylena PRIVATE Pylene Pylene-numpy ${PYTHON_LIBRARIES})
19
target_include_directories(pylena PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
20
21
22
target_sources(pylena PRIVATE src/module.cpp)

include(GNUInstallDirs)
23
install(TARGETS Pylene-numpy
24
25
26
27
        EXPORT PyleneTargets)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/pln/core/image_cast.hpp
        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pln/core)