Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 38efce928ad3f23e374af40a9ebf9eaa51a467a1 Mon Sep 17 00:00:00 2001
- From: Michael Pavlyshko <me@mixaill.tk>
- Date: Sat, 20 Apr 2013 00:08:02 +0300
- Subject: [PATCH] Add MinGW support for alacarte-importer
- ---
- CMakeLists.txt | 11 ++++++++++-
- src/utils/transform.cpp | 6 +++++-
- 2 files changed, 15 insertions(+), 2 deletions(-)
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- index 06b34bd..24c2bd5 100644
- --- a/CMakeLists.txt
- +++ b/CMakeLists.txt
- @@ -26,6 +26,11 @@ endif (cairo_ver LESS 1 OR cairo_major LESS 12 OR cairo_minor LESS 2)
- pkg_check_modules(Freetype freetype2)
- pkg_check_modules(SigC++ sigc++-2.0)
- +#Set windows version for MinGW
- +IF(MINGW)
- +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501")
- +add_definitions(-D_WIN32_WINNT=0x0501)
- +ENDIF(MINGW)
- # Add preprocessor makro
- add_subdirectory(extras/pch)
- @@ -124,7 +129,11 @@ ENDIF(GMOCK_FOUND)
- add_precompiled_header(unitTests_eval "include/includes.hpp")
- target_link_libraries(alacarte-server ${Boost_LIBRARIES} ${Cairomm_LIBRARIES} ${LOG4CPP_LIBRARIES} ${SigC++_LIBRARIES} pthread)
- +IF(MINGW)
- +target_link_libraries(alacarte-importer ${Boost_LIBRARIES} ${LOG4CPP_LIBRARIES} pthread ws2_32 wsock32)
- +ELSE()
- target_link_libraries(alacarte-importer ${Boost_LIBRARIES} ${LOG4CPP_LIBRARIES} pthread)
- +ENDIF()
- target_link_libraries(unitTests_utils ${Boost_LIBRARIES} ${Cairomm_LIBRARIES} ${LOG4CPP_LIBRARIES} pthread)
- target_link_libraries(unitTests_general ${Boost_LIBRARIES} ${Cairomm_LIBRARIES} ${LOG4CPP_LIBRARIES} ${SigC++_LIBRARIES} pthread)
- target_link_libraries(unitTests_importer ${Boost_LIBRARIES} ${LOG4CPP_LIBRARIES} ${Cairomm_LIBRARIES} ${SigC++_LIBRARIES} pthread)
- @@ -173,4 +182,4 @@ if(DOXYGEN_FOUND)
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMENT "Generating API documentation with Doxygen" VERBATIM
- )
- -endif(DOXYGEN_FOUND)
- +endif(DOXYGEN_FOUND)
- \ No newline at end of file
- diff --git a/src/utils/transform.cpp b/src/utils/transform.cpp
- index 1b097f3..2e9bb90 100644
- --- a/src/utils/transform.cpp
- +++ b/src/utils/transform.cpp
- @@ -29,7 +29,7 @@
- * =====================================================================================
- */
- -#include <math.h>
- +#include <cmath>
- #include "settings.hpp"
- @@ -38,6 +38,10 @@
- #define RADIUS 6378137.0
- // 2 decimal places
- #define FACTOR 100.0
- +// workaround for MinGW
- +#ifndef M_PI
- +#define M_PI 3.14159265358979323846
- +#endif
- /**
- * @brief converts tile coordinates to north-west corner of the tile in the Mercator projection.
- --
- 1.8.1.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement