783892b
--- CMakeLists.txt.fix_libpaths	2021-05-24 21:00:30.000000000 +0200
783892b
+++ CMakeLists.txt	2021-06-02 18:34:02.336369885 +0200
29228a6
@@ -258,7 +258,7 @@
29228a6
     elseif()
29228a6
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated -mmacosx-version-min=10.9")
29228a6
     endif()
3135055
-    set(BNG2_PATH "/usr/local/bin/BioNetGen/BNG2.pl")
3135055
+    set(BNG2_PATH "${PERL_VENDORLIB}/BioNetGen/BNG2.pl")
3135055
 elseif (WIN32)
3135055
     set(WINDOWS_BUILD ON)
3135055
     if(MSVC)
29228a6
@@ -274,7 +274,7 @@
3135055
 else ()
3135055
     set(NIX_BUILD ON)
3135055
     message(STATUS "Compiling on a Linux computer")
3135055
-    set(BNG2_PATH "/usr/local/bin/BioNetGen/BNG2.pl")
3135055
+    set(BNG2_PATH "${PERL_VENDORLIB}/BioNetGen/BNG2.pl")
3135055
 endif ()
3135055
 
3135055
 message(STATUS "CMAKE_CXX_FLAGS variable: '${CMAKE_CXX_FLAGS}'")
29228a6
@@ -438,7 +438,8 @@
3135055
         find_path(ZLIB_INCLUDE_DIRS zlib.h)
3135055
         find_library(ZLIB_LIBRARIES libz.a)
3135055
     else()
3135055
-        include(FindZlib)
3135055
+        find_path(ZLIB_INCLUDE_DIRS zlib.h PATHS ${INCLUDE_INSTALL_DIR})
3135055
+        find_library(ZLIB_LIBRARIES libz.so PATHS ${CMAKE_INSTALL_LIBDIR})
3135055
     endif()
3135055
 
3135055
     if(ZLIB_INCLUDE_DIRS AND ZLIB_LIBRARIES)
29228a6
@@ -514,8 +515,7 @@
783892b
 if (OPTION_PYTHON)
783892b
     # Find python before using pybind11. There is a possibility of version mismatch later.
783892b
     find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
783892b
-    set(PYBIND11_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source/pybind11)
783892b
-    add_subdirectory(${PYBIND11_SOURCE_DIR})
783892b
+    find_package(pybind11)
783892b
     add_subdirectory(${CMAKE_SOURCE_DIR}/source/python)
3135055
 endif ()
783892b