Skip to content

Commit

Permalink
Adding workaround for define in Python.h
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Mar 4, 2022
1 parent 2c7df32 commit e1ea0e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ foreach(ver ${xtensor_python_version_defines})
set(XTENSOR_PYTHON_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "")
endif()
endforeach()
set(${PROJECT_NAME}_VERSION
set(${PROJECT_NAME}_VERSION
${XTENSOR_PYTHON_VERSION_MAJOR}.${XTENSOR_PYTHON_VERSION_MINOR}.${XTENSOR_PYTHON_VERSION_PATCH})
message(STATUS "xtensor-python v${${PROJECT_NAME}_VERSION}")

Expand All @@ -45,7 +45,7 @@ else()
find_package(xtensor ${xtensor_REQUIRED_VERSION} REQUIRED)
message(STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS}/xtensor")
endif()

# Currently no required version for pybind11
if(TARGET pybind11 OR TARGET pybind11::headers)
# pybind11 has a variable that indicates its version already, so use that
Expand Down Expand Up @@ -80,6 +80,10 @@ target_include_directories(xtensor-python INTERFACE
target_link_libraries(xtensor-python INTERFACE xtensor)
get_target_property(inc_dir xtensor-python INTERFACE_INCLUDE_DIRECTORIES)

if(MSVC)
set_property(TARGET xtensor-python PROPERTY /DHAVE_SNPRINTF)
else()

OPTION(BUILD_TESTS "xtensor test suite" OFF)
OPTION(DOWNLOAD_GTEST "build gtest from downloaded sources" OFF)

Expand Down

0 comments on commit e1ea0e7

Please sign in to comment.