churchyard / rpms / smoldyn

Forked from rpms/smoldyn a year ago
Clone
Blob Blame History Raw
--- CMakeLists.txt.fix_libpaths	2021-05-24 21:00:30.000000000 +0200
+++ CMakeLists.txt	2021-06-02 18:34:02.336369885 +0200
@@ -209,7 +209,7 @@
     set(APPLE_BUILD ON)
     message(STATUS "Compiling on an Apple computer")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated -mmacosx-version-min=10.9")
-    set(BNG2_PATH "/usr/local/bin/BioNetGen/BNG2.pl")
+    set(BNG2_PATH "${PERL_VENDORLIB}/BioNetGen/BNG2.pl")
 elseif (WIN32)
     set(WINDOWS_BUILD ON)
     if(MSVC)
@@ -225,7 +225,7 @@
 else ()
     set(NIX_BUILD ON)
     message(STATUS "Compiling on a Linux computer")
-    set(BNG2_PATH "/usr/local/bin/BioNetGen/BNG2.pl")
+    set(BNG2_PATH "${PERL_VENDORLIB}/BioNetGen/BNG2.pl")
 endif ()
 
 message(STATUS "CMAKE_CXX_FLAGS variable: '${CMAKE_CXX_FLAGS}'")
@@ -389,7 +382,8 @@
         find_path(ZLIB_INCLUDE_DIRS zlib.h)
         find_library(ZLIB_LIBRARIES libz.a)
     else()
-        include(FindZlib)
+        find_path(ZLIB_INCLUDE_DIRS zlib.h PATHS ${INCLUDE_INSTALL_DIR})
+        find_library(ZLIB_LIBRARIES libz.so PATHS ${CMAKE_INSTALL_LIBDIR})
     endif()
 
     if(ZLIB_INCLUDE_DIRS AND ZLIB_LIBRARIES)
@@ -462,8 +456,7 @@
 if (OPTION_PYTHON)
     # Find python before using pybind11. There is a possibility of version mismatch later.
     find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
-    set(PYBIND11_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source/pybind11)
-    add_subdirectory(${PYBIND11_SOURCE_DIR})
+    find_package(pybind11)
     add_subdirectory(${CMAKE_SOURCE_DIR}/source/python)
 endif ()