Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

45 lignes
1.9 KiB

  1. # Initialize ######################################################################################
  2. Include ( cotire OPTIONAL RESULT_VARIABLE HAS_COTIRE )
  3. Include ( pedantic OPTIONAL RESULT_VARIABLE HAS_PEDANTIC )
  4. Include ( cmake_tests OPTIONAL RESULT_VARIABLE HAS_CMAKE_TESTS )
  5. # Test ############################################################################################
  6. Find_Package ( GTest )
  7. If ( NOT "${GTest_FOUND}" )
  8. Return ( )
  9. EndIf ( )
  10. File ( GLOB_RECURSE CPPARGS_TEST_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h )
  11. File ( GLOB_RECURSE CPPARGS_TEST_INLINE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.inl )
  12. File ( GLOB_RECURSE CPPARGS_TEST_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp )
  13. Add_Executable ( cppargs-test
  14. EXCLUDE_FROM_ALL
  15. ${CPPARGS_TEST_HEADER_FILES}
  16. ${CPPARGS_TEST_INLINE_FILES}
  17. ${CPPARGS_TEST_SOURCE_FILES} )
  18. Target_Link_Libraries ( cppargs-test
  19. PUBLIC
  20. cppargs
  21. GTest::Main )
  22. # optimization
  23. If ( HAS_COTIRE )
  24. Cotire ( cppargs-test )
  25. EndIf ( )
  26. # pedantic
  27. If ( HAS_PEDANTIC )
  28. Pedantic_Apply_Flags_Target ( cppargs-test
  29. ALL )
  30. EndIf ( )
  31. # test
  32. If ( HAS_CMAKE_TESTS )
  33. Add_CMake_Test ( NAME cppargs TARGET cppargs-test )
  34. Else ( )
  35. Add_Test ( NAME cppargs COMMAND cppargs-test )
  36. EndIf ( )