Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all samples building to "tests" binary #296

Merged
merged 1 commit into from
Oct 28, 2023

Conversation

cobyj33
Copy link
Contributor

@cobyj33 cobyj33 commented Oct 28, 2023

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()

Simply removing the line:

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_property(TARGET ARGPARSE_SAMPLE_${NAME} PROPERTY CXX_STANDARD 17)
endfunction()

causes all of the binaries to properly build to their respective files.

@p-ranav p-ranav merged commit 0d97e1c into p-ranav:master Oct 28, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants