Skip to content

Commit 7b9a9b7

Browse files
authored
Merge pull request #170 from dzenanz/master
Allow the library to be used from build directory. Closes #169.
2 parents ffada93 + 73e78e0 commit 7b9a9b7

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ add_library(xtensor-io INTERFACE)
124124

125125
include_directories(${GTEST_INCLUDE_DIRS})
126126

127+
find_path(ghc-filesystem-include REQUIRED
128+
NAMES "ghc/filesystem.hpp"
129+
DOC "Path to include directory of https://github.com/gulrak/filesystem"
130+
)
131+
target_include_directories(xtensor-io
132+
INTERFACE
133+
$<BUILD_INTERFACE:${ghc-filesystem-include}>
134+
$<INSTALL_INTERFACE:include>
135+
)
136+
127137
target_include_directories(xtensor-io
128138
INTERFACE
129139
$<BUILD_INTERFACE:${XTENSOR_IO_INCLUDE_DIR}>

include/xtensor-io/xio_disk_handler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace xt
6262
{
6363
if (!fs::is_directory(directory))
6464
{
65-
XTENSOR_THROW(std::runtime_error, "Path is not a directory: " + std::string(directory));
65+
XTENSOR_THROW(std::runtime_error, "Path is not a directory: " + std::string(directory.string()));
6666
}
6767
}
6868
else

xtensor-ioConfig.cmake.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
include(CMakeFindDependencyMacro)
2020
find_dependency(xtensor @xtensor_REQUIRED_VERSION@)
2121

22-
set(PN xtensor_io)
23-
set_and_check(${PN}_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
24-
set(${PN}_LIBRARY "")
25-
check_required_components(${PN})
26-
2722
if(NOT TARGET @PROJECT_NAME@)
2823
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
2924
endif()

0 commit comments

Comments
 (0)