Skip to content
Permalink
Browse files

improve nmake detection

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11443 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Aug 19, 2009
1 parent 43216f9 commit d233cee83b870b29901b3cb48ebb34248af7f8c7
Showing with 15 additions and 3 deletions.
  1. +13 −0 cmake/Python.cmake
  2. +2 −3 python/CMakeLists.txt
@@ -103,6 +103,19 @@ MACRO (TRY_RUN_PYTHON RESULT CMD)
ENDIF (PYTHONINTERP_FOUND)
ENDMACRO (TRY_RUN_PYTHON)

IF(MSVC)
FIND_PROGRAM(SIP_MAKE_PROGRAM
NAMES nmake.exe
PATHS "$ENV{VCINSTALLDIR}/bin" "$ENV{PROGRAMFILES}/Microsoft Visual 9.0/VC/bin"
)
IF(NOT SIP_MAKE_PROGRAM)
MESSAGE(FATAL_ERROR "nmake not found")
ENDIF(NOT SIP_MAKE_PROGRAM)
ELSE (MSVC)
SET(SIP_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM})
ENDIF (MSVC)


# enable/disable python support (mapserver export tool and bindings)
IF (PYTHON_LIBRARIES AND PYTHON_INCLUDE_PATH)
SET (PYTHON_FOUND TRUE)
@@ -42,7 +42,6 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/configure.py.in

IF (MSVC)
SET(EXPORT "__declspec(dllimport)")
SET(CMAKE_MAKE_PROGRAM $ENV{VCINSTALLDIR}/bin/nmake.exe)
ELSE (MSVC)
SET(EXPORT "")
ENDIF (MSVC)
@@ -60,11 +59,11 @@ ADD_CUSTOM_COMMAND(OUTPUT ${BINDINGS_CORE_MAKEFILE} ${BINDINGS_GUI_MAKEFILE} PRE

# Step 3: run make in core and gui subdirs
ADD_CUSTOM_COMMAND(OUTPUT ${BINDINGS_CORE_LIB} PRE_LINK
COMMAND ${CMAKE_MAKE_PROGRAM}
COMMAND ${SIP_MAKE_PROGRAM}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/core
DEPENDS ${BINDINGS_CORE_MAKEFILE})
ADD_CUSTOM_COMMAND(OUTPUT ${BINDINGS_GUI_LIB} PRE_LINK
COMMAND ${CMAKE_MAKE_PROGRAM}
COMMAND ${SIP_MAKE_PROGRAM}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gui
DEPENDS ${BINDINGS_GUI_MAKEFILE})

0 comments on commit d233cee

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