BUStools / bustools

Tools for working with BUS files
https://bustools.github.io/
BSD 2-Clause "Simplified" License
92 stars 23 forks source link

I think the variable is ZLIB_INCLUDE_DIR, not ZLIB_INCLUDE_DIRS #102

Closed detrout closed 2 months ago

detrout commented 6 months ago

Hi,

I was trying to do my own conda packaging of bustools and cmake was having trouble finding zlib.h from conda, (and zlib-dev is missing on the host OS)

I'm pretty sure cmake is using "ZLIB_INCLUDE_DIR" instead of ...DIRS.

$ cd build
$ grep ZLIB_INCLUDE CMakeCache.txt 
ZLIB_INCLUDE_DIR:PATH=/usr/include

I think this patch might help building bustools on systems using weird dependency paths like conda, nix, or guix.

--- src/CMakeLists.txt.orig 2024-05-16 18:36:34.223870445 -0700
+++ src/CMakeLists.txt  2024-05-16 18:36:54.296338579 -0700
@@ -29,5 +29,5 @@

  if ( ZLIB_FOUND )
-     include_directories( ${ZLIB_INCLUDE_DIRS} )
+     include_directories( ${ZLIB_INCLUDE_DIR} )
  else()
    message(FATAL_ERROR "zlib not found. Required for reading FASTQ files" )
Yenaled commented 2 months ago

Hi @detrout , the correct variable is actually ZLIB_INCLUDE_DIRS, however, some systems set it incorrectly as ZLIB_INCLUDE_DIR. Nonetheless, I have added a check that if ZLIB_INCLUDE_DIRS can't be found, then we try ZLIB_INCLUDE_DIR.