diff --git a/CMakeLists.txt b/CMakeLists.txt index b6550847418..142def56bf5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -445,7 +445,13 @@ SET(dbd_drivers) # libapr-2 is shared, apr-2 is static ADD_LIBRARY(libapr-2 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc) SET(install_targets ${install_targets} libapr-2) -SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-2.pdb) + +IF(MSVC) + SET(install_bin_pdb ${install_bin_pdb} $) +ELSE() + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-2.pdb) +ENDIF() + TARGET_LINK_LIBRARIES(libapr-2 ${XMLLIB_LIBRARIES} ${APR_SYSTEM_LIBS}) SET_TARGET_PROPERTIES(libapr-2 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;APR_HAVE_MODULAR_DSO") ADD_DEPENDENCIES(libapr-2 test_char_header) @@ -471,8 +477,14 @@ IF(APU_HAVE_CRYPTO) MESSAGE(FATAL_ERROR "Only OpenSSL-based crypto is currently implemented in the cmake build") ENDIF() ADD_LIBRARY(apr_crypto_openssl-2 SHARED crypto/apr_crypto_openssl.c libapr.rc) - SET(install_targets ${install_targets} apr_crypto_openssl-2) - SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-2.pdb) + SET(install_targets ${install_targets} apr_crypto_openssl-2) + + IF(MSVC) + SET(install_bin_pdb ${install_bin_pdb} $) + ELSE() + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_crypto_openssl-2.pdb) + ENDIF() + SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES INCLUDE_DIRECTORIES "${APR_INCLUDE_DIRECTORIES};${OPENSSL_INCLUDE_DIR}") SET_TARGET_PROPERTIES(apr_crypto_openssl-2 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=apr_crypto_openssl") TARGET_LINK_LIBRARIES(apr_crypto_openssl-2 libapr-2 ${APR_SYSTEM_LIBS} ${OPENSSL_LIBRARIES}) @@ -480,8 +492,14 @@ ENDIF() IF(APU_HAVE_ODBC) ADD_LIBRARY(apr_dbd_odbc-2 SHARED dbd/apr_dbd_odbc.c libapr.rc) - SET(install_targets ${install_targets} apr_dbd_odbc-2) - SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-2.pdb) + SET(install_targets ${install_targets} apr_dbd_odbc-2) + + IF(MSVC) + SET(install_bin_pdb ${install_bin_pdb} $) + ELSE() + SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/apr_dbd_odbc-2.pdb) + ENDIF() + SET(dbd_drivers ${dbd_drivers} odbc) TARGET_LINK_LIBRARIES(apr_dbd_odbc-2 libapr-2 ${APR_SYSTEM_LIBS} odbc32 odbccp32) SET_PROPERTY(TARGET apr_dbd_odbc-2 APPEND PROPERTY LINK_FLAGS /export:apr_dbd_odbc_driver)