diff --git a/CMakeLists.txt b/CMakeLists.txt index 05c44ad..64e4e03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,10 +16,10 @@ set(XTENSOR_SIGNAL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) # ========== set(XTENSOR_SIGNAL_CONFIG_FILE - "${XTENSOR_SIGNAL_INCLUDE_DIR}/xtensor-signal/xtensor_python_config.hpp") -file(STRINGS ${XTENSOR_SIGNAL_CONFIG_FILE} xtensor_python_version_defines + "${XTENSOR_SIGNAL_INCLUDE_DIR}/xtensor-signal/xtensor_signal.hpp") +file(STRINGS ${XTENSOR_SIGNAL_CONFIG_FILE} xtensor_signal_version_defines REGEX "#define XTENSOR_SIGNAL_VERSION_(MAJOR|MINOR|PATCH)") -foreach(ver ${xtensor_python_version_defines}) +foreach(ver ${xtensor_signal_version_defines}) if(ver MATCHES "#define XTENSOR_SIGNAL_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$") set(XTENSOR_SIGNAL_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "") endif() @@ -70,7 +70,7 @@ set(XTENSOR_SIGNAL_HEADERS add_library(xtensor-signal INTERFACE) target_include_directories(xtensor-signal INTERFACE - $ + $ $) target_link_libraries(xtensor-signal INTERFACE xtensor xsimd) diff --git a/environment-dev.yml b/environment-dev.yml index 50bce1e..3c653a9 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -7,6 +7,6 @@ dependencies: - ninja # Host dependencies - xsimd - - xtensor=0.24.0 + - xtensor=0.24.3 - doctest diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 11adb9c..0ff71a8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -48,8 +48,6 @@ endif() find_package(doctest REQUIRED) find_package(Threads) -include_directories(${GTEST_INCLUDE_DIRS}) - set(XTENSOR_SIGNAL_TESTS main.cpp test_config.cpp diff --git a/test/test_config.cpp b/test/test_config.cpp index 457065c..5b321fd 100644 --- a/test/test_config.cpp +++ b/test/test_config.cpp @@ -6,11 +6,11 @@ * The full license is in the file LICENSE, distributed with this software. * ****************************************************************************/ -#include "doctest/doctest.hpp" +#include "doctest/doctest.h" #include "xtensor-signal/xtensor_signal.hpp" -namespace xtensor-signal +namespace xt { TEST_SUITE("config") { diff --git a/xtensor-signalConfig.cmake.in b/xtensor-signalConfig.cmake.in new file mode 100644 index 0000000..c48ac40 --- /dev/null +++ b/xtensor-signalConfig.cmake.in @@ -0,0 +1,21 @@ +############################################################################ +# Copyright (c) QuantStack # +# # +# Distributed under the terms of the BSD 3-Clause License. # +# # +# The full license is in the file LICENSE, distributed with this software. # +############################################################################ + +# xtensor-python cmake module +# This module sets the following variables in your project:: +# +# xtensor-signal_FOUND - true if xtensor-python found on the system +# xtensor-signal_INCLUDE_DIRS - the directory containing xtensor-python headers +# xtensor-signal_LIBRARY - empty + +@PACKAGE_INIT@ + +if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") + get_target_property(@PROJECT_NAME@_INCLUDE_DIRS xtensor-signal INTERFACE_INCLUDE_DIRECTORIES) +endif()