title: Cmake/Ctest test failure when initializing googletest
body: <p>I am trying to integrate Ctest and googletest in my project. I included googletest in my project as described in <a href="https://crascit.com/2015/07/25/cmake-gtest/" rel="nofollow">https://crascit.com/2015/07/25/cmake-gtest/</a>.</p>
  
  <p>I created a new test folder with a CoreTest.cpp and a CMakeLists.txt. The CMakeLists contains:</p>
  
  <pre><code>ADD_EXECUTABLE(CoreTest CoreTest.cpp)
  TARGET_LINK_LIBRARIES(CoreTest corelib gtest gmock)
  ADD_TEST(NAME CoreTest COMMAND CoreTest)
  </code></pre>
  
  <p>CoreTest.cpp contains:</p>
  
  <pre><code>int main(int argc, char **argv) 
  {
      testing::InitGoogleTest(&amp;argc, argv);
      //return RUN_ALL_TESTS();
      return 0;
  }
  </code></pre>
  
  <p>This fails:</p>
  
  <pre><code>1&gt;------ Rebuild All started: Project: RUN_TESTS, Configuration: Debug x64 ------
  1&gt;  Test project
  1&gt;      Start 1: CoreTest
  1&gt;  1/1 Test #1: CoreTest .....................***Failed    1.52 sec
  1&gt;  
  1&gt;  0% tests passed, 1 tests failed out of 1
  </code></pre>
  
  <p>However if I comment the InitGoogleTest line then the test succeeds.</p>
  
  <p>Any idea on what could be the problem here ?</p>
  
  <p>Many thanks !</p>
  
  <p>Thanks axalis! I tried to run from the command line and realized that the googletest dlls were not in my path, which was the problem.</p>
  
  <p>I added multiple tests but I can only see the ctest output in MSVC:</p>
  
  <pre><code>1&gt;------ Rebuild All started: Project: RUN_TESTS, Configuration: Debug x64 ------
  1&gt;  Test project 
  1&gt;      Start 1: CoreTest
  1&gt;  1/1 Test #1: CoreTest .....................   Passed    0.03 sec
  1&gt;  
  1&gt;  100% tests passed, 0 tests failed out of 1
  </code></pre>
  
  <p>Is there a way to see the googletest output like what I get from the console ?:</p>
  
  <pre><code>&gt;CoreTest.exe
  [==========] Running 2 tests from 1 test case.
  [----------] Global test environment set-up.
  [----------] 2 tests from MathTest
  [ RUN      ] MathTest.TwoPlusTwoEqualsFour
  [       OK ] MathTest.TwoPlusTwoEqualsFour (0 ms)
  [ RUN      ] MathTest.TwoPlusFourEqualsSix
  [       OK ] MathTest.TwoPlusFourEqualsSix (0 ms)
  [----------] 2 tests from MathTest (1 ms total)
  
  [----------] Global test environment tear-down
  [==========] 2 tests from 1 test case ran. (4 ms total)
  [  PASSED  ] 2 tests.
  </code></pre>