9a10,14
> if (POLICY CMP0048)
> # cmake warns if loaded from a min-3.0-required parent dir, so silence the warning:
> cmake_policy(SET CMP0048 NEW)
> endif()
>
20d24
< option(PYBIND11_WERROR "Report all warnings as errors" OFF)
33,49d36
< # Compile with compiler warnings turned on
< function(pybind11_enable_warnings target_name)
< if(MSVC)
< target_compile_options(${target_name} PRIVATE /W4)
< else()
< target_compile_options(${target_name} PRIVATE -Wall -Wextra -Wconversion)
< endif()
<
< if(PYBIND11_WERROR)
< if(MSVC)
< target_compile_options(${target_name} PRIVATE /WX)
< else()
< target_compile_options(${target_name} PRIVATE -Werror)
< endif()
< endif()
< endfunction()
<
53a41
> include/pybind11/class_support.h
87a76
> message(STATUS "pybind11 v${${PROJECT_NAME}_VERSION}")
88a78,82
> option (USE_PYTHON_INCLUDE_DIR "Install pybind11 headers in Python include directory instead of default installation prefix" OFF)
> if (USE_PYTHON_INCLUDE_DIR)
> file(RELATIVE_PATH CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX} ${PYTHON_INCLUDE_DIRS})
> endif()
>
91,95c85,92
< add_library(pybind11 INTERFACE)
< target_include_directories(pybind11 INTERFACE $<BUILD_INTERFACE:${PYBIND11_INCLUDE_DIR}>
< $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
< if(APPLE)
< target_link_libraries(pybind11 INTERFACE "-undefined dynamic_lookup")
---
> add_library(module INTERFACE)
> target_include_directories(module INTERFACE $<BUILD_INTERFACE:${PYBIND11_INCLUDE_DIR}>
> $<BUILD_INTERFACE:${PYTHON_INCLUDE_DIRS}>
> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
> if(WIN32 OR CYGWIN)
> target_link_libraries(module INTERFACE $<BUILD_INTERFACE:${PYTHON_LIBRARIES}>)
> elseif(APPLE)
> target_link_libraries(module INTERFACE "-undefined dynamic_lookup")
96a94,96
> target_compile_options(module INTERFACE $<BUILD_INTERFACE:${PYBIND11_CPP_STANDARD}>)
>
> add_library(pybind11::module ALIAS module) # to match exported target
118c118
< install(TARGETS pybind11
---
> install(TARGETS module
123d122
< message(STATUS "Exporting ${PROJECT_NAME}::pybind11 interface library target version ${${PROJECT_NAME}_VERSION}")