Skip to content

Commit

Permalink
update build file
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedihafez committed Jul 24, 2024
1 parent 3ce0440 commit 860deeb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,38 @@ if(NOT HTSLIB_INCLUDE_DIR OR NOT HTSLIB_LIBRARY)
message(FATAL_ERROR "Could not find htslib")
endif()

## set GLS_INCLUDE_DIR
find_path(GSL_INCLUDE_DIR NAMES gsl/gsl_version.h HINTS /usr/local/include)
find_library(GSL_LIBRARY NAMES gsl PATHS /usr/local/lib)

if(NOT GSL_INCLUDE_DIR OR NOT GSL_LIBRARY)
find_path(GSL_INCLUDE_DIR NAMES gsl/gsl_version.h HINTS "C:/Program Files/gsl/include")
find_library(GSL_LIBRARY NAMES gsl PATHS "C:/Program Files/gsl/lib")
endif()
## find gls on macos NEED TO BE TESTED
if(NOT GSL_INCLUDE_DIR OR NOT GSL_LIBRARY)
find_path(GSL_INCLUDE_DIR NAMES gsl/gsl_version.h HINTS "/usr/local/Cellar/gsl")
find_library(GSL_LIBRARY NAMES gsl PATHS "/usr/local/Cellar/gsl")
endif()
# /opt/homebrew/opt/gsl
if(NOT GSL_INCLUDE_DIR OR NOT GSL_LIBRARY)
find_path(GSL_INCLUDE_DIR NAMES gsl/gsl_version.h HINTS "/opt/homebrew/opt/gsl/include")
find_library(GSL_LIBRARY NAMES gsl PATHS "/opt/homebrew/opt/gsl/lib")
endif()
## if not search in /opt/homebrew/Cellar/gsl
if(NOT GSL_INCLUDE_DIR OR NOT GSL_LIBRARY)
find_path(GSL_INCLUDE_DIR NAMES gsl/gsl_version.h HINTS "/opt/homebrew/Cellar/gsl")
find_library(GSL_LIBRARY NAMES gsl PATHS "/opt/homebrew/Cellar/gsl")
endif()

if(NOT GSL_INCLUDE_DIR OR NOT GSL_LIBRARY)
message(FATAL_ERROR "Could not find gsl")
endif()


add_executable(mstatspop ${SOURCE_FILE})
target_include_directories(mstatspop PRIVATE "lib")
target_include_directories(mstatspop PRIVATE ${GLS_INCLUDE_DIR})
target_compile_options(mstatspop PRIVATE -DinGSL=1)
target_link_libraries(mstatspop ${HTSLIB_LIBRARY} -lm -lgsl -lgslcblas -lz logging )
# target_link_libraries(mstatspop PRIVATE )
Expand Down

0 comments on commit 860deeb

Please sign in to comment.