Skip to content

Commit

Permalink
Small cmake improvements (openvinotoolkit#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Aug 5, 2024
1 parent 4e1e755 commit 50182b4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ project(OpenVINOGenAI
HOMEPAGE_URL "https://github.com/openvinotoolkit/openvino.genai"
LANGUAGES CXX)

option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" OFF)
option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." OFF)

# Find OpenVINODeveloperPackage first to compile with SDL flags
find_package(OpenVINODeveloperPackage QUIET
find_package(OpenVINODeveloperPackage ${OpenVINOGenAI_VERSION} QUIET
PATHS "${OpenVINO_DIR}")
if(NOT OpenVINODeveloperPackage_FOUND)
find_package(OpenVINO REQUIRED COMPONENTS Runtime)
find_package(OpenVINO ${OpenVINOGenAI_VERSION} REQUIRED COMPONENTS Runtime)
endif()

include(cmake/features.cmake)
Expand Down
3 changes: 3 additions & 0 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ function(ov_genai_build_jinja2cpp)
set(JINJA2CPP_STRICT_WARNINGS OFF CACHE BOOL "")
set(JINJA2CPP_PIC ON CACHE BOOL "")

# options for Jinja2Cpp dependencies
option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." OFF)

add_subdirectory("${jinja2cpp_SOURCE_DIR}" "${jinja2cpp_BINARY_DIR}" EXCLUDE_FROM_ALL)
endif()
endfunction()
Expand Down
19 changes: 13 additions & 6 deletions tests/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

set(INSTALL_GTEST OFF CACHE BOOL "")

FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
URL_HASH SHA256=edd885a1ab32b6999515a880f669efadb80b3f880215f315985fa3f6eca7c4d3
)
FetchContent_MakeAvailable(googletest)

set(TEST_TARGET_NAME "tests_continuous_batching")
file(GLOB tests_src
"*.cpp"
)
file(GLOB tests_src "*.cpp")

add_executable(${TEST_TARGET_NAME} ${tests_src})
target_link_libraries(${TEST_TARGET_NAME} PUBLIC openvino::genai gtest_main)
target_include_directories(${TEST_TARGET_NAME} PRIVATE "${PROJECT_SOURCE_DIR}/src/cpp/src")
target_link_libraries(${TEST_TARGET_NAME} PRIVATE openvino::genai gtest_main)
target_include_directories(${TEST_TARGET_NAME} PRIVATE "${OpenVINOGenAI_SOURCE_DIR}/src/cpp/src")
2 changes: 1 addition & 1 deletion thirdparty/openvino_tokenizers

0 comments on commit 50182b4

Please sign in to comment.