#To make a solution file to navigate the APR source code from the Visual Studio GUI: #xcopy /s d:\work\osd\gsmlib\1.10\patch\*.* d:\work\gsmlib-1.10 #cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX=d:\work\local d:\work\gsmlib-1.10 project (gsmlib) cmake_minimum_required(VERSION 2.8) #include(CheckFunctionExists) #check_function_exists (vsnprintf HAVE_VSNPRINTF) #configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) include_directories (.) #Header files which form the public interface to the library. #They will be installed by "make install". set (PUBLIC_HEADER_FILES gsmlib/gsm_at.h gsmlib/gsm_cb.h gsmlib/gsm_error.h gsmlib/gsm_event.h gsmlib/gsm_map_key.h gsmlib/gsm_me_ta.h gsmlib/gsm_parser.h gsmlib/gsm_phonebook.h gsmlib/gsm_port.h gsmlib/gsm_sms.h gsmlib/gsm_sms_codec.h gsmlib/gsm_sms_store.h gsmlib/gsm_sorted_phonebook.h gsmlib/gsm_sorted_phonebook_base.h gsmlib/gsm_sorted_sms_store.h gsmlib/gsm_sysdep.h gsmlib/gsm_util.h ) set (SOURCE_FILES gsmlib/gsm_at.cc gsmlib/gsm_cb.cc gsmlib/gsm_error.cc gsmlib/gsm_event.cc gsmlib/gsm_me_ta.cc gsmlib/gsm_nls.cc gsmlib/gsm_parser.cc gsmlib/gsm_phonebook.cc gsmlib/gsm_sms.cc gsmlib/gsm_sms_codec.cc gsmlib/gsm_sms_store.cc gsmlib/gsm_sorted_phonebook.cc gsmlib/gsm_sorted_phonebook_base.cc gsmlib/gsm_sorted_sms_store.cc gsmlib/gsm_util.cc ) #Disable warnings about C++ exception specification if (MSVC) add_definitions (-wd4290) endif (MSVC) add_definitions (-DHAVE_CONFIG_H) if (WIN32) include_directories (win32) #Append the header files that are used only on Windows set (PUBLIC_HEADER_FILES ${PUBLIC_HEADER_FILES} gsmlib/gsm_win32_serial.h ) #Append the source files that are used only on Windows set (SOURCE_FILES ${SOURCE_FILES} gsmlib/gsm_win32_serial.cc ) endif (WIN32) if (UNIX) #Append the header files that are used only on Unix set (PUBLIC_HEADER_FILES ${PUBLIC_HEADER_FILES} gsmlib/gsm_unix_serial.h ) #Append the source files that are used only on Unix set (SOURCE_FILES ${SOURCE_FILES} gsmlib/gsm_unix_serial.cc ) endif (UNIX) if (BUILD_SHARED_LIBS) message (STATUS "Building shared GSM library") else () message (STATUS "Building static GSM library") endif (BUILD_SHARED_LIBS) set (HEADER_FILES ${PUBLIC_HEADER_FILES} gsmlib/gsm_nls.h gsmlib/gsm_sysdep.h ) add_library (gsm ${SOURCE_FILES} ${HEADER_FILES} ) if (WIN32) target_link_libraries (gsm ws2_32 rpcrt4 mswsock) endif (WIN32) install (TARGETS gsm ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) install (FILES ${PUBLIC_HEADER_FILES} DESTINATION include/gsmlib)