summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt23
-rw-r--r--README.cmake19
2 files changed, 25 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a8f525286..4aa0ae2c54 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,15 +86,29 @@ if(WIN32)
endif()
message(STATUS "Building for ${WIRESHARK_TARGET_PLATFORM} using ${CMAKE_GENERATOR}")
+ # Determine where the 3rd party libraries will be
+ if( DEFINED ENV{WIRESHARK_LIB_DIR} )
+ # The buildbots set WIRESHARK_LIB_DIR but not WIRESHARK_BASE_DIR.
+ file( TO_CMAKE_PATH "$ENV{WIRESHARK_LIB_DIR}" _PROJECT_LIB_DIR )
+ elseif( DEFINED ENV{WIRESHARK_BASE_DIR} )
+ file( TO_CMAKE_PATH "$ENV{WIRESHARK_BASE_DIR}" _WS_BASE_DIR )
+ set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${WIRESHARK_TARGET_PLATFORM}-libs" )
+ else()
+ # Don't know what to do
+ message(FATAL_ERROR "Neither WIRESHARK_BASE_DIR or WIRESHARK_LIB_DIR are defined")
+ endif()
+
# Download third-party libraries
file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/tools/win-setup.ps1 _win_setup)
- file (TO_NATIVE_PATH "$ENV{WIRESHARK_BASE_DIR}/wireshark-${WIRESHARK_TARGET_PLATFORM}-libs" _ws_lib_dir)
+ file (TO_NATIVE_PATH ${_PROJECT_LIB_DIR} _ws_lib_dir)
if(MSVC12)
set(_vsversion_args "12")
elseif(MSVC11)
set(_vsversion_args "11")
elseif(MSVC10)
set(_vsversion_args "10")
+ else()
+ message(FATAL_ERROR "Unsupported compiler ${CMAKE_C_COMPILER}")
endif()
# Is it possible to have a one-time, non-cached option in CMake? If
@@ -679,13 +693,6 @@ endif()
if(ENABLE_ZLIB)
if (WIN32)
# On Windows we build our own version of zlib, so add the paths
- if( DEFINED ENV{WIRESHARK_LIB_DIR} )
- # The buildbots set WIRESHARK_LIB_DIR but not WIRESHARK_BASE_DIR.
- file( TO_CMAKE_PATH "$ENV{WIRESHARK_LIB_DIR}" _PROJECT_LIB_DIR )
- else()
- file( TO_CMAKE_PATH "$ENV{WIRESHARK_BASE_DIR}" _WS_BASE_DIR )
- set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${WIRESHARK_TARGET_PLATFORM}-libs" )
- endif()
set(ZLIB_SRC_DIR "${_PROJECT_LIB_DIR}/zlib-1.2.8")
add_subdirectory("${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
set(ZLIB_INCLUDE_DIR "${ZLIB_SRC_DIR}" "${CMAKE_BINARY_DIR}/zlib")
diff --git a/README.cmake b/README.cmake
index 87481ea0be..e7ed50b669 100644
--- a/README.cmake
+++ b/README.cmake
@@ -77,11 +77,11 @@ How to do an out of tree build using Visual C++ 2013:
1) Follow https://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html
Steps 1-9
1a) Set the library search path.
- If you set WIRESHARK_LIB_DIR, it will be used as the top-level library
- directory.
If you set WIRESHARK_BASE_DIR,
%WIRESHARK_BASE_DIR%\wireshark-%WIRESHARK_TARGET_PLATFORM%-libs will
be used as the top-level library directory.
+ If you set WIRESHARK_LIB_DIR, it will be used as the top-level library
+ directory. This definition will require changing for different builds (x86 & x64).
1b) set WIRESHARK_TARGET_PLATFORM=win32 (or win64)
1c) set QT5_BASE_DIR=C:\Qt\5.4.1\5.4\msvc2013_opengl (must match the Qt component path
on your system)
@@ -91,24 +91,25 @@ How to do an out of tree build using Visual C++ 2013:
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 one of the following to generate the build files:
+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
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.
- -G "NMake Makefiles" - to build an nmake makefile.
+ 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.)
+ -G "NMake Makefiles" - to build an nmake makefile.
-G "Visual Studio 12 Win64" (Win32 is the default)
5) Run one of the following to build Wireshark:
- nmake /X- VERBOSE=1 (or cmake --build . -- VERBOSE=1 ) (if you generated nmake files).
+ msbuild /m /p:Configuration=RelWithDebInfo wireshark.sln (preferred).
Open Wireshark.sln in Windows Explorer to build in Visual Studio
- msbuild /m /p:Configuration=RelWithDebInfo wireshark.sln
- Subsequent changes to source files will be automagically detected
+ nmake /X- VERBOSE=1 (or cmake --build . -- VERBOSE=1 ) (if you generated nmake files).
+ Subsequent changes to source files and CMakeLists.txt will be automagically detected
and new build files generated, i.e. step 4) doesn't need to be run again.
Changes to the build environment, e.g. QT_BASE_DIR aren't detected so you must delete the
build dir and start form step 2) again.
-6) The executables can be run from the appropriate directory, e.g. run\RelWithDebInfo
+6) The executables can be run from the appropriate directory, e.g. run\RelWithDebInfo for VS solutions
+ or run\ for NMake files.
7) To build an installer, build the nsis_package project, e.g.
msbuild /m /p:Configuration=RelWithDebInfo nsis_package.vcxproj
nmake ???