mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Make sure add_subdirectory and find_package behave identically
Add a BUILD_INTERFACE and a pybind11::pybind11 alias for the interface
library to match the installed target.
Add new cmake tests for add_subdirectory and consolidates the
.cpp and .py files needed for the cmake build tests:
Before:
tests
|-- test_installed_module
| |-- CMakeLists.txt
| |-- main.cpp
| \-- test.py
\-- test_installed_target
|-- CMakeLists.txt
|-- main.cpp
\-- test.py
After:
tests
\-- test_cmake_build
|-- installed_module/CMakeLists.txt
|-- installed_target/CMakeLists.txt
|-- subdirectory_module/CMakeLists.txt
|-- subdirectory_target/CMakeLists.txt
|-- main.cpp
\-- test.py
This commit is contained in:
committed by
Wenzel Jakob
parent
003a9eba59
commit
b0f3885c95
@@ -85,6 +85,11 @@ function(pybind11_add_module target_name)
|
||||
# import time.
|
||||
|
||||
target_link_libraries(${target_name} PRIVATE "-undefined dynamic_lookup")
|
||||
|
||||
if(${lib_type} STREQUAL "SHARED")
|
||||
# Suppress CMake >= 3.0 warning for shared libraries
|
||||
set_target_properties(${target_name} PROPERTIES MACOSX_RPATH ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
select_cxx_standard()
|
||||
|
||||
Reference in New Issue
Block a user