diff --git a/CMakeLists.txt b/CMakeLists.txt index ccfa868..5fa9caf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -317,7 +317,6 @@ configure_file ( # add the binary tree to the search path for include files # so that we will find iqtree_config.h include_directories("${PROJECT_BINARY_DIR}") -include_directories("${PROJECT_BINARY_DIR}/zlib-1.2.7") ################################################################## @@ -328,8 +327,11 @@ add_subdirectory(ncl) add_subdirectory(lbfgsb) add_subdirectory(whtest) add_subdirectory(sprng) -add_subdirectory(zlib-1.2.7) add_subdirectory(vectorclass) +find_package(Eigen3) +if(EIGEN3_FOUND) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif(EIGEN3_FOUND) add_subdirectory(model) ################################################################## @@ -401,8 +403,18 @@ checkpoint.cpp upperbounds.cpp ) +find_package(ZLIB) +if(ZLIB_FOUND) + include_directories(${ZLIB_INCLUDE_DIRS}) + target_link_libraries(iqtree ${ZLIB_LIBRARIES}) +else(ZLIB_FOUND) + include_directories("${PROJECT_BINARY_DIR}/zlib-1.2.7") + add_subdirectory(zlib-1.2.7) + target_link_libraries(iqtree zlibstatic) +endif(ZLIB_FOUND) + if (NOT IQTREE_FLAGS MATCHES "avx" AND NOT IQTREE_FLAGS MATCHES "fma") - set_target_properties(iqtree pll ncl lbfgsb whtest zlibstatic sprng vectorclass model PROPERTIES COMPILE_FLAGS "${SSE_FLAGS}") + set_target_properties(iqtree pll ncl lbfgsb whtest sprng vectorclass model PROPERTIES COMPILE_FLAGS "${SSE_FLAGS}") if (NOT BINARY32 AND NOT IQTREE_FLAGS MATCHES "novx") set_target_properties(avxkernel pllavx PROPERTIES COMPILE_FLAGS "${AVX_FLAGS}") endif() @@ -436,9 +448,9 @@ if (IQTREE_FLAGS MATCHES "omp") endif() if (BINARY32 OR IQTREE_FLAGS MATCHES "novx") - target_link_libraries(iqtree pll ncl lbfgsb whtest zlibstatic sprng vectorclass model ${PLATFORM_LIB} ${THREAD_LIB}) + target_link_libraries(iqtree pll ncl lbfgsb whtest sprng vectorclass model ${PLATFORM_LIB} ${THREAD_LIB}) else() - target_link_libraries(iqtree pll pllavx ncl lbfgsb whtest zlibstatic sprng vectorclass model avxkernel ${PLATFORM_LIB} ${THREAD_LIB}) + target_link_libraries(iqtree pll pllavx ncl lbfgsb whtest sprng vectorclass model avxkernel ${PLATFORM_LIB} ${THREAD_LIB}) endif() ##################################################################