# Initialize ###################################################################################### Include ( cotire OPTIONAL RESULT_VARIABLE HAS_COTIRE ) Include ( pedantic OPTIONAL RESULT_VARIABLE HAS_PEDANTIC ) Include ( cmake_tests OPTIONAL RESULT_VARIABLE HAS_CMAKE_TESTS ) # Test ############################################################################################ Find_Package ( GTest ) If ( NOT "${GTest_FOUND}" ) Return ( ) EndIf ( ) File ( GLOB_RECURSE CPPARGS_TEST_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h ) File ( GLOB_RECURSE CPPARGS_TEST_INLINE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.inl ) File ( GLOB_RECURSE CPPARGS_TEST_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ) Add_Executable ( cppargs-test EXCLUDE_FROM_ALL ${CPPARGS_TEST_HEADER_FILES} ${CPPARGS_TEST_INLINE_FILES} ${CPPARGS_TEST_SOURCE_FILES} ) Target_Link_Libraries ( cppargs-test PUBLIC cppargs GTest::Main ) # optimization If ( HAS_COTIRE ) Cotire ( cppargs-test ) EndIf ( ) # pedantic If ( HAS_PEDANTIC ) Pedantic_Apply_Flags_Target ( cppargs-test ALL ) EndIf ( ) # test If ( HAS_CMAKE_TESTS ) Add_CMake_Test ( NAME cppargs TARGET cppargs-test ) Else ( ) Add_Test ( NAME cppargs COMMAND cppargs-test ) EndIf ( )