Skip to content
Permalink
Browse files

[cmake] MXE build changes

  • Loading branch information
elpaso committed Feb 8, 2018
1 parent fb53ebf commit 6eac6ac8cbe93d545fad9262858347d905a08207
@@ -2,7 +2,7 @@ MACRO(CREATE_QGSVERSION)
IF (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
FIND_PROGRAM(GITCOMMAND git PATHS c:/cygwin/bin)
IF(GITCOMMAND)
IF(WIN32)
IF(WIN32 AND NOT CMAKE_CROSS_COMPILING)
IF(USING_NINJA)
SET(ARG %a)
ELSE(USING_NINJA)
@@ -16,7 +16,7 @@ MACRO(CREATE_QGSVERSION)
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/.git/index
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ELSE(WIN32)
ELSE(WIN32 AND NOT CMAKE_CROSS_COMPILING)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_BINARY_DIR}/qgsversion.h ${CMAKE_BINARY_DIR}/qgsversion.inc
COMMAND ${GITCOMMAND} log -n1 --pretty=\#define\\ QGSVERSION\\ \\"%h\\" >${CMAKE_BINARY_DIR}/qgsversion.h.temp
@@ -26,7 +26,7 @@ MACRO(CREATE_QGSVERSION)
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/.git/index
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ENDIF(WIN32)
ENDIF(WIN32 AND NOT CMAKE_CROSS_COMPILING)
ELSE(GITCOMMAND)
MESSAGE(STATUS "git marker, but no git found - version will be unknown")
IF(NOT SHA)
@@ -522,17 +522,23 @@ IF (WIN32)

IF (NOT WINDRES)
FIND_PROGRAM(WINDRES windres)
IF (NOT WINDRES)
IF (NOT WINDRES AND NOT CMAKE_RC_COMPILER)
MESSAGE(FATAL_ERROR "windres not found - aborting")
ENDIF (NOT WINDRES)
ENDIF (NOT WINDRES AND NOT CMAKE_RC_COMPILER)
ENDIF (NOT WINDRES)
#############################################################
# application icon
# resource compilation for MinGW
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
COMMAND ${WINDRES} -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
SET(QGIS_APPMAIN_SRCS ${QGIS_APPMAIN_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)

# MXE
IF (WINDRES)
#############################################################
# application icon
# resource compilation for MinGW
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
COMMAND ${WINDRES} -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
SET(QGIS_APPMAIN_SRCS ${QGIS_APPMAIN_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
ELSE (WINDRES)
SET (QGIS_APPMAIN_SRCS main.cpp ${IMAGE_RCC_SRCS} ${TEST_RCC_SRCS})
ENDIF (WINDRES)
ENDIF (MSVC)
ELSE(WIN32)
SET (QGIS_APPMAIN_SRCS main.cpp ${IMAGE_RCC_SRCS} ${TEST_RCC_SRCS})
@@ -556,7 +562,7 @@ IF(PEDANTIC)
ENDIF(PEDANTIC)

IF(MSVC)
# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in DbgHelp.h
# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in dbghelp.h
SET_SOURCE_FILES_PROPERTIES(
qgisapp.cpp
main.cpp
@@ -772,8 +778,8 @@ ENDIF (ANDROID)
IF(WIN32)
ADD_DEFINITIONS(-DQWT_DLL)
ADD_DEFINITIONS(-DQSCINTILLA_DLL)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} DbgHelp)
TARGET_LINK_LIBRARIES(qgis_app DbgHelp Qt5::WinExtras)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} dbghelp)
TARGET_LINK_LIBRARIES(qgis_app dbghelp Qt5::WinExtras)
ENDIF(WIN32)

TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} qgis_native)
@@ -431,7 +431,7 @@ extern "C"
#include <dlfcn.h>
#else
#include <windows.h>
#include <DbgHelp.h>
#include <dbghelp.h>
#endif

class QTreeWidgetItem;
@@ -1254,7 +1254,7 @@ ADD_DEPENDENCIES(qgis_core version)
# because of htonl
IF (WIN32)
FIND_LIBRARY(SETUPAPI_LIBRARY NAMES setupapi PATHS $ENV{LIB})
TARGET_LINK_LIBRARIES(qgis_core wsock32 ${SETUPAPI_LIBRARY} DbgHelp)
TARGET_LINK_LIBRARIES(qgis_core wsock32 ${SETUPAPI_LIBRARY} dbghelp)
ENDIF (WIN32)

IF (APPLE)
@@ -69,9 +69,9 @@
#else
#include <winsock.h>
#include <windows.h>
#include <Lmcons.h>
#include <lmcons.h>
#define SECURITY_WIN32
#include <Security.h>
#include <security.h>
#pragma comment( lib, "Secur32.lib" )
#endif

@@ -8,7 +8,7 @@ QT5_WRAP_CPP(CRASH_HDR_MOC qgscrashdialog.h)
SET(IMAGE_RCCS ../../images/images.qrc)
QT5_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS})

# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in DbgHelp.h
# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in dbghelp.h
SET_SOURCE_FILES_PROPERTIES(qgsstacktrace.cpp PROPERTIES COMPILE_FLAGS -wd4091)

ADD_EXECUTABLE(qgiscrashhandler WIN32
@@ -26,7 +26,7 @@ TARGET_LINK_LIBRARIES(qgiscrashhandler
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
DbgHelp
dbghelp
)

INSTALL(CODE "MESSAGE(\"Installing crashhandler ...\")")

0 comments on commit 6eac6ac

Please sign in to comment.
You can’t perform that action at this time.