Skip to content

Commit

Permalink
Merge branch 'master' into feature/latest_igraph
Browse files Browse the repository at this point in the history
  • Loading branch information
SJulianS authored May 10, 2024
2 parents 084a91a + c07a663 commit ff35022
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 19 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ option(HAL_VERSION_MAJOR "Pass major version via cmake options" "")
option(HAL_VERSION_MINOR "Pass minor version via cmake options" "")
option(HAL_VERSION_PATCH "Pass patch version via cmake options" "")
option(USE_LIBCXX "Force the use of LIBCXX for e.g. gcc" FALSE)
option(USE_VENDORED_PYBIND11 "Use vendored 'pybind11' Python library" ON)
option(USE_VENDORED_SPDLOG "Use vendored 'spdlog' library" ON)
option(USE_VENDORED_QUAZIP "Use vendored 'quazip' library" ON)
option(USE_VENDORED_IGRAPH "Use vendored 'igraph' library" ON)
option(BUILD_ALL_PLUGINS "Build all available plugins" OFF)
option(BUILD_TESTS "Enable test builds" OFF)
option(BUILD_COVERAGE "Enable code coverage build" OFF)
Expand Down Expand Up @@ -325,8 +329,12 @@ install(FILES tools/genversion.py
GROUP_EXECUTE
WORLD_READ
WORLD_EXECUTE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/pybind11 DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/spdlog-${spdlog_VERSION} DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
if(USE_VENDORED_PYBIND11)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/pybind11 DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
endif()
if(USE_VENDORED_SPDLOG)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/spdlog-${spdlog_VERSION} DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})
endif()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deps/subprocess DESTINATION ${HAL_CMAKECONFIG_INSTALL_DIR})


Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt-get update -y && \
apt-get install -y lsb-release

COPY . .
RUN ./install_dependencies.sh
RUN HAL_DOCKER=1 ./install_dependencies.sh

RUN mkdir build
WORKDIR ${hal_path}/build/
Expand Down
43 changes: 32 additions & 11 deletions cmake/detect_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,33 @@ find_package(pybind11 2.7 CONFIG)
if(${pybind11_FOUND})
message(VERBOSE "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}")
message(VERBOSE "Found pybind11 >= 2.7")
else()
elseif(USE_VENDORED_PYBIND11)
message(STATUS "pybind11 >= 2.7 not found, will build our provided version")
add_subdirectory(deps/pybind11)
else()
message(FATAL_ERROR "pybind11 >= 2.7 not found and USE_VENDORED_PYBIND11 is OFF")
endif()

# ###############################
# #### spdlog
# ###############################
message(STATUS "using spdlog from deps")
set(spdlog_VERSION 1.9.2)
add_library(spdlog::spdlog INTERFACE IMPORTED)
set_target_properties(spdlog::spdlog PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/deps/spdlog-${spdlog_VERSION}/include"
)

if(USE_VENDORED_SPDLOG)
message(STATUS "using spdlog from deps")
set(spdlog_VERSION 1.9.2)
add_library(spdlog::spdlog INTERFACE IMPORTED)
set_target_properties(spdlog::spdlog PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/deps/spdlog-${spdlog_VERSION}/include"
)
else()
find_package(spdlog REQUIRED)
if(spdlog_FOUND)
get_target_property(SPDLOG_HEADERS_DIR spdlog::spdlog INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "Using system's spdlog headers at ${SPDLOG_HEADERS_DIR}")
else()
message(FATAL_ERROR "spdlog was not found and USE_VENDORED_SPDLOG is OFF")
endif()
endif()

# ###############################
# #### subprocess
Expand Down Expand Up @@ -259,7 +272,15 @@ endif(Z3_FOUND)
# ###############################
# #### igraph
# ###############################
set(IGRAPH_SUBDIR "${CMAKE_SOURCE_DIR}/deps/igraph-0.10.x")
add_subdirectory(${IGRAPH_SUBDIR})
get_directory_property(IGRAPH_INCLUDES DIRECTORY ${IGRAPH_SUBDIR} DEFINITION IGRAPH_INCLUDES)
get_directory_property(IGRAPH_LIB DIRECTORY ${IGRAPH_SUBDIR} DEFINITION IGRAPH_LIB)
if(USE_VENDORED_IGRAPH)
set(IGRAPH_SUBDIR "${CMAKE_SOURCE_DIR}/deps/igraph-0.10.x")
add_subdirectory(${IGRAPH_SUBDIR})
get_directory_property(igraph_INCLUDES DIRECTORY ${IGRAPH_SUBDIR} DEFINITION IGRAPH_INCLUDES)
get_directory_property(igraph_LIBRARIES DIRECTORY ${IGRAPH_SUBDIR} DEFINITION IGRAPH_LIB)
message(STATUS "Using igraph from ${IGRAPH_SUBDIR}")
else()
find_package(igraph REQUIRED)
get_target_property(igraph_LIBRARIES igraph::igraph IMPORTED_LOCATION_RELEASE)
get_target_property(igraph_INCLUDES igraph::igraph INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "Using system's igraph from ${igraph_LIBRARIES}")
endif()
2 changes: 1 addition & 1 deletion install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ platform='unknown'
unamestr=$(uname)
distribution='unknown'
release='unknown'
if [[ -f "/.dockerenv" ]]; then
if [[ "${HAL_DOCKER:-0}" == "1" ]]; then
platform='docker'
distribution=$(lsb_release -is)
release=$(lsb_release -rs)
Expand Down
4 changes: 2 additions & 2 deletions plugins/graph_algorithm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ if(PL_GRAPH_ALGORITHM OR BUILD_ALL_PLUGINS)
PYDOC SPHINX_DOC_INDEX_FILE ${CMAKE_CURRENT_SOURCE_DIR}/documentation/graph_algorithm.rst
HEADER ${GRAPH_ALGORITHM_INC}
SOURCES ${GRAPH_ALGORITHM_SRC} ${GRAPH_ALGORITHM_PYTHON_SRC}
INCLUDES PUBLIC $<BUILD_INTERFACE:${IGRAPH_INCLUDES}>
LINK_LIBRARIES PUBLIC ${IGRAPH_LIB}
INCLUDES PUBLIC $<BUILD_INTERFACE:${igraph_INCLUDES}>
LINK_LIBRARIES PUBLIC ${igraph_LIBRARIES}
)

endif()
11 changes: 9 additions & 2 deletions plugins/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ if(PL_GUI OR BUILD_ALL_PLUGINS)
set(CMAKE_${j}_OUTPUT_DIRECTORY${i} "${CMAKE_BINARY_DIR}/lib")
endforeach()
endforeach()
set (QUAZIP_SUBDIR "${CMAKE_SOURCE_DIR}/deps/quazip-1.3")
add_subdirectory(${QUAZIP_SUBDIR} ${CMAKE_BINARY_DIR}/quazip)
if(USE_VENDORED_QUAZIP)
set (QUAZIP_SUBDIR "${CMAKE_SOURCE_DIR}/deps/quazip-1.3")
add_subdirectory(${QUAZIP_SUBDIR} ${CMAKE_BINARY_DIR}/quazip)
message(STATUS "Using quazip from ${QUAZIP_SUBDIR}")
else()
find_package(QuaZip-Qt5 REQUIRED)
get_target_property(QUAZIP_LIBRARIES QuaZip::QuaZip IMPORTED_LOCATION_RELEASE)
message(STATUS "Using system's quazip from ${QUAZIP_LIBRARIES}")
endif()

foreach(i IN ITEMS "" "_DEBUG" "_RELEASE" "_MINSIZEREL" "_RELWITHDEBINFO")
foreach(j IN ITEMS "RUNTIME" "ARCHIVE" "LIBRARY")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <string>
#include <vector>
#include <unordered_map>
#include <cstdint>

// unfortunately std::filesystem::path is not available for all platforms
#ifdef _WIN32
Expand Down

0 comments on commit ff35022

Please sign in to comment.