CMake updates for Windows build
authorGraham Bloice <graham.bloice@trihedral.com>
Thu, 26 Mar 2015 14:11:21 +0000 (14:11 +0000)
committerGraham Bloice <graham.bloice@trihedral.com>
Thu, 26 Mar 2015 16:58:53 +0000 (16:58 +0000)
Removed the redundant setpath batch file and associated macro
and updated docs.

Change-Id: I5ddab6bad2d14ed3443194d7269f1890e4aa608e
Reviewed-on: https://code.wireshark.org/review/7826
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
CMakeLists.txt
README.cmake
cmake/modules/FindWSWinLibs.cmake

index 0a983f3c1768b76e47a63384d765d17056da1ba0..c0da586b345eff47b9d21a9bb052c907047a9882 100644 (file)
@@ -562,9 +562,6 @@ if(BUILD_wireshark)
                if( WIN32 )
                        set( QT5_BASE_PATH "$ENV{QT5_BASE_DIR}" )
                        set( CMAKE_PREFIX_PATH "${QT5_BASE_PATH}" )
-                       # Used for the creation of setpath.bat
-                       set( QT5_DLL_PATH "${QT5_BASE_PATH}/bin" )
-                       set( WS_ALL_LIBS ${WS_ALL_LIBS} ${QT5_DLL_PATH} )
                endif()
                set(PACKAGELIST ${PACKAGELIST}
                        Qt5Core
@@ -720,9 +717,6 @@ endforeach()
 # Provide Windows system lib names
 include( UseWinLibs )
 
-# Create file to set paths to run binaries from build dir
-WSExtendPath( "${WS_ALL_LIBS}" "${CMAKE_BINARY_DIR}/setpath.bat" )
-
 #packaging
 include(CPackConfig.txt)
 
index 922e5346b35eb5af98e65154f8c6369101cfa4ea..c27486394642d85330d7743552048c033ac01e14 100644 (file)
@@ -103,9 +103,7 @@ How to do an out of tree build using Visual C++ 2013:
    nmake /X- VERBOSE=1 (or cmake --build . -- VERBOSE=1 )
    Open Wireshark.sln in Windows Explorer to build in Visual Studio
    msbuild wireshark.sln /m /p:Configuration=RelWithDebInfo
-7) In case you want to test the executable(s) inside the build tree:
-   Run setpath.bat whenever it gets updated (there is a message in each cmake
-   run whether it is necessary or not).
+7) The executables can be run from the appropriate directory, e.g. run\RelWithDebInfo
 
 Why cmake?
 ==========
@@ -191,7 +189,7 @@ What needs to be done?
   people use it.
 - Handle -DFORTIFY_SOURCE=2 appropriately.  (Do a Web search for
   "cmake fortify" for some information.)
-- Add support for Visual Studio code anlaysis similar to ENABLE_CODE_ANALYSIS in
+- Add support for Visual Studio code analysis similar to ENABLE_CODE_ANALYSIS in
   config.nmake.
 - Define the GTK_DISABLE_ and GDK_DISABLE_ values as appropriate if we
   care about supporting the GTK+ version.
index ddf2980830174d4dd6c0bd14477c3e0a262e2f9b..05e53b0117805101262359cdc2930045758d8af1 100644 (file)
@@ -29,44 +29,3 @@ function( FindWSWinLibs _WS_LIB_SEARCH_PATH _LIB_HINT_VAR )
     endforeach()
   endif()
 endfunction()
-
-# Massage the list of paths to external libraries to output a batch file to update the PATH
-# So that running an executable can load the DLL's
-
-function( WSExtendPath _LIB_PATH_LIST _PATH_FILE )
-  if ( WIN32 )
-    #message( STATUS "All libs: ${_LIB_PATH_LIST}." )
-    # Convert each path that ends in "lib" to "bin" as linking requires the lib, running requires the dll.
-    foreach( THIS_LIB_PATH ${_LIB_PATH_LIST} )
-      if ( THIS_LIB_PATH MATCHES "[.]lib$" )
-        # lib is required for linking, the dlls are in bin so fix the path
-        # by chopping the library off the end and tacking "/bin" on
-        get_filename_component( LIB_PATH ${THIS_LIB_PATH} PATH )
-        string( REGEX REPLACE "/lib$" "/bin" LIB_PATH "${LIB_PATH}" )
-      else()
-        set ( LIB_PATH "${THIS_LIB_PATH}" )
-      endif()
-      #message( STATUS "Raw path ${THIS_LIB_PATH} processed to ${LIB_PATH}" )
-      set( WS_LOCAL_LIB_PATHS "${WS_LOCAL_LIB_PATHS}" ${LIB_PATH} )
-    endforeach()
-    list( REMOVE_DUPLICATES WS_LOCAL_LIB_PATHS )
-    # All generated libs go here, so start our libsearch in this place
-    set( WS_LOCAL_LIB_PATHS "${CMAKE_BINARY_DIR}/lib" "${WS_LOCAL_LIB_PATHS}" )
-    file( TO_NATIVE_PATH "${WS_LOCAL_LIB_PATHS}" WS_NATIVE_LIB_PATHS )
-    if ( EXISTS ${_PATH_FILE} )
-      file( READ ${_PATH_FILE} OLD_FILE_CONTENT )
-    else()
-      set( OLD_FILE_CONTENT " " )
-    endif()
-    #message( STATUS "Searching for ${WS_NATIVE_LIB_PATHS}\nin ${OLD_FILE_CONTENT}" )
-    string( FIND "${OLD_FILE_CONTENT}" "${WS_NATIVE_LIB_PATHS}" PATH_FOUND_AT )
-    #message( STATUS "Location of substr: ${PATH_FOUND_AT}" )
-    if( PATH_FOUND_AT GREATER -1 )
-      message( "\n${_PATH_FILE} is up to date.\n" )
-    else()
-      #message( STATUS "Native paths: ${WS_NATIVE_LIB_PATHS}" )
-      file( WRITE ${_PATH_FILE} "set PATH=%PATH%;${WS_NATIVE_LIB_PATHS}" )
-      message( "\n${_PATH_FILE} is new/updated, please run it.\n" )
-    endif()
-  endif()
-endfunction()