From 782642aff8bc41165993f7d00d3342ca4ced41bd Mon Sep 17 00:00:00 2001 From: Crola1702 Date: Tue, 6 Jun 2023 11:57:01 -0500 Subject: [PATCH 1/5] Disable pybind11 on Windows by default Signed-off-by: Crola1702 --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d04ff2326..a68d4b6c68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,15 @@ else() set (EXTRA_TEST_LIB_DEPS) endif() +set(skip_pybind11_default_value OFF) +if (MSVC) + set(skip_pybind11_default_value ON) +endif() + +option(SKIP_PYBIND11 + "Skip generating Python bindings via pybind11" + ${skip_pybind11_default_value}) + include(test/find_dri.cmake) FindDRI() From 9c1cbf6e9bd75a7754467f4515f2b8334e341dd3 Mon Sep 17 00:00:00 2001 From: Crola1702 Date: Tue, 6 Jun 2023 13:04:31 -0500 Subject: [PATCH 2/5] Add as a confition where pybind11 is created Signed-off-by: Crola1702 --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a68d4b6c68..ddc2593843 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,11 +53,11 @@ FindDRI() option(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION "Install python modules in standard system paths in the system" - OFF) + OFF "NOT SKIP_PYBIND11" OFF) option(USE_DIST_PACKAGES_FOR_PYTHON "Use dist-packages instead of site-package to install python modules" - OFF) + OFF "NOT SKIP_PYBIND11" OFF) #============================================================================ # Search for project-specific dependencies @@ -234,7 +234,7 @@ add_subdirectory(examples) #============================================================================ ign_create_packages() -if (${pybind11_FOUND}) +if (pybind11_FOUND AND NOT SKIP_PYBIND11) add_subdirectory(python) endif() #============================================================================ From b2425fbcd47266079a699d58fec17ce170d16f22 Mon Sep 17 00:00:00 2001 From: Crola1702 Date: Tue, 6 Jun 2023 13:59:28 -0500 Subject: [PATCH 3/5] Fix syntax error Signed-off-by: Crola1702 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ddc2593843..f722db59cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,11 +53,11 @@ FindDRI() option(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION "Install python modules in standard system paths in the system" - OFF "NOT SKIP_PYBIND11" OFF) + ${skip_pybind11_default_value}) option(USE_DIST_PACKAGES_FOR_PYTHON "Use dist-packages instead of site-package to install python modules" - OFF "NOT SKIP_PYBIND11" OFF) + ${skip_pybind11_default_value}) #============================================================================ # Search for project-specific dependencies From 837e78ff771c784eb3dcb78751663385532fa6c2 Mon Sep 17 00:00:00 2001 From: Crola1702 Date: Wed, 7 Jun 2023 09:00:00 -0500 Subject: [PATCH 4/5] Make find_package(pybind11) depend on SKIP_PYBIND11 Signed-off-by: Crola1702 --- CMakeLists.txt | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f722db59cb..4c171e92ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,11 +53,11 @@ FindDRI() option(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION "Install python modules in standard system paths in the system" - ${skip_pybind11_default_value}) + OFF) option(USE_DIST_PACKAGES_FOR_PYTHON "Use dist-packages instead of site-package to install python modules" - ${skip_pybind11_default_value}) + OFF) #============================================================================ # Search for project-specific dependencies @@ -205,14 +205,17 @@ else() set(PYBIND11_PYTHON_VERSION 3) find_package(Python3 QUIET COMPONENTS Interpreter Development) - find_package(pybind11 2.2 QUIET) - - if (${pybind11_FOUND}) - message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.") - else() - IGN_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.") - message (STATUS "Searching for pybind11 - not found.") - endif() + + if (NOT SKIP_PYBIND11) + find_package(pybind11 2.2 QUIET) + + if (${pybind11_FOUND}) + message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.") + else() + IGN_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.") + message (STATUS "Searching for pybind11 - not found.") + endif() + endif() endif() # Plugin install dirs set(IGNITION_GAZEBO_PLUGIN_INSTALL_DIR From 27ef36834513ac2813c0eb7239205326cc909694 Mon Sep 17 00:00:00 2001 From: Crola1702 Date: Fri, 9 Jun 2023 12:41:48 -0500 Subject: [PATCH 5/5] Address PR comments Signed-off-by: Crola1702 --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c171e92ec..eef08b148e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,8 @@ else() set (EXTRA_TEST_LIB_DEPS) endif() +# We're disabling pybind11 by default on Windows because they +# don't have active CI on them for now. set(skip_pybind11_default_value OFF) if (MSVC) set(skip_pybind11_default_value ON) @@ -211,9 +213,9 @@ else() if (${pybind11_FOUND}) message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.") - else() - IGN_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.") - message (STATUS "Searching for pybind11 - not found.") + else() + IGN_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.") + message (STATUS "Searching for pybind11 - not found.") endif() endif() endif() @@ -237,7 +239,7 @@ add_subdirectory(examples) #============================================================================ ign_create_packages() -if (pybind11_FOUND AND NOT SKIP_PYBIND11) +if (pybind11_FOUND) add_subdirectory(python) endif() #============================================================================