diff --git a/text_generation/causal_lm/cpp/CMakeLists.txt b/text_generation/causal_lm/cpp/CMakeLists.txt index 87cbbda618..26277c1405 100644 --- a/text_generation/causal_lm/cpp/CMakeLists.txt +++ b/text_generation/causal_lm/cpp/CMakeLists.txt @@ -4,28 +4,26 @@ cmake_minimum_required(VERSION 3.15) project(causal_lm) -set(TARGET_NAME greedy_causal_lm) -add_executable(${TARGET_NAME} greedy_causal_lm.cpp) -target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") -target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_TOKENIZERS_PATH=\"$\") +add_subdirectory(../../../thirdparty/openvino_tokenizers/ "${CMAKE_CURRENT_BINARY_DIR}/openvino_tokenizers/") + +add_executable(greedy_causal_lm greedy_causal_lm.cpp) +target_compile_definitions(greedy_causal_lm PRIVATE OPENVINO_TOKENIZERS_PATH=\"$\") find_package(OpenVINO REQUIRED COMPONENTS Runtime) -target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime) -set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD 17) -set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON) - -set(TARGET_NAME beam_search_causal_lm) -add_executable(${TARGET_NAME} beam_search_causal_lm.cpp) -target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") -target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_TOKENIZERS_PATH=\"$\") +target_link_libraries(greedy_causal_lm PRIVATE openvino::runtime) +set_target_properties(greedy_causal_lm PROPERTIES CXX_STANDARD 17) +set_target_properties(greedy_causal_lm PROPERTIES CXX_STANDARD_REQUIRED ON) + +add_executable(beam_search_causal_lm beam_search_causal_lm.cpp) +target_compile_definitions(beam_search_causal_lm PRIVATE OPENVINO_TOKENIZERS_PATH=\"$\") +target_include_directories(beam_search_causal_lm PRIVATE ./) find_package(OpenVINO REQUIRED COMPONENTS Runtime) -target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime) -set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD 17) -set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON) - -set(TARGET_NAME speculative_decoding_lm) -add_executable(${TARGET_NAME} speculative_decoding_lm.cpp) -target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") -target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_TOKENIZERS_PATH=\"$\") +target_link_libraries(beam_search_causal_lm PRIVATE openvino::runtime) +set_target_properties(beam_search_causal_lm PROPERTIES CXX_STANDARD 17) +set_target_properties(beam_search_causal_lm PROPERTIES CXX_STANDARD_REQUIRED ON) + +add_executable(speculative_decoding_lm speculative_decoding_lm.cpp) +target_compile_definitions(speculative_decoding_lm PRIVATE OPENVINO_TOKENIZERS_PATH=\"$\") +target_include_directories(speculative_decoding_lm PRIVATE ./) find_package(OpenVINO REQUIRED COMPONENTS Runtime) target_link_libraries(speculative_decoding_lm PRIVATE openvino::runtime) set_target_properties(speculative_decoding_lm PROPERTIES CXX_STANDARD 17) @@ -33,10 +31,9 @@ set_target_properties(speculative_decoding_lm PROPERTIES CXX_STANDARD_REQUIRED O find_package(TBB REQUIRED COMPONENTS tbb) target_link_libraries(speculative_decoding_lm PRIVATE TBB::tbb) -set(TARGET_NAME prompt_lookup_decoding_lm) -add_executable(${TARGET_NAME} prompt_lookup_decoding_lm.cpp) -target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_TOKENIZERS_PATH=\"$\") -target_include_directories(${TARGET_NAME} PRIVATE ./) +add_executable(prompt_lookup_decoding_lm prompt_lookup_decoding_lm.cpp) +target_compile_definitions(prompt_lookup_decoding_lm PRIVATE OPENVINO_TOKENIZERS_PATH=\"$\") +target_include_directories(prompt_lookup_decoding_lm PRIVATE ./) find_package(OpenVINO REQUIRED COMPONENTS Runtime) target_link_libraries(prompt_lookup_decoding_lm PRIVATE openvino::runtime) set_target_properties(prompt_lookup_decoding_lm PROPERTIES CXX_STANDARD 17) @@ -44,16 +41,14 @@ set_target_properties(prompt_lookup_decoding_lm PROPERTIES CXX_STANDARD_REQUIRED find_package(TBB REQUIRED COMPONENTS tbb) target_link_libraries(prompt_lookup_decoding_lm PRIVATE TBB::tbb) -set(TARGET_NAME generate_sample) -add_executable(${TARGET_NAME} generate_pipeline/generate_sample.cpp) -target_link_libraries(${TARGET_NAME} PRIVATE generate_pipeline_lib) -target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") -set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD 17) -set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON) - -set(TARGET_NAME chat_sample) -add_executable(${TARGET_NAME} generate_pipeline/chat_sample.cpp) -target_link_libraries(${TARGET_NAME} PRIVATE generate_pipeline_lib) -target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") -set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD 17) -set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON) +add_executable(generate_sample generate_pipeline/generate_sample.cpp) +target_link_libraries(generate_sample PRIVATE generate_pipeline_lib) +target_include_directories(generate_sample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +set_target_properties(generate_sample PROPERTIES CXX_STANDARD 17) +set_target_properties(generate_sample PROPERTIES CXX_STANDARD_REQUIRED ON) + +add_executable(chat_sample generate_pipeline/chat_sample.cpp) +target_link_libraries(chat_sample PRIVATE generate_pipeline_lib) +target_include_directories(chat_sample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +set_target_properties(chat_sample PROPERTIES CXX_STANDARD 17) +set_target_properties(chat_sample PROPERTIES CXX_STANDARD_REQUIRED ON)