forked from xtensor-stack/xtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30b8233
commit 047b89b
Showing
3 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,22 +22,32 @@ find_dependency(xtl @xtl_REQUIRED_VERSION@) | |
if(NOT TARGET @PROJECT_NAME@) | ||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
get_target_property(@PROJECT_NAME@_INCLUDE_DIRS @PROJECT_NAME@ INTERFACE_INCLUDE_DIRECTORIES) | ||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.8) | ||
target_compile_features(@PROJECT_NAME@ INTERFACE cxx_std_14) | ||
endif() | ||
endif() | ||
|
||
if(XTENSOR_USE_XSIMD AND XTENSOR_USE_TBB) | ||
find_dependency(xsimd @xsimd_REQUIRED_VERSION@) | ||
find_dependency(TBB) | ||
target_compile_definitions(@PROJECT_NAME@ INTERFACE XTENSOR_USE_XSIMD XTENSOR_USE_TBB) | ||
elseif(XTENSOR_USE_XSIMD) | ||
get_target_property(_@PROJECT_NAME@_libs @PROJECT_NAME@ INTERFACE_LINK_LIBRARIES) | ||
set(_@PROJECT_NAME@_defines "") | ||
|
||
if(XTENSOR_USE_XSIMD) | ||
find_dependency(xsimd @xsimd_REQUIRED_VERSION@) | ||
target_compile_definitions(@PROJECT_NAME@ INTERFACE XTENSOR_USE_XSIMD) | ||
target_link_libraries(@PROJECT_NAME@ INTERFACE xsimd) | ||
elseif(XTENSOR_USE_TBB) | ||
get_target_property(_@PROJECT_NAME@_tmp @PROJECT_NAME@ INTERFACE_COMPILE_DEFINITIONS) | ||
set(_@PROJECT_NAME@_defines "${_@PROJECT_NAME@_defines}" XTENSOR_USE_XSIMD) | ||
set(_@PROJECT_NAME@_libs "${_@PROJECT_NAME@_libs}" xsimd) | ||
endif() | ||
|
||
if(XTENSOR_USE_TBB) | ||
find_dependency(TBB) | ||
target_compile_definitions(@PROJECT_NAME@ INTERFACE XTENSOR_USE_TBB) | ||
get_target_property(_@PROJECT_NAME@_tmp @PROJECT_NAME@ INTERFACE_COMPILE_DEFINITIONS) | ||
set(_@PROJECT_NAME@_defines "${_@PROJECT_NAME@_defines}" XTENSOR_USE_TBB) | ||
endif() | ||
|
||
if(XTENSOR_USE_XSIMD OR XTENSOR_USE_TBB) | ||
set_target_properties(@PROJECT_NAME@ PROPERTIES | ||
INTERFACE_COMPILE_DEFINITIONS "${_@PROJECT_NAME@_defines}") | ||
endif() | ||
|
||
if(XTENSOR_USE_XSIMD) | ||
set_target_properties(@PROJECT_NAME@ PROPERTIES | ||
INTERFACE_LINK_LIBRARIES "${_@PROJECT_NAME@_libs}") | ||
endif() | ||
|
||
if(NOT TARGET xtensor::optimize) | ||
|
@@ -51,12 +61,20 @@ if(NOT TARGET xtensor::optimize) | |
endif() | ||
endif() | ||
|
||
if(NOT TARGET xtensor::xsimd) | ||
find_dependency(xsimd @xsimd_REQUIRED_VERSION@ QUIET) | ||
if(NOT TARGET xtensor::use_xsimd) | ||
find_package(xsimd QUIET) | ||
if (xsimd_FOUND) | ||
add_library(xtensor::xsimd INTERFACE IMPORTED) | ||
target_link_libraries(xtensor::xsimd INTERFACE xsimd) | ||
target_compile_definitions(xtensor::xsimd INTERFACE XTENSOR_USE_XSIMD) | ||
add_library(xtensor::use_xsimd INTERFACE IMPORTED) | ||
target_link_libraries(xtensor::use_xsimd INTERFACE xsimd) | ||
target_compile_definitions(xtensor::use_xsimd INTERFACE XTENSOR_USE_XSIMD) | ||
endif() | ||
endif() | ||
|
||
if(NOT TARGET xtensor::use_TBB) | ||
find_package(TBB QUIET) | ||
if (TBB_FOUND) | ||
add_library(xtensor::use_TBB INTERFACE IMPORTED) | ||
target_compile_definitions(xtensor::use_TBB INTERFACE XTENSOR_USE_TBB) | ||
endif() | ||
endif() | ||
|