The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14913 
====================================================================== 
Reported By:                trsystran
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14913
Category:                   Modules
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-05-12 12:08 EDT
Last Modified:              2014-05-12 12:08 EDT
====================================================================== 
Summary:                    GTEST_ADD_TESTS doesn't use new signature
ADD_TEST(NAME name COMMAND command): generated executable is then not found
Description: 
GTEST_ADD_TESTS doesn't use new signature ADD_TEST(NAME name COMMAND command): 
>From 2.8.8 (and today's git master) FindGTest.cmake:

add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})

generated executable is then not found:
Test project /home/.....
    Start 1: AUnitTest.Base
Could not find executable AUnitTest
Looked in the following places:
AUnitTest
AUnitTest
Release/AUnitTest
Release/AUnitTest
Debug/AUnitTest
Debug/AUnitTest
MinSizeRel/AUnitTest
MinSizeRel/AUnitTest
RelWithDebInfo/AUnitTest
RelWithDebInfo/AUnitTest
Deployment/AUnitTest
Deployment/AUnitTest
Development/AUnitTest
Development/AUnitTest
Unable to find executable: AUnitTest
1/4 Test http://www.cmake.org/Bug/view.php?id=1: AUnitTest.Base
..............***Not Run   0.00 sec


Steps to Reproduce: 
CMakeLists.txt:

set(AUnitTestSources
  Test.cc
  )

create_executable(AUnitTest
  ${AUnitTestSources}
  )

target_link_libraries(AUnitTest
  ${GTEST_BOTH_LIBRARIES}
  )

set(AUnitTestArgs "")
gtest_add_tests(AUnitTest
  "${AUnitTestArgs}"
  ${AUnitTestSources}
  )

Shell:
ctest -R "AUnitTest*"

Output:
"Could not find executable AUnitTest"

Additional Information: 
Using the old signature for add_test is the cause of the binary not found, see
bugs 14766, 12033, 8139.

By replacing the invocation of add_test by the following, it works:
add_test(NAME ${test_name} COMMAND ${executable} --gtest_filter=${test_name}
${extra_args})
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-05-12 12:08 trsystran      New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to