Skip to content
Snippets Groups Projects
Commit 5cd754e0 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[cmake] copy parts of pybind11/CMakeLists.txt into DunePybindxiMacros.cmake

parent 086a0f45
No related branches found
No related tags found
2 merge requests!10Fix compilation with new clang,!6Merge pybind
# File for module specific CMake tests.
# The code below is a renamed copy of parts of ../../pybind11/CMakeLists.txt,
# see ../../pybind11/LICENSE for license information.
# Add a CMake parameter for choosing a desired Python version
set(DUNE_PYBINDXI_PYTHON_VERSION "" CACHE STRING "Python version to use for dune-pybindxi")
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7)
include(FindPythonLibsNew)
find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} CACHE INTERNAL "")
set(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} CACHE INTERNAL "")
set(PYTHON_MODULE_PREFIX ${PYTHON_MODULE_PREFIX} CACHE INTERNAL "")
set(PYTHON_MODULE_EXTENSION ${PYTHON_MODULE_EXTENSION} CACHE INTERNAL "")
include(CheckCXXCompilerFlag)
if(NOT MSVC AND NOT DUNE_PYBINDXI_CPP_STANDARD)
#check_cxx_compiler_flag("-std=c++14" HAS_CPP14_FLAG)
check_cxx_compiler_flag("-std=c++11" HAS_CPP11_FLAG)
#if (HAS_CPP14_FLAG)
# set(DUNE_PYBINDXI_CPP_STANDARD -std=c++14)
#elseif (HAS_CPP11_FLAG)
if (HAS_CPP11_FLAG)
set(DUNE_PYBINDXI_CPP_STANDARD -std=c++11)
else()
message(FATAL_ERROR "Unsupported compiler -- pybind11 requires C++11 support!")
endif()
set(DUNE_PYBINDXI_CPP_STANDARD ${DUNE_PYBINDXI_CPP_STANDARD} CACHE STRING
"C++ standard flag, e.g. -std=c++11 or -std=c++14. Defaults to C++11." FORCE)
endif()
include(DunePybindxiUtils)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment