aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-rw-r--r--Makefile.am1
-rw-r--r--README.cmake8
-rw-r--r--cmake/modules/LocatePythonExecutable.cmake18
4 files changed, 27 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 85d77b73cf..7f234acf28 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,6 +134,9 @@ if(WIN32)
endif()
# XXX Add a dependency on ${_ws_lib_dir}/current_tag.txt?
+
+ # Head off any attempts to use Cygwin's Python.
+ include(LocatePythonExecutable)
endif(WIN32)
include(UseCustomIncludes)
@@ -769,10 +772,10 @@ endif()
set(PROGLIST)
-#Sort the package list
+# Sort the package list
list(SORT PACKAGELIST)
message(STATUS "Packagelist: ${PACKAGELIST}")
-#Let's loop the package list
+# Let's loop the package list
foreach(PACKAGE ${PACKAGELIST})
if(${PACKAGE} STREQUAL "Qt4")
set(PACKAGE_VAR "QT")
diff --git a/Makefile.am b/Makefile.am
index 2599639ef6..665e37e621 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1333,6 +1333,7 @@ EXTRA_DIST = \
cmake/modules/gmxTestLargeFiles.cmake \
cmake/modules/hhc.cmake \
cmake/modules/LICENSE.txt \
+ cmake/modules/LocatePythonExecutable.cmake \
cmake/modules/LocatePythonModule.cmake \
cmake/modules/readme.txt \
cmake/modules/UseABICheck.cmake \
diff --git a/README.cmake b/README.cmake
index 41edb8ad72..2d6f2d75dc 100644
--- a/README.cmake
+++ b/README.cmake
@@ -90,15 +90,13 @@ How to do an out of tree build using Visual C++ 2013:
1c) set QT5_BASE_DIR=C:\Qt\5.4.1\5.4\msvc2013_opengl (must match the Qt component path
on your system)
1d) If you want to use Visual Studio to build rather than msbuild from the command line,
- make sure that the paths to Python and Cygwin are available to GUI applications.
- The Python path MUST come first.
+ make sure that the path to Cygwin is available to GUI applications.
2) mkdir c:\wireshark\build or as appropriate for you.
You will need one build directory for each bitness (win32, win64) you wish to build.
3) cd into the directory from 2) above.
4) Run the following to generate the build files:
- cmake -DPYTHON_EXECUTABLE=/path/to/python -DENABLE_CHM_GUIDES=on xxx path\to\sources
- where /path/to/python is the path to your Windows python executable, e.g. C:/Python27/python
- and path\to\sources is the absolute or relative path to the wireshark source tree
+ cmake -DENABLE_CHM_GUIDES=on xxx path\to\sources
+ where path\to\sources is the absolute or relative path to the wireshark source tree
and xxx is replaced with one of the following:
nothing - This will build a VS solution for win32 using the latest version of VS found (preferred).
-G "Visual Studio 12" ("12" builds for VS2013. Use "11" for VS2012 or "10" for VS2010.)
diff --git a/cmake/modules/LocatePythonExecutable.cmake b/cmake/modules/LocatePythonExecutable.cmake
new file mode 100644
index 0000000000..125ed5fff5
--- /dev/null
+++ b/cmake/modules/LocatePythonExecutable.cmake
@@ -0,0 +1,18 @@
+# Try to find Python and set PYTHON_EXECUTABLE on Windows prior to
+# calling FindPythonInterp in order to keep us from using Cygwin's Python.
+# http://public.kitware.com/Bug/view.php?id=13818
+
+if(NOT PYTHON_EXECUTABLE AND WIN32)
+ foreach(_major_version 3 2)
+ foreach(_minor_version 7 6 5 4 3 2 1)
+ find_program(PYTHON_EXECUTABLE
+ python.exe
+ PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_major_version}.${_minor_version}\\InstallPath]
+ NO_DEFAULT_PATH
+ )
+ if (PYTHON_EXECUTABLE)
+ break()
+ endif()
+ endforeach()
+ endforeach()
+endif() \ No newline at end of file