Skip to content

Commit

Permalink
CMake: Fix shared build test run.
Browse files Browse the repository at this point in the history
* CMakeLists.txt: Copy libapr-1.dll to BuildDir.

git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.7.x@1920638 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ivan Zhakov committed Sep 14, 2024
1 parent b29b52e commit de38d80
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@ IF(BUILD_SHARED_LIBS)
TARGET_COMPILE_DEFINITIONS(libaprutil-1
PRIVATE "APU_DECLARE_EXPORT"
INTERFACE "APU_DECLARE_IMPORT")

# Copy libapr-1.dll to BuildDir for test run.
ADD_CUSTOM_COMMAND(
TARGET libaprutil-1 POST_BUILD
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
$<TARGET_RUNTIME_DLLS:libaprutil-1>
$<TARGET_FILE_DIR:libaprutil-1>
)
ELSE()
SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES
OUTPUT_NAME aprutil-1)
Expand Down

0 comments on commit de38d80

Please sign in to comment.