#To make a solution file to navigate the APR-ICONV source code from the Visual Studio GUI: #copy d:\work\prep\apr-iconv\1.2.1\patch\*.* d:\work\apr-iconv-1.2.1 #cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX=d:\work\local d:\work\apr-iconv-1.2.1 project (apr-iconv) cmake_minimum_required(VERSION 2.8) #Find APR find_path (APR_INCLUDE_DIR apr/apr.h) if (APR_INCLUDE_DIR) set (APR_INCLUDE_DIR ${APR_INCLUDE_DIR}/apr) else () find_path (APR_INCLUDE_DIR apr.h) endif (APR_INCLUDE_DIR) if (APR_INCLUDE_DIR) MESSAGE (STATUS "Found Apache Portable Runtime in " ${APR_INCLUDE_DIR}) else () MESSAGE (FATAL_ERROR "Could not find Apache Portable Runtime (APR) header files") endif (APR_INCLUDE_DIR) find_library (APR_LIBRARY apr-1) if (NOT APR_LIBRARY) MESSAGE (FATAL_ERROR "Could not find APR library") else () MESSAGE (STATUS "Found APR library " ${APR_LIBRARY}) endif (NOT APR_LIBRARY) include_directories ( include ${APR_INCLUDE_DIR} ) #Header files which form the public interface to the library. #They will be installed by "make install". set (PUBLIC_HEADER_FILES include/apr_iconv.h include/api_version.h ) set (HEADER_FILES ${PUBLIC_HEADER_FILES} lib/charset_alias.h lib/iconv.h ) set (SOURCE_FILES lib/iconv.c lib/iconv_ces.c lib/iconv_ces_euc.c lib/iconv_ces_iso2022.c lib/iconv_int.c lib/iconv_module.c lib/iconv_uc.c ) if (WIN32) if (BUILD_SHARED_LIBS) add_definitions (-DAPI_DECLARE_EXPORT) else () add_definitions (-DAPI_DECLARE_STATIC) endif (BUILD_SHARED_LIBS) #Append the source files that are used only on Windows set (SOURCE_FILES ${SOURCE_FILES} libapriconv.rc ) endif (WIN32) add_library (apriconv-1 ${SOURCE_FILES} ${HEADER_FILES} ) target_link_libraries (apriconv-1 ${APR_LIBRARY} ) install (TARGETS apriconv-1 ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) install (FILES ${PUBLIC_HEADER_FILES} DESTINATION include/apr)