4
# Copyright (c) 2006-2007, Ralf Habacker
6
# Redistribution and use is allowed according to the terms of the BSD license.
11
# addExplorerWrapper creates batch files for fast access
12
# to the build environment from the win32 explorer.
14
# For mingw and nmake projects it's opens a command shell,
15
# for Visual Studio IDE's (at least tested with VS 8 2005) it
16
# opens the related .sln file with paths setting specified at
19
MACRO (addExplorerWrapper _projectname)
20
# write explorer wrappers
21
get_filename_component(CMAKE_BIN_PATH ${CMAKE_COMMAND} PATH)
22
set (ADD_PATH "${CMAKE_BIN_PATH}")
24
if (QT_QMAKE_EXECUTABLE)
25
get_filename_component(QT_BIN_PATH ${QT_QMAKE_EXECUTABLE} PATH)
26
set (ADD_PATH "${ADD_PATH};${QT_BIN_PATH}")
27
endif (QT_QMAKE_EXECUTABLE)
29
# add here more pathes
32
get_filename_component(MINGW_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
33
set (ADD_PATH "${ADD_PATH};${MINGW_BIN_PATH}")
34
write_file (${CMAKE_BINARY_DIR}/${_projectname}-shell.bat "set PATH=${ADD_PATH};%PATH%\ncmd.exe")
36
if (CMAKE_BUILD_TOOL STREQUAL "nmake")
37
get_filename_component(VC_BIN_PATH ${CMAKE_CXX_COMPILER} PATH)
38
write_file (${CMAKE_BINARY_DIR}/${_projectname}-shell.bat "set PATH=${ADD_PATH};%PATH%\ncall \"${VC_BIN_PATH}\\vcvars32.bat\"\ncmd.exe")
39
else (CMAKE_BUILD_TOOL STREQUAL "nmake")
40
write_file (${CMAKE_BINARY_DIR}/${_projectname}-sln.bat "set PATH=${ADD_PATH};%PATH%\nstart ${_projectname}.sln")
41
endif (CMAKE_BUILD_TOOL STREQUAL "nmake")
43
ENDMACRO (addExplorerWrapper)