Skip to content

Commit

Permalink
set target properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mryzhov committed Nov 23, 2023
1 parent a040b03 commit 2159b91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions modules/custom_operations/user_ie_extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if(POLICY CMP0079)
cmake_policy(SET CMP0079 NEW)
endif()


if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()
Expand All @@ -28,10 +29,6 @@ set(OP_REQ_TBB "complex_mul" "fft")
set(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include")

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)

#
# Select specific operations
#
Expand Down Expand Up @@ -94,6 +91,12 @@ endforeach()

add_library(${TARGET_NAME} SHARED ${SRC})

set_target_properties(${TARGET_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin # .exe and .dll
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib # .lib and .a
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib # .so and .dylib
)

if(OpenCV_FOUND)
target_link_libraries(${TARGET_NAME} PRIVATE ${OpenCV_LIBRARIES})
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ else()
if(WIN32 AND X86_64)
# we use re2 library in regex_normalization operation, so have to add to this list
# because prebuilt fast_tokenizers package does not provide this library
# list(APPEND FAST_TOKENIZER_LIBS re2)
set (RE2_LIBS re2)
endif()
endif()
Expand Down Expand Up @@ -148,8 +147,9 @@ target_link_libraries(${TARGET_NAME} PRIVATE ${FAST_TOKENIZER_LIBS} ${RE2_LIBS}
string(REPLACE " " ";" cxx_flags "${cxx_flags}")
set_target_properties(${TARGET_NAME} PROPERTIES CXX_STANDARD 17
COMPILE_OPTIONS "${cxx_flags}")

file(GLOB DEPS_LIBS ${fast_tokenizer_SOURCE_DIR}/lib/*.dll ${fast_tokenizer_SOURCE_DIR}/third_party/lib/*.dll)
file(COPY ${DEPS_LIBS} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
if(WIN32)
file(GLOB DEPS_LIBS ${fast_tokenizer_SOURCE_DIR}/lib/*.dll ${fast_tokenizer_SOURCE_DIR}/third_party/lib/*.dll)
file(COPY ${DEPS_LIBS} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
endif()

install(FILES ${DEPS_LIBS} DESTINATION .)

0 comments on commit 2159b91

Please sign in to comment.