conan: copy 3rd party dlls only if the conanDlls folder exists
Note that this folder will only exists if at least one of the conan packages managed with the shared option = True.
This commit is contained in:
parent
89375979d8
commit
186352e295
@ -54,9 +54,3 @@ if( BUILD_WITH_CCACHE )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# On Windows we are interested in placing the DLLs together to the binaries in the install/bin
|
||||
# folder, at the installation step. On other platforms we do not care about that, since the
|
||||
# RPATHs will point the locations where the libraries where found.
|
||||
if (USING_CONAN AND WIN32)
|
||||
install(DIRECTORY ${PROJECT_BINARY_DIR}/conanDlls/ DESTINATION bin)
|
||||
endif()
|
||||
|
||||
@ -254,10 +254,16 @@ if(EXIV2_BUILD_EXIV2_COMMAND)
|
||||
target_include_directories(exiv2lib PRIVATE ${Intl_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
# Copy DLLs from conan packages to the bin folder
|
||||
if (USING_CONAN AND WIN32)
|
||||
if (USING_CONAN AND WIN32 AND EXISTS ${PROJECT_BINARY_DIR}/conanDlls)
|
||||
# In case of using conan recipes with their 'shared' option turned on, we will have dlls of
|
||||
# the 3rd party dependencies in the conanDlls folder.
|
||||
|
||||
# Copy 3rd party DLLs the bin folder. [build step]
|
||||
add_custom_command(TARGET exiv2 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_BINARY_DIR}/conanDlls ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
|
||||
# Copy 3rd party DLLs the bin folder. [install step]
|
||||
install(DIRECTORY ${PROJECT_BINARY_DIR}/conanDlls/ DESTINATION bin)
|
||||
endif()
|
||||
|
||||
install(TARGETS exiv2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user