diff --git a/CMakeLists.txt b/CMakeLists.txt index ec3249c582..4ba7a0df4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" @@ -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() diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 352420abf4..bb47414476 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -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) diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index d3b7251ede..9485830bfa 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -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}\"")