Skip to content
Open
Show file tree
Hide file tree
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
16 changes: 13 additions & 3 deletions cmake/install/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ if(NOT userver_FIND_COMPONENTS)
return()
endif()

include(CMakeFindDependencyMacro)

set(USERVER_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})

if("ydb" IN_LIST userver_FIND_COMPONENTS)
set(USERVER_YDB_CONFIG_PHASE deps)
include("${USERVER_CMAKE_DIR}/userver-ydb-config.cmake")
unset(USERVER_YDB_CONFIG_PHASE)
if(NOT _USERVER_YDB_DEPS_LOADED)
return()
endif()
endif()

if(CMAKE_BUILD_TYPE MATCHES "^.*Rel.*$") # same as in UserverSetupEnvironment
include("${CMAKE_CURRENT_LIST_DIR}/release/userver-targets.cmake")
else()
Expand All @@ -32,10 +45,7 @@ endif()

message(STATUS "Userver components: ${userver_FIND_COMPONENTS}")

include(CMakeFindDependencyMacro)

set(USERVER_DOWNLOAD_PACKAGES OFF)
set(USERVER_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
set(USERVER_TESTSUITE_DIR "${USERVER_CMAKE_DIR}/testsuite")
set(USERVER_CONAN @USERVER_CONAN@)
set(USERVER_IMPL_ORIGINAL_CXX_STANDARD @CMAKE_CXX_STANDARD@)
Expand Down
15 changes: 11 additions & 4 deletions cmake/install/userver-ydb-config.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# TODO: not working yet
include_guard(GLOBAL)
if(USERVER_YDB_CONFIG_PHASE STREQUAL "deps")
if(_USERVER_YDB_DEPS_LOADED)
return()
endif()

find_dependency(googleapis CONFIG)
find_dependency(ydb-cpp-sdk CONFIG)

set(_USERVER_YDB_DEPS_LOADED TRUE)
return()
endif()

if(userver_ydb_FOUND)
return()
endif()

find_package(userver REQUIRED COMPONENTS core)

# include("${USERVER_CMAKE_DIR}/ydb-cpp-sdk.cmake")

include("${USERVER_CMAKE_DIR}/UserverSql.cmake")

set(userver_ydb_FOUND TRUE)
2 changes: 1 addition & 1 deletion ydb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ userver_module(

_userver_directory_install(
COMPONENT ydb
FILES "${USERVER_ROOT_DIR}/cmake/SetupYdbCPPSDK.cmake"
FILES "${USERVER_ROOT_DIR}/cmake/SetupYdbCppSDK.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/userver"
)

Expand Down
Loading