format: include .in files

This commit is contained in:
Henry Schreiner 2020-08-01 23:47:47 -04:00 committed by Henry Schreiner
parent da803eb0a5
commit ed6de125c9
4 changed files with 35 additions and 13 deletions

View File

@ -27,10 +27,12 @@ repos:
exclude: ^(docs/.*|tools/.*)$ exclude: ^(docs/.*|tools/.*)$
- repo: https://github.com/cheshirekow/cmake-format-precommit - repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.10 rev: v0.6.11
hooks: hooks:
- id: cmake-format - id: cmake-format
additional_dependencies: [pyyaml] additional_dependencies: [pyyaml]
types: [file]
files: (\.cmake|CMakeLists.txt)(.in)?$
- repo: local - repo: local
hooks: hooks:

View File

@ -191,7 +191,8 @@ else()
find_library( find_library(
PYTHON_LIBRARY PYTHON_LIBRARY
NAMES "python${PYTHON_LIBRARY_SUFFIX}" NAMES "python${PYTHON_LIBRARY_SUFFIX}"
PATHS ${_PYTHON_LIBS_SEARCH} NO_DEFAULT_PATH) PATHS ${_PYTHON_LIBS_SEARCH}
NO_DEFAULT_PATH)
# If all else fails, just set the name/version and let the linker figure out the path. # If all else fails, just set the name/version and let the linker figure out the path.
if(NOT PYTHON_LIBRARY) if(NOT PYTHON_LIBRARY)

View File

@ -10,10 +10,10 @@ foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}") message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program( exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" "@CMAKE_COMMAND@" ARGS
"-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval RETURN_VALUE rm_retval)
)
if(NOT "${rm_retval}" STREQUAL 0) if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif() endif()

View File

@ -72,7 +72,6 @@ set(pybind11_VERSION_TYPE "@pybind11_VERSION_TYPE@")
check_required_components(pybind11) check_required_components(pybind11)
include("${CMAKE_CURRENT_LIST_DIR}/pybind11Tools.cmake") include("${CMAKE_CURRENT_LIST_DIR}/pybind11Tools.cmake")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@ -86,15 +85,35 @@ if(NOT TARGET pybind11::pybind11)
find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} MODULE REQUIRED) find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} MODULE REQUIRED)
list(REMOVE_AT CMAKE_MODULE_PATH -1) list(REMOVE_AT CMAKE_MODULE_PATH -1)
set_property(TARGET pybind11::pybind11 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_DIRS}) set_property(
set_property(TARGET pybind11::pybind11 APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_DIRS}) TARGET pybind11::pybind11
APPEND
PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_DIRS})
set_property(
TARGET pybind11::pybind11
APPEND
PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_DIRS})
set_property(TARGET pybind11::embed APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${PYTHON_LIBRARIES}) set_property(
set_property(TARGET pybind11::module APPEND PROPERTY INTERFACE_LINK_LIBRARIES TARGET pybind11::embed
"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>") APPEND
PROPERTY INTERFACE_LINK_LIBRARIES ${PYTHON_LIBRARIES})
set_property(
TARGET pybind11::module
APPEND
PROPERTY
INTERFACE_LINK_LIBRARIES
"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:${PYTHON_LIBRARIES}>>"
)
get_property(_iid TARGET pybind11::pybind11 PROPERTY INTERFACE_INCLUDE_DIRECTORIES) get_property(
get_property(_ill TARGET pybind11::module PROPERTY INTERFACE_LINK_LIBRARIES) _iid
TARGET pybind11::pybind11
PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
get_property(
_ill
TARGET pybind11::module
PROPERTY INTERFACE_LINK_LIBRARIES)
set(pybind11_INCLUDE_DIRS ${_iid}) set(pybind11_INCLUDE_DIRS ${_iid})
set(pybind11_LIBRARIES ${_ico} ${_ill}) set(pybind11_LIBRARIES ${_ico} ${_ill})