--- CMakeLists.txt.orig	2024-12-20 08:56:08 UTC
+++ CMakeLists.txt
@@ -76,12 +76,12 @@ if(NOT MSVC)
 
 if(NOT MSVC)
   if(RDK_OPTIMIZE_POPCNT)
-    if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)")
-      message("RDK_OPTIMIZE_POPCNT is not available on aarch64 or arm64")
-    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64|powerpc64)")
+    if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64|powerpc64)")
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcntd")
-    else()
+    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i386|amd64|x86_64)")
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
+    else()
+      message("RDK_OPTIMIZE_POPCNT is not available on your architecture")
     endif()
   endif()
 endif()
@@ -516,12 +516,14 @@ if(NOT RDK_INSTALL_INTREE)
       COMPONENT data
       PATTERN ".svn" EXCLUDE
       )
+  if (FREEBSD_INSTALL_DOCS)
   install(DIRECTORY Docs DESTINATION
-      ${RDKit_ShareDir}
+      ${FREEBSD_DOCSDIR}
       COMPONENT docs
       PATTERN ".svn" EXCLUDE
       PATTERN "_build" EXCLUDE
       )
+  endif()
   install(DIRECTORY Contrib DESTINATION
       ${RDKit_ShareDir}
       COMPONENT extras
