Skip to content

Commit

Permalink
Generator expressions to disable appending a per-configuration subdir…
Browse files Browse the repository at this point in the history
…ectory
  • Loading branch information
Wovchena committed May 28, 2024
1 parent c97f2f8 commit 934e438
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ add_subdirectory(./thirdparty/openvino_tokenizers/ "${CMAKE_CURRENT_BINARY_DIR}/
set_target_properties(openvino_tokenizers PROPERTIES
VERSION ${CMAKE_PROJECT_VERSION}
SOVERSION ${MAJOR_SUFFIX}${CMAKE_PROJECT_VERSION_MINOR}${CMAKE_PROJECT_VERSION_PATCH}
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/openvino_genai/"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/openvino_genai/"
# Generator expressions to disable appending a per-configuration subdirectory (Release, Debug).
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
RUNTIME_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
)
if(TARGET core_tokenizers)
set_target_properties(openvino_tokenizers PROPERTIES
VERSION ${CMAKE_PROJECT_VERSION}
SOVERSION ${MAJOR_SUFFIX}${CMAKE_PROJECT_VERSION_MINOR}${CMAKE_PROJECT_VERSION_PATCH}
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/openvino_genai/"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/openvino_genai/"
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
RUNTIME_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
)
else()
# Copy prebuilt dependencies
# Prebuilt dependencies
if(WIN32)
set(extra_libs "${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-src/lib/core_tokenizers.dll"
"${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-src/third_party/lib/icudt70.dll"
Expand All @@ -41,8 +42,7 @@ else()
elseif(APPLE)
set(extra_libs "${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-srclib/libcore_tokenizers.dylib")
endif()
add_custom_command(
OUTPUT "${extra_libs}"
add_custom_command(OUTPUT "${extra_libs}"
COMMAND "${CMAKE_COMMAND}" -E copy "${extra_libs}" "${CMAKE_BINARY_DIR}/openvino_genai/"
DEPENDS openvino_tokenizers)
endif()
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ string(REGEX MATCH [=[[0-9][0-9]$]=] MAJOR_SUFFIX ${CMAKE_PROJECT_VERSION_MAJOR}
set_target_properties(${TARGET_NAME} PROPERTIES
VERSION ${CMAKE_PROJECT_VERSION}
SOVERSION ${MAJOR_SUFFIX}${CMAKE_PROJECT_VERSION_MINOR}${CMAKE_PROJECT_VERSION_PATCH}
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/openvino_genai/"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/openvino_genai/"
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
RUNTIME_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
)

find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
Expand Down
2 changes: 1 addition & 1 deletion src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif()
pybind11_add_module(py_generate_pipeline py_generate_pipeline.cpp)
target_link_libraries(py_generate_pipeline PRIVATE openvino::genai)
set_target_properties(py_generate_pipeline PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/openvino_genai/"
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>"
)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/openvino_genai/__init__.py" DESTINATION "${CMAKE_BINARY_DIR}/openvino_genai/")
write_file("${CMAKE_BINARY_DIR}/openvino_genai/__version__.py" "__version__ = \"${CMAKE_PROJECT_VERSION}\"")
Expand Down

0 comments on commit 934e438

Please sign in to comment.