Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-6611

[C++ Windows] Create all binary executables in build/src folder

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.32
    • None
    • C++ Broker, C++ Client
    • None
    • Windows and Visual Studio; C++ builds

    Description

      My windows build produces 38 executables. Only one of them, qpidd.exe, actually runs in the folder in which it is produced. This means the other 37 just don't work.

       $ cd build\src\tests\Debug
       $ hello_world.exe
       The program can't start because qpidmessagingd.dll is missing from
        your computer. Try reinstalling the program to fix this problem.
      

      I'm including a patch to some cmake scripts that force all of the executables to be in the same folders that hold the qpid*.dll libraries. Then all of the executables work with minimal external diddling. Further, from within Visual Studio all executables, think HelloWorld, can be selected as as the 'Startup Project' and run directly.

      One can currently go into the shared installation /bin folder and run a fair number programs from there. All of the qpid/proton/boost libraries are in that folder and things 'just work'. What one cannot do is run 'hello_world' from within Visual Studio. So if you have a problem or a test case to try then you are stuck with no debugger. For hello_world to work under the debugger go into the project properties and point the $OutDir macro at <build>/src/Debug where all of the qpid dll files are and recompile. Now hello_world runs as expected in VS.

      So here's how working with this patch should play out.

      1. Get a nice checkout and apply the patch.
      2. Run cmake. Assume: mkdir build; cd build; cmake ../cpp
      3. Do a build. For this example use the Debug configuration. At this point the qpid dll files are in build\src\Debug and so are all 38 .exe example and test programs.
      4. Manually install some libraries.
        • copy ..\..\..\install_dir\bin\qpid-proton*.dll build\src\Debug. This step is not necessary if you have no proton.
        • You can also copy boost libraries or have boost in your path for native C++. For the .NET binding you must copy the boost libraries to build\src\Debug of the application will not start.

      Now CD into build\bin\Debug and all of the programs run. I can 'dir *.exe' and see the choices and try them. I can't remember the last time I ran print_events on Windows before today!

      I tried this patch on a Linux system. All of the executables are now in build/src as expected. Everything works: self test, qpidd, examples, tests. I will not suggest forcing this patch on the source tree in general as it will surely break scripts that have hard coded paths to executables and will break if the targets move around.

      If I'm missing some magic that solves these issues some other way I'd love to hear about it.

      Attachments

        1. qpid-exe-in-build_src.patch
          3 kB
          Charles E. Rolke

        Activity

          People

            Unassigned Unassigned
            chug Charles E. Rolke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: