Skip to content
Permalink
Browse files
Merge pull request #464 from dakcarto/nmake-with-jom_1
Fix for #7289, add CMake option to enable building with Qt jom (nmake) on Windows
  • Loading branch information
dakcarto committed Mar 18, 2013
2 parents 5d62af3 + d7d1ece commit 4d11584388933d62a7b48df0e3d5a38cf2c5d81c
Showing with 26 additions and 11 deletions.
  1. +12 −3 CMakeLists.txt
  2. +2 −0 cmake_templates/qgsconfig.h.in
  3. +1 −1 src/core/qgsapplication.cpp
  4. +3 −3 src/crssync/CMakeLists.txt
  5. +8 −4 src/helpviewer/main.cpp
@@ -125,6 +125,11 @@ SET (ENABLE_TESTS TRUE CACHE BOOL "Build unit tests?")
# if set to other directory than expected
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH)

IF (MSVC AND CMAKE_GENERATOR MATCHES "NMake")
# following variable is also used in qgsconfig.h
SET (USING_NMAKE TRUE)
ENDIF (MSVC AND CMAKE_GENERATOR MATCHES "NMake")

#############################################################
# check if lexer and parser are not missing
# http://www.mail-archive.com/cmake@cmake.org/msg02861.html
@@ -295,7 +300,9 @@ FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
IF (PEDANTIC)
MESSAGE (STATUS "Pedantic compiler settings enabled")
IF(MSVC)
ADD_DEFINITIONS( /W4 )
IF (NOT USING_NMAKE)
ADD_DEFINITIONS( /W4 )
ENDIF (NOT USING_NMAKE)

# disable warnings
ADD_DEFINITIONS( /wd4100 ) # unused formal parameters
@@ -372,8 +379,10 @@ IF (WIN32)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)

IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
MESSAGE (STATUS "Generating browse files")
ADD_DEFINITIONS( /FR )
IF (NOT USING_NMAKE)
MESSAGE (STATUS "Generating browse files")
ADD_DEFINITIONS( /FR )
ENDIF (NOT USING_NMAKE)
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)

IF (INSTALL_DEPS)
@@ -32,6 +32,8 @@
//used by Mac to find system Qt plugins when bundle is run from build directory
#define QTPLUGINSDIR "${QT_PLUGINS_DIR}"

#cmakedefine USING_NMAKE

#cmakedefine HAVE_POSTGRESQL

#cmakedefine HAVE_SPATIALITE
@@ -118,7 +118,7 @@ void QgsApplication::init( QString customConfigPath )
{
// we run from source directory - not installed to destination (specified prefix)
ABISYM( mPrefixPath ) = QString(); // set invalid path
#ifdef _MSC_VER
#if defined(_MSC_VER) && ! defined(USING_NMAKE)
setPluginPath( ABISYM( mBuildOutputPath ) + "/" + QString( QGIS_PLUGIN_SUBDIR ) + "/" + ABISYM( mCfgIntDir ) );
#else
setPluginPath( ABISYM( mBuildOutputPath ) + "/" + QString( QGIS_PLUGIN_SUBDIR ) );
@@ -12,17 +12,17 @@ TARGET_LINK_LIBRARIES(crssync
${GDAL_LIBRARY}
)

IF(MSVC)
IF(MSVC AND NOT USING_NMAKE)
ADD_CUSTOM_TARGET(synccrsdb
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/crssync.exe
DEPENDS crssync
)
ELSE(MSVC)
ELSE(MSVC AND NOT USING_NMAKE)
ADD_CUSTOM_TARGET(synccrsdb
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/crssync
DEPENDS crssync
)
ENDIF(MSVC)
ENDIF(MSVC AND NOT USING_NMAKE)

INSTALL(CODE "MESSAGE(\"Installing crssync ...\")")
INSTALL(TARGETS crssync RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR})
@@ -41,14 +41,18 @@ int main( int argc, char ** argv )
{
context = argv[1];
}

if ( !QgsApplication::isRunningFromBuildDir() )
{
#if defined(Q_WS_MACX)
// If we're on Mac, we have the resource library way above us...
a.setPkgDataPath( QgsApplication::prefixPath() + "/../../../../" + QString( QGIS_DATA_SUBDIR ) );
// If we're on Mac, we have the resource library way above us...
a.setPkgDataPath( QgsApplication::prefixPath() + "/../../../../" + QString( QGIS_DATA_SUBDIR ) );
#elif defined(Q_WS_WIN)
a.setPkgDataPath( QgsApplication::prefixPath() + "/" QGIS_DATA_SUBDIR );
a.setPkgDataPath( QgsApplication::prefixPath() + "/" QGIS_DATA_SUBDIR );
#else
a.setPkgDataPath( QgsApplication::prefixPath() + "/../" QGIS_DATA_SUBDIR );
a.setPkgDataPath( QgsApplication::prefixPath() + "/../" QGIS_DATA_SUBDIR );
#endif
}

QString i18nPath = QgsApplication::i18nPath();
if ( myTranslationCode.isEmpty() )

0 comments on commit 4d11584

Please sign in to comment.