There was a line in samples/CMakeLists.txt which built all samples to the same binary name "tests", which made all the samples override each other while building.
function(add_sample NAME)
ADD_EXECUTABLE(ARGPARSE_SAMPLE_${NAME} ${NAME}.cpp)
INCLUDE_DIRECTORIES("../include" ".")
set_target_properties(ARGPARSE_SAMPLE_${NAME} PROPERTIES OUTPUT_NAME ${NAME})
set_target_properties(ARGPARSE_SAMPLE_${NAME} PROPERTIES OUTPUT_NAME tests) # This line overrides the above line
set_property(TARGET ARGPARSE_SAMPLE_${NAME} PROPERTY CXX_STANDARD 17)
endfunction()
There was a line in samples/CMakeLists.txt which built all samples to the same binary name "tests", which made all the samples override each other while building.
Simply removing the line:
causes all of the binaries to properly build to their respective files.