Kitware / kwiver

Pulls Together Computer Vision Algorithms into Highly-Modular Run-Time Configurable Systems
Other
187 stars 83 forks source link

Tests fail to build in Visual Studio #434

Open mleotta opened 6 years ago

mleotta commented 6 years ago

When building KWIVER in Visual Studio on Windows, the test will fail to build because GTest is required to run at build time and is not in the system path. GTest is typically provided as part of Fletch. We need a way for CMake to add the Fletch binary directory to the path for the KWIVER visual studio solution file.

mleotta commented 6 years ago

@mwoehlke-kitware any thoughts on this? I consider GTest to be broken in KWIVER on Windows until this is addressed.

mwoehlke-kitware commented 6 years ago

From the README (see also #366):

If you are on Windows and enable tests (KWIVER_ENABLE_TESTS=ON), and are building shared libraries (BUILD_SHARED_LIBS=ON), you will need to add the path to gtest.dll to the PATH in your environment in order to build and run the tests.

The easiest way to achieve this is to use the setup_KWIVER.bat script (described in the next session), and to run builds and/or launch Visual Studio from a command prompt which has been so configured.

mleotta commented 6 years ago

We should not have to do this. This is a major pain. We want to be able to build this project as easily as any other project CMake-based project and not make the developers need to jump through hoops. You should not have to set your system path or launch Visual Studio from a command prompt to build KWIVER.

There must be some way for CMake to inject this path into the Visual Studio project file, right?

mwoehlke-kitware commented 6 years ago

There must be some way for CMake to inject this path into the Visual Studio project file, right?

Not to my knowledge. (At best it would require a new feature in CMake, but I seem to recall @bradking saying it is not possible.)

Anyway, you will have the same problem if you try to run the tests.