Skip to content

Commit

Permalink
improve nmake detection
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11443 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 19, 2009
1 parent 80a9cef commit fdc629c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 13 additions & 0 deletions cmake/Python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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})

Expand Down

0 comments on commit fdc629c

Please sign in to comment.