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
diff --git a/.travis.yml b/.travis.yml
index d4bdafd..ccaa6b4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -135,6 +135,7 @@
-DPYBIND11_CPP_STANDARD=$CPP
-DPYBIND11_WERROR=ON
- $SCRIPT_RUN_PREFIX make pytest -j 2
-- $SCRIPT_RUN_PREFIX make test_install
+- $SCRIPT_RUN_PREFIX make test_cmake_build
+after_failure: cat tests/test_cmake_build/*.log
after_script:
- if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi