From 0766538d7f2f6356db348bb8fa7a68ddf218ddf1 Mon Sep 17 00:00:00 2001 From: gitartpiano <51239761+gitartpiano@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:49:30 -0600 Subject: [PATCH 1/2] fix pybind11Tools.cmake typo causing Unknown arguments CMake Error at pybind11/tools/pybind11Tools.cmake:217 (if): if given arguments: "NOT" "MSVC" "AND" "NOT" "TEST" "MATCHES" "DEBUG|RELWITHDEBINFO" Unknown arguments specified https://github.com/pybind/pybind11/issues/4325 --- tools/pybind11Tools.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pybind11Tools.cmake b/tools/pybind11Tools.cmake index 0dc61d3996..66ad00a478 100644 --- a/tools/pybind11Tools.cmake +++ b/tools/pybind11Tools.cmake @@ -214,7 +214,7 @@ function(pybind11_add_module target_name) # Use case-insensitive comparison to match the result of $ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) - if(NOT MSVC AND NOT ${uppercase_CMAKE_BUILD_TYPE} MATCHES DEBUG|RELWITHDEBINFO) + if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO) pybind11_strip(${target_name}) endif() From 1555fcdb67794394bdca9a8d39b03ecb86b011ce Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 11 Nov 2022 16:48:22 -0800 Subject: [PATCH 2/2] Apply the same fix in tools/pybind11NewTools.cmake --- tools/pybind11NewTools.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pybind11NewTools.cmake b/tools/pybind11NewTools.cmake index 9e13daf1a1..5a6a0cb8be 100644 --- a/tools/pybind11NewTools.cmake +++ b/tools/pybind11NewTools.cmake @@ -235,7 +235,7 @@ function(pybind11_add_module target_name) # Use case-insensitive comparison to match the result of $ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) - if(NOT MSVC AND NOT ${uppercase_CMAKE_BUILD_TYPE} MATCHES DEBUG|RELWITHDEBINFO) + if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO) # Strip unnecessary sections of the binary on Linux/macOS pybind11_strip(${target_name}) endif()