--- CMakeLists.txt
+++ CMakeLists.txt
@@ -258,27 +258,27 @@
 SET(install_targets)
 SET(install_bin_pdb)
 
 # libapr-1 is shared, apr-1 is static
+IF(BUILD_SHARED_LIBS)
 ADD_LIBRARY(libapr-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc)
 SET(install_targets ${install_targets} libapr-1)
 SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-1.pdb)
 TARGET_LINK_LIBRARIES(libapr-1 ${APR_SYSTEM_LIBS})
 SET_TARGET_PROPERTIES(libapr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;WINNT")
+SET_TARGET_PROPERTIES(libapr-1 PROPERTIES PREFIX "" OUTPUT_NAME "apr-1")
 ADD_DEPENDENCIES(libapr-1 test_char_header)
-
+ELSE()
 ADD_LIBRARY(apr-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED})
 SET(install_targets ${install_targets} apr-1)
 TARGET_LINK_LIBRARIES(apr-1 ${APR_SYSTEM_LIBS})
 SET_TARGET_PROPERTIES(apr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;WINNT")
 ADD_DEPENDENCIES(apr-1 test_char_header)
-
+ENDIF()
 # libaprapp-1 and aprapp-1 are static
 ADD_LIBRARY(libaprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED})
-SET(install_targets ${install_targets} libaprapp-1)
 SET_TARGET_PROPERTIES(libaprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_APP;WINNT")
 
 ADD_LIBRARY(aprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED})
-SET(install_targets ${install_targets} aprapp-1)
 SET_TARGET_PROPERTIES(aprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP;WINNT")
 
 IF(APR_BUILD_TESTAPR)
