Skip to content

Commit

Permalink
Fixed cmakelists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Nov 2, 2022
1 parent 34279b0 commit 5f5ddb1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -70,7 +70,7 @@ set(XTENSOR_SIGNAL_HEADERS
add_library(xtensor-signal INTERFACE)

target_include_directories(xtensor-signal INTERFACE
$<BUILD_INTERFACE:${XTENSOR_SIGNAL_INCLUDE_DIR>
$<BUILD_INTERFACE:${XTENSOR_SIGNAL_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)

target_link_libraries(xtensor-signal INTERFACE xtensor xsimd)
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ dependencies:
- ninja
# Host dependencies
- xsimd
- xtensor=0.24.0
- xtensor=0.24.3
- doctest

2 changes: 0 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
{
Expand Down
21 changes: 21 additions & 0 deletions xtensor-signalConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -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}/@[email protected]")
get_target_property(@PROJECT_NAME@_INCLUDE_DIRS xtensor-signal INTERFACE_INCLUDE_DIRECTORIES)
endif()

0 comments on commit 5f5ddb1

Please sign in to comment.