<commit_before>
add_executable(simple_cat)

if(TARGET simple_cat)
  set(SIMPLE_CAT_TARGET_DEFINED TRUE)
else()
  set(SIMPLE_CAT_TARGET_DEFINED FALSE)
endif()
koan_assert_equal("${SIMPLE_CAT_TARGET_DEFINED}" "TRUE"
  MASTER_SAYS "Configuring the compilation of an executable or a library is done by providing its name and its sources with relative paths.")

# The sources needs a compile-time definition for HEADER_SYMBOL
target_compile_definitions(simple_cat INTERFACE HEADER_SYMBOL="!")

get_target_property(DEFINES simple_cat COMPILE_DEFINITIONS)
koan_assert_equal("HEADER_SYMBOL=\"!\"" "${DEFINES}"
  MASTER_SAYS "Setting the right compile-time defininitions for a specific target is key to building it correctly.")
<commit_msg>and a few more steps to provide more guidance<commit_after>
add_executable(simple_cat simple_cat.cpp)

if(TARGET simple_cat)
  set(SIMPLE_CAT_TARGET_DEFINED TRUE)
else()
  set(SIMPLE_CAT_TARGET_DEFINED FALSE)
endif()
koan_assert_equal("${SIMPLE_CAT_TARGET_DEFINED}" "TRUE"
  MASTER_SAYS "Configuring the compilation of an executable or a library is done by providing its name and its sources.")

get_target_property(SRC simple_cat SOURCES)
koan_assert_equal("simple_cat.cpp" "${SRC}"
  MASTER_SAYS "The sources should be provided as relative path whenever possible for easier maintenance of the configuration.")

# The sources needs a compile-time definition for HEADER_SYMBOL
target_compile_definitions(simple_cat PRIVATE HEADER_SYMBOL)

get_target_property(DEFINES simple_cat COMPILE_DEFINITIONS)
koan_assert_equal("HEADER_SYMBOL=\"!\"" "${DEFINES}"
  MASTER_SAYS "Correctly setting compile-time defininitions for a specific target is key to building it correctly.")

{'fraction_non_alphanumeric': 0.07294117647058823, 'fraction_numerical': 0.0, 'mean_word_length': 7.420792079207921, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3928252', 'n_tokens_mistral': 538, 'n_tokens_neox': 503, 'n_words': 159}