Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GraphCompiler] Use find_package() for CMake < 3.24 #162

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions cmake/graph-compiler.cmake
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
get_property(GRAPH_COMPILER_LIBS GLOBAL PROPERTY GRAPH_COMPILER_LIBS)
if (NOT DEFINED GRAPH_COMPILER_LIBS)
include(FetchContent)
# The FetchContent_Declare(FIND_PACKAGE_ARGS) is supported since CMake 3.24. For the prior
# versions, using find_package() first. If the package is not found, then using FetchContent.
if (CMAKE_VERSION VERSION_LESS "3.24")
find_package(GraphCompiler QUIET)
endif ()

#FIXME: Replace the repository URL with the https://github.com/intel/graph-compiler
FetchContent_Declare(
GC
GIT_REPOSITORY https://github.com/AndreyPavlenko/graph-compiler.git
GIT_TAG pkg
FIND_PACKAGE_ARGS NAMES GraphCompiler
)
if (NOT GraphCompiler_FOUND)
include(FetchContent)

FetchContent_Declare(
GC
GIT_REPOSITORY https://github.com/intel/graph-compiler.git
GIT_TAG main
FIND_PACKAGE_ARGS NAMES GraphCompiler
)

set(GC_ENABLE_OPT OFF)
set(GC_ENABLE_TEST OFF)
set(GC_ENABLE_DNNL OFF)
set(GC_ENABLE_LEGACY OFF)
set(GC_ENABLE_BINDINGS_PYTHON OFF)
set(OV_BUILD_SHARED_LIBS_TMP ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)
FetchContent_MakeAvailable(GC)
set(BUILD_SHARED_LIBS ${OV_BUILD_SHARED_LIBS_TMP})
set(GC_ENABLE_OPT OFF)
set(GC_ENABLE_TEST OFF)
set(GC_ENABLE_DNNL OFF)
set(GC_ENABLE_LEGACY OFF)
set(GC_ENABLE_BINDINGS_PYTHON OFF)
set(OV_BUILD_SHARED_LIBS_TMP ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)
FetchContent_MakeAvailable(GC)
set(BUILD_SHARED_LIBS ${OV_BUILD_SHARED_LIBS_TMP})
endif ()

set(GRAPH_COMPILER_LIBS
GcInterface
Expand Down
Loading