├── cmake ├── core │ ├── err.cmake │ ├── return │ │ ├── return_reset.cmake │ │ ├── set_ans.cmake │ │ ├── set_ans_ref.cmake │ │ ├── return_truth.cmake │ │ ├── return_math.cmake │ │ ├── ans_append.cmake │ │ ├── return_ans.cmake │ │ ├── clr.cmake │ │ ├── return.cmake │ │ ├── return_refs.cmake │ │ └── return_ref.cmake │ ├── yield_return.cmake │ ├── beep.cmake │ ├── yield_begin.cmake │ ├── pkg.cmake │ ├── return_data.cmake │ ├── return_nav.cmake │ ├── print.cmake │ ├── yield.cmake │ ├── math_min.cmake │ ├── echo_append_padded.cmake │ ├── eval_math.cmake │ ├── global_config.cmake │ ├── message_indent_get.cmake │ ├── message_indent.cmake │ ├── status_line.cmake │ ├── tock.cmake │ ├── echo_append_indent.cmake │ ├── cmake │ │ ├── _cmake.cmake │ │ ├── cmake.cmake │ │ ├── cpack.cmake │ │ └── ctest.cmake │ ├── eval_truth.cmake │ ├── math_max.cmake │ ├── status_line_restore.cmake │ ├── message_indent_level.cmake │ ├── vars_elevate.cmake │ ├── message_indent_level_pop.cmake │ ├── os.cmake │ ├── make_guid.cmake │ ├── scope_resolve.cmake │ ├── cmake_entry_point.cmake │ ├── require.cmake │ ├── require_include_dirs.cmake │ ├── return_if_run_before.cmake │ ├── ternary.cmake │ ├── include_glob.cmake │ └── exception │ │ └── is_exception.cmake ├── shell │ ├── home_path.cmake │ ├── shell_env_prepend.cmake │ ├── echo.cmake │ ├── alias_exists.cmake │ ├── echo_append.cmake │ ├── shell_get.cmake │ ├── shell_path_set.cmake │ ├── shell_env_append.cmake │ ├── alias_remove.cmake │ ├── unix_path.cmake │ └── shell_path_get.cmake ├── process │ ├── process_start_info.cmake │ ├── linux │ │ ├── nohup.cmake │ │ ├── bash_lean.cmake │ │ ├── linux_ps_lean.cmake │ │ ├── bash.cmake │ │ ├── linux_ps.cmake │ │ ├── linux_ps_info_get.cmake │ │ ├── linux_kill.cmake │ │ ├── linux_ps_info_capture.cmake │ │ └── linux_ps_info.cmake │ ├── process_handle_get.cmake │ ├── process_handle_register.cmake │ ├── await.cmake │ ├── process_isrunning.cmake │ ├── process_list.cmake │ ├── process_info.cmake │ ├── process_kill.cmake │ └── process_handles.cmake ├── web │ ├── github │ │ ├── git_repository.cmake │ │ └── github_get_file.cmake │ ├── bitbucket │ │ └── bitbucket_read_file.cmake │ └── check_host.cmake ├── cmake │ ├── README.md │ ├── README.md.in │ ├── environment │ │ ├── os_families.cmake │ │ ├── cmake_is_script_mode.cmake │ │ ├── cmake_capabilities.cmake │ │ └── cmake_is_configure_mode.cmake │ ├── targets │ │ ├── target_list.cmake │ │ ├── overrides │ │ │ ├── add_dependencies.cmake │ │ │ ├── include_directories.cmake │ │ │ ├── target_compile_options.cmake │ │ │ ├── target_compile_definitions.cmake │ │ │ ├── add_test.cmake │ │ │ ├── add_executable.cmake │ │ │ └── add_custom_target.cmake │ │ ├── target_set.cmake │ │ ├── target_get.cmake │ │ ├── target_has.cmake │ │ ├── target_append.cmake │ │ └── target_append_string.cmake │ ├── old │ │ ├── cmake_script_parse_file.cmake │ │ ├── cmake_function_parse.cmake │ │ └── cmake_function_signatures.cmake │ ├── is_cmake_function.cmake │ ├── cmakelists │ │ └── cml.cmake │ ├── reflection │ │ ├── utilities │ │ │ └── cmake_token_eof.cmake │ │ └── token_manipulation │ │ │ ├── cmake_token_advance.cmake │ │ │ └── cmake_token_go_back.cmake │ └── ast │ │ └── cmake_ast_serialize.cmake ├── log │ ├── warning.cmake │ ├── log_default_handler.cmake │ ├── log_clear.cmake │ ├── error.cmake │ └── fatal.cmake ├── filesystem │ ├── file_isjsonfile.cmake │ ├── archive │ │ ├── tar_lean.cmake │ │ └── tar.cmake │ ├── file │ │ ├── fappend.cmake │ │ ├── map_source_file_get.cmake │ │ ├── fread.cmake │ │ ├── fexists.cmake │ │ ├── ftime.cmake │ │ ├── fwrite.cmake │ │ └── map_source_file_set.cmake │ ├── navigation │ │ ├── pwd.cmake │ │ ├── dirs.cmake │ │ ├── pushtmp.cmake │ │ ├── popd.cmake │ │ └── pushd.cmake │ ├── path │ │ ├── path_qualify.cmake │ │ ├── path_combine.cmake │ │ ├── paths.cmake │ │ ├── paths_to_map.cmake │ │ ├── paths_relative.cmake │ │ ├── path_extension.cmake │ │ ├── path_parent_dir.cmake │ │ └── path_issubdir.cmake │ ├── operations │ │ ├── mkdir.cmake │ │ ├── mkdirs.cmake │ │ └── mktemp.cmake │ ├── mime_type │ │ └── mime_type_get.cmake │ ├── is_temp_file.cmake │ └── dir_isempty.cmake ├── quickmap │ ├── kv.cmake │ └── var.cmake ├── object │ ├── core │ │ ├── obj_delete.cmake │ │ └── obj_has.cmake │ ├── this │ │ ├── this_capture.cmake │ │ ├── this_get.cmake │ │ ├── this_setprototype.cmake │ │ ├── this_import.cmake │ │ ├── property.cmake │ │ ├── this_callmember.cmake │ │ ├── this_declarefunction.cmake │ │ ├── this_declare_get_keys.cmake │ │ ├── this_declare_setter.cmake │ │ ├── this_declare_member_call.cmake │ │ ├── this_declare_getter.cmake │ │ ├── this_declare_call.cmake │ │ ├── this_append.cmake │ │ └── this_set.cmake │ ├── helpers │ │ ├── obj_getprototype.cmake │ │ ├── obj_setprototype.cmake │ │ ├── new.cmake │ │ ├── obj_declare_setter.cmake │ │ ├── obj_declare_get_keys.cmake │ │ ├── obj_declare_call.cmake │ │ ├── obj_declare_member_call.cmake │ │ ├── obj_declare_getter.cmake │ │ ├── objs.cmake │ │ └── structured_data.cmake │ └── default │ │ └── obj_default_setter.cmake ├── package │ ├── scaffold.cmake │ ├── project │ │ ├── project_close.png │ │ ├── project_open.png │ │ ├── dependency_graph_1.png │ │ ├── project_lifecycle.png │ │ └── extensions │ │ │ ├── cmake │ │ │ └── project_cmake_constants.cmake │ │ │ └── hooks │ │ │ ├── on_ready_hook.cmake │ │ │ └── on_unloading_hook.cmake │ ├── package_source │ │ ├── default │ │ │ ├── resolve_package.cmake │ │ │ └── query_package.cmake │ │ ├── host │ │ │ └── package_source_rate_uri.cmake │ │ ├── hg │ │ │ └── hg_package_source.cmake │ │ ├── svn │ │ │ └── svn_package_source.cmake │ │ └── git │ │ │ └── git_package_source.cmake │ ├── state │ │ ├── project_state_matches.cmake │ │ └── project_state_get.cmake │ └── project_descriptor │ │ ├── README.md │ │ └── README.md.in ├── type │ ├── t_path.cmake │ ├── helplist.cmake │ ├── parameter_definition_list.cmake │ ├── prompt_property.cmake │ ├── prompt_input.cmake │ ├── t_bool.cmake │ ├── t_int.cmake │ ├── parameter_definition_get.cmake │ ├── prompt.cmake │ ├── t_semver.cmake │ ├── t_map.cmake │ ├── query_fundamental.cmake │ ├── t_target_identifier.cmake │ ├── t_uri.cmake │ ├── t_callable.cmake │ └── arguments_extract_typed_values.cmake ├── ref │ ├── address_delete.cmake │ ├── address_print.cmake │ ├── address_set.cmake │ ├── address_append.cmake │ ├── address_append_string.cmake │ ├── address_set_new.cmake │ ├── address_peek_back.cmake │ ├── address_peek_front.cmake │ ├── address_push_front.cmake │ ├── address_pop_back.cmake │ ├── address_pop_front.cmake │ ├── address_push_back.cmake │ ├── address_type_get.cmake │ └── address_get.cmake ├── listings │ ├── listing.cmake │ ├── listing_line.cmake │ ├── listing_end_compile.cmake │ ├── listing_begin.cmake │ ├── listing_end.cmake │ ├── listing_include.cmake │ ├── listing_append_lines.cmake │ ├── listing_append.cmake │ ├── listing_make_compile.cmake │ └── listing_combine.cmake ├── sequence │ ├── sequence_get.cmake │ ├── sequence_count.cmake │ ├── sequence_index_isvalid.cmake │ ├── sequence_isvalid.cmake │ └── sequence_add.cmake ├── formats │ ├── json │ │ ├── json_print.cmake │ │ └── json_write.cmake │ ├── csv │ │ └── csv_serialize.cmake │ ├── quick_map │ │ ├── qm_print.cmake │ │ ├── qm_deserialize.cmake │ │ ├── qm_read.cmake │ │ └── qm_deserialize_file.cmake │ ├── cmake │ │ ├── cmake_read.cmake │ │ ├── cmake_write.cmake │ │ └── cmake_deserialize_file.cmake │ └── xml │ │ └── xml_parse_values.cmake ├── map │ ├── helpers │ │ ├── map_keys_clear.cmake │ │ ├── map_keys_set.cmake │ │ ├── map_keys_append.cmake │ │ ├── map_peek_back.cmake │ │ ├── map_peek_front.cmake │ │ ├── map_count.cmake │ │ ├── map_at.cmake │ │ ├── map_flatten.cmake │ │ ├── map_push_back.cmake │ │ ├── list_match.cmake │ │ ├── map_pop_back.cmake │ │ ├── map_pop_front.cmake │ │ ├── map_keys_sort.cmake │ │ ├── map_clear.cmake │ │ ├── map_isempty.cmake │ │ ├── map_push_front.cmake │ │ ├── map_rename.cmake │ │ ├── map_keys_remove.cmake │ │ ├── map_ensure.cmake │ │ ├── map_omit.cmake │ │ ├── map_matches.cmake │ │ ├── map_key_at.cmake │ │ └── map_has_any.cmake │ ├── core │ │ ├── map_set_hidden.cmake │ │ ├── map_delete.cmake │ │ ├── map_set_special.cmake │ │ ├── map_new.cmake │ │ ├── is_map.cmake │ │ └── map_append.cmake │ ├── evaluate │ │ ├── map_conditional_switch.cmake │ │ └── map_conditional_evaluate.cmake │ ├── iterator │ │ └── map_iterator.cmake │ └── operations │ │ └── map_equal_obj.cmake ├── ast │ ├── ast_parse_end_of_stream.cmake │ ├── expr │ │ ├── expr_eval_identifier.cmake │ │ ├── expr_eval_string.cmake │ │ ├── expr_compile_bind.cmake │ │ ├── expr_compile_number.cmake │ │ └── expr_compile_string.cmake │ ├── json │ │ ├── ast_json_eval_null.cmake │ │ ├── ast_json_eval_number.cmake │ │ ├── ast_json_eval_string.cmake │ │ ├── ast_json_eval_boolean.cmake │ │ └── ast_json_eval_object.cmake │ ├── token_stream_commit.cmake │ ├── ast_eval_literal.cmake │ ├── token_stream_isempty.cmake │ ├── token_stream_pop.cmake │ ├── token_stream_push.cmake │ └── token_stream_move_next.cmake ├── task │ ├── tqr.cmake │ ├── task_start.cmake │ ├── is_task.cmake │ ├── task_from_cmake_code.cmake │ ├── task_queue_push_all.cmake │ ├── promise_state.cmake │ ├── task_start_anonymous.cmake │ ├── task_queue_is_empty.cmake │ ├── task_is_completed.cmake │ ├── task_queue_global.cmake │ ├── promise_is_resolved.cmake │ ├── task_state.cmake │ └── task.cmake ├── templating │ ├── helpers │ │ ├── markdown_link.cmake │ │ ├── markdown_section.cmake │ │ ├── markdown_template_function_header.cmake │ │ └── markdown_see_function.cmake │ ├── template_run_scoped.cmake │ ├── template │ │ ├── template_output_stream.cmake │ │ ├── template_end.cmake │ │ ├── template_out_format.cmake │ │ └── template_begin.cmake │ └── eval_predicate_template_cmake.cmake ├── regex │ ├── regex_all.cmake │ ├── regex_match.cmake │ ├── regex_replace.cmake │ └── regex_escaped_string.cmake ├── collections │ ├── encoded_list │ │ ├── encoded_list_remove_at.cmake │ │ ├── encoded_list_get.cmake │ │ ├── encoded_list_peek_back.cmake │ │ ├── encoded_list.cmake │ │ ├── encoded_list_peek_front.cmake │ │ ├── encoded_list_append.cmake │ │ ├── encoded_list_set.cmake │ │ ├── encoded_list_pop_back.cmake │ │ ├── encoded_list_pop_front.cmake │ │ └── is_encoded_list.cmake │ ├── list_length.cmake │ ├── linked_list │ │ ├── linked_list_push_front.cmake │ │ └── linked_list_push_back.cmake │ ├── range │ │ └── is_range.cmake │ ├── list_push_back.cmake │ ├── list_max.cmake │ ├── list_reverse.cmake │ ├── list_iterator.cmake │ ├── list_push_front.cmake │ ├── list_isempty.cmake │ ├── list_iterator_break.cmake │ ├── list_get_lean.cmake │ ├── list_erase.cmake │ ├── list_select_property.cmake │ ├── list_peek_front.cmake │ ├── list_swap.cmake │ └── list_remove_duplicates.cmake ├── timer │ ├── timer_delete.cmake │ ├── timers_get.cmake │ ├── timer_print_elapsed.cmake │ └── timers_print_all.cmake ├── propref │ ├── propref_get_ref.cmake │ └── propref_get_key.cmake ├── session │ └── session.cmake ├── function │ ├── invocation_argument_string.cmake │ ├── save_function.cmake │ ├── function_string_import.cmake │ ├── invocation_arguments_sequence.cmake │ ├── invocation_argument_encoded_list.cmake │ ├── is_function_cmake.cmake │ ├── load_function.cmake │ ├── check_function.cmake │ ├── lambda │ │ ├── is_lambda.cmake │ │ ├── lambda.cmake │ │ └── lambda_import.cmake │ ├── callable │ │ ├── callable_call.cmake │ │ └── is_callable.cmake │ ├── function_signature_regex.cmake │ ├── arguments_anonymous_function.cmake │ ├── define_function.cmake │ ├── try_call.cmake │ ├── is_function_ref.cmake │ ├── arguments_function.cmake │ └── rcall.cmake ├── string │ ├── string_concat.cmake │ ├── ascii_code.cmake │ ├── string_to_target_name.cmake │ ├── regex_search.cmake │ ├── string_eval.cmake │ ├── string_append_line_indented.cmake │ ├── encoding │ │ ├── string_decode_empty.cmake │ │ ├── string_encode_empty.cmake │ │ └── string_decode_parentheses.cmake │ ├── escape_argument.cmake │ ├── ascii_char.cmake │ ├── string_random.cmake │ ├── string_toupper.cmake │ └── string_tolower.cmake ├── testing │ └── assertf.cmake ├── cache │ ├── cache_clear.cmake │ ├── file_cache_clear_all.cmake │ ├── memory_cache_clear.cmake │ ├── cache_update.cmake │ ├── string_cache_hit.cmake │ ├── cache_return_hit.cmake │ ├── memory_cache_return_hit.cmake │ ├── file_cache_clear.cmake │ ├── file_cache_exists.cmake │ ├── file_cache_return_hit.cmake │ ├── file_cache_update.cmake │ ├── file_cache_get.cmake │ ├── string_cache_location.cmake │ ├── memory_cache_exists.cmake │ ├── string_cache_return_hit.cmake │ ├── string_cache_get.cmake │ ├── cache_exists.cmake │ └── memory_cache_key.cmake ├── persistence │ ├── file_data │ │ ├── file_data_path.cmake │ │ ├── file_data_write.cmake │ │ ├── file_data_clear.cmake │ │ ├── file_data_read.cmake │ │ ├── file_data_write_obj.cmake │ │ └── file_data_get.cmake │ ├── key_value │ │ ├── key_value_store_keys.cmake │ │ ├── key_value_store_save.cmake │ │ ├── key_value_store_delete.cmake │ │ └── key_value_store_load.cmake │ ├── fallback_data │ │ ├── fallback_data_set.cmake │ │ └── fallback_data_get.cmake │ ├── user_data │ │ ├── user_data_write.cmake │ │ └── user_data_write_obj.cmake │ └── indexed │ │ ├── indexed_store_find.cmake │ │ ├── indexed_store_delete.cmake │ │ ├── indexed_store_load.cmake │ │ └── indexed_store_keys.cmake ├── debugging │ ├── print_var.cmake │ ├── print_macros.cmake │ ├── print_commands.cmake │ ├── print_locals.cmake │ ├── print_function.cmake │ └── print_result.cmake ├── indent_level │ ├── indent.cmake │ ├── indent_level_pop.cmake │ ├── indent_level.cmake │ └── indent_get.cmake ├── platform │ └── windows │ │ ├── cmd │ │ ├── win32_cmd_lean.cmake │ │ └── win32_cmd.cmake │ │ ├── taskkill │ │ └── win32_taskkill.cmake │ │ ├── tasklist │ │ ├── win32_tasklist_bare.cmake │ │ └── win32_tasklist.cmake │ │ ├── powershell │ │ ├── win32_powershell.cmake │ │ └── win32_powershell_lean.cmake │ │ └── msi │ │ ├── msiexec_lean.cmake │ │ └── msiexec.cmake ├── scope │ ├── scope_print.cmake │ ├── scope_keys.cmake │ └── scope_clear.cmake ├── stack │ ├── stack_peek.cmake │ ├── queue_new.cmake │ ├── rlist_new.cmake │ ├── stack_new.cmake │ ├── stack_isempty.cmake │ ├── queue_push.cmake │ ├── queue_isempty.cmake │ └── queue_peek.cmake ├── uri │ ├── uri_coerce.cmake │ ├── uri_parse_scheme.cmake │ ├── uri.cmake │ ├── uri_check_scheme.cmake │ └── uri_parse_query.cmake ├── vcs │ ├── git │ │ ├── git_repository_name.cmake │ │ ├── git_base_dir.cmake │ │ ├── git_scm_descriptor.cmake │ │ ├── git_remote_exists.cmake │ │ └── git.cmake │ ├── hg │ │ ├── hg_repository_name.cmake │ │ ├── hg_ref.cmake │ │ └── hg_remote_exists.cmake │ └── svn │ │ ├── svn_get_revision.cmake │ │ └── svn_remote_exists.cmake ├── sat │ └── cnf_from_encoded_list.cmake ├── expr │ ├── cmakepp_include.cmake │ ├── lexer │ │ ├── arguments_create_tokens.cmake │ │ └── tokenize.cmake │ ├── expressions │ │ ├── interpret_reference_parameter.cmake │ │ └── interpret_rvalue_dereference.cmake │ ├── cmakepp_eval.cmake │ ├── decode.cmake │ └── expr.cmake ├── navigation │ ├── query │ │ └── query_literals │ │ │ ├── query_literal_lt.cmake │ │ │ ├── query_literal_eq.cmake │ │ │ ├── query_literal_gt.cmake │ │ │ ├── query_literal_strequal.cmake │ │ │ ├── query_literal_match.cmake │ │ │ └── query_literal_bool.cmake │ ├── ref_keys.cmake │ ├── map_navigate_set_if_missing.cmake │ └── ref_prop_set.cmake ├── events │ ├── event_cancel.cmake │ ├── event_handler_call.cmake │ └── event_handler.cmake ├── cmakepp │ └── cmakepp.cmake ├── semver │ ├── semver_higher.cmake │ └── semver_gt.cmake ├── reg │ ├── reg_read_value.cmake │ ├── reg_contains_value.cmake │ └── reg_remove_value.cmake └── handlers │ └── handler_request.cmake ├── samples ├── New Text Document.txt ├── 09-using-real-world-packages │ └── README.md ├── 05-create-install-simple-package-with-install-script │ └── my_package │ │ ├── include │ │ └── my_header.h │ │ └── src │ │ └── my_source.cpp ├── 06-vanilla-cmake-project-with-install │ ├── exporting_project │ │ ├── include │ │ │ └── install_lib.h │ │ └── src │ │ │ └── install_lib.cpp │ └── importing_project │ │ └── main.cpp └── 01-include-cmakepp-pull-eigen │ └── main.cpp ├── logo.png ├── tests ├── shell │ ├── set_env_test.cmake │ ├── sleep_test.cmake │ ├── shell_tests.cmake │ └── invoke_cmake.cmake ├── core │ ├── message_tests.cmake │ ├── beep_test.cmake │ ├── status_line_tests.cmake │ ├── environment_processor_count_test.cmake │ ├── tick_test.cmake │ ├── dec2hex_text.cmake │ └── yield_tests.cmake ├── formats │ └── xml │ │ └── parse_xml.cmake ├── cache │ └── two_level_cache_test.cmake ├── string │ ├── string_take_address_test.cmake │ ├── string_eval_test.cmake │ └── string_encode_decode_brackets_test.cmake ├── compile_cmakepp_test.cmake ├── expr2 │ └── expr_test.cmake ├── process │ ├── process_timeout_test.cmake │ ├── process_list_test.cmake │ ├── process_info_test.cmake │ ├── process_handle_new_test.cmake │ └── win32_powershell_test.cmake ├── function │ ├── wrap_platform_specific_function_test.cmake │ ├── function_define_new_test.cmake │ └── get_function_string_from_string.cmake ├── command_line_handler_test.cmake ├── list │ ├── list_set_at_test.cmake │ ├── list_remove_at_test.cmake │ ├── list_to_string_test.cmake │ ├── list_pad_set_test.cmake │ ├── list_get_labelled_value_test.cmake │ ├── list_without_range_test.cmake │ ├── list_range_try_get_tst.cmake │ ├── list_except_test.cmake │ ├── list_erase_test.cmake │ ├── list_at_test.cmake │ ├── list_find_flags_test.cmake │ ├── list_extract_any_flag_test.cmake │ ├── list_swap_test.cmake │ ├── list_remove_test.cmake │ ├── list_erase_slice_test.cmake │ ├── list_extract_flags_test.cmake │ ├── list_extract_any_labelled_value_test.cmake │ ├── list_get_test.cmake │ ├── list_length_test.cmake │ ├── list_push_front_test.cmake │ ├── set_issubset_test.cmake │ ├── set_isequal_test.cmake │ ├── list_range_indices_test.cmake │ ├── list_extract_flag_test.cmake │ ├── range_simplify_test.cmake │ ├── list_isinorder_test.cmake │ ├── list_max_tests.cmake │ ├── list_where_test.cmake │ ├── list_split_test.cmake │ └── list_count_test.cmake ├── create_cpp_class_test.cmake ├── map │ ├── map_navigate_set_if_missing_test.cmake │ ├── data_test.cmake │ ├── map_performanace.cmake │ ├── m_test.cmake │ ├── map_fill_test.cmake │ ├── map_overwrite.cmake │ ├── obj_tests.cmake │ └── map_unpack_test.cmake ├── task │ ├── task_start_anonymous_test.cmake │ └── global_task_queue_test.cmake ├── semver │ ├── semver_gt_test.cmake │ ├── semver_tests.cmake │ └── semver_higher_tests.cmake ├── unsafe_file_operation_test.cmake ├── filesystem │ ├── uri_format_test.cmake │ ├── path_to_map_test.cmake │ ├── path_parent_dirs_test.cmake │ └── path_vary_test.cmake ├── vcs │ └── git │ │ ├── git_dir_test.cmake │ │ └── git_repository_name_test.cmake ├── task_invoke_later_test.cmake ├── obj │ ├── obj_call.cmake │ ├── obj_new_defaultsto_object.cmake │ └── call_object.cmake └── web │ └── bitbucket_repositories_test.cmake ├── install-bash.sh ├── install-powershell.ps1 ├── package.cmake ├── .gitignore └── recipes └── eigen.json /cmake/core/err.cmake: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cmake/shell/home_path.cmake: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/New Text Document.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cmake/process/process_start_info.cmake: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cmake/web/github/git_repository.cmake: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toeb/cmakepp/HEAD/logo.png -------------------------------------------------------------------------------- /tests/shell/set_env_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/README.md: -------------------------------------------------------------------------------- 1 | # CMake handling functions 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/core/message_tests.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | endfunction() -------------------------------------------------------------------------------- /tests/core/beep_test.cmake: -------------------------------------------------------------------------------- 1 | function(beep_test) 2 | beep() 3 | endfunction() -------------------------------------------------------------------------------- /tests/formats/xml/parse_xml.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | endfunction() -------------------------------------------------------------------------------- /tests/cache/two_level_cache_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/README.md.in: -------------------------------------------------------------------------------- 1 | # CMake handling functions 2 | 3 | 4 | <% 5 | %> 6 | 7 | -------------------------------------------------------------------------------- /cmake/log/warning.cmake: -------------------------------------------------------------------------------- 1 | function(warning ${ARGN}) 2 | return_ans() 3 | endfunction() -------------------------------------------------------------------------------- /tests/core/status_line_tests.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | 5 | 6 | 7 | endfunction() -------------------------------------------------------------------------------- /cmake/core/return/return_reset.cmake: -------------------------------------------------------------------------------- 1 | macro(return_reset) 2 | set(__ans PARENT_SCOPE) 3 | endmacro() -------------------------------------------------------------------------------- /cmake/core/yield_return.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(yield_return) 3 | return(${__yield_tmp}) 4 | endmacro() -------------------------------------------------------------------------------- /tests/string/string_take_address_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | # TODO write tests 3 | endfunction() -------------------------------------------------------------------------------- /cmake/filesystem/file_isjsonfile.cmake: -------------------------------------------------------------------------------- 1 | function(file_isjsonfile file) 2 | return(false) 3 | endfunction() -------------------------------------------------------------------------------- /cmake/quickmap/kv.cmake: -------------------------------------------------------------------------------- 1 | function(kv key) 2 | key("${key}") 3 | val(${ARGN}) 4 | endfunction() 5 | 6 | -------------------------------------------------------------------------------- /cmake/shell/shell_env_prepend.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(shell_env_prepend key value) 4 | 5 | endfunction() -------------------------------------------------------------------------------- /cmake/core/beep.cmake: -------------------------------------------------------------------------------- 1 | function(beep) 2 | string(ASCII 7 beep) 3 | echo_append("${beep}") 4 | endfunction() -------------------------------------------------------------------------------- /cmake/core/yield_begin.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(yield_begin) 3 | set(__yield_tmp PARENT_SCOPE) 4 | endfunction() -------------------------------------------------------------------------------- /cmake/object/core/obj_delete.cmake: -------------------------------------------------------------------------------- 1 | function(obj_delete this) 2 | map_delete(${this}) 3 | endfunction() 4 | 5 | -------------------------------------------------------------------------------- /samples/09-using-real-world-packages/README.md: -------------------------------------------------------------------------------- 1 | # Working with Packages 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cmake/core/pkg.cmake: -------------------------------------------------------------------------------- 1 | function(pkg) 2 | cmakepp_project_cli(${ARGN}) 3 | return_ans() 4 | endfunction() 5 | 6 | 7 | -------------------------------------------------------------------------------- /cmake/core/return_data.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(return_data data) 3 | data("${data}") 4 | return_ans() 5 | endmacro() -------------------------------------------------------------------------------- /cmake/package/scaffold.cmake: -------------------------------------------------------------------------------- 1 | function(scaffold) 2 | 3 | message(INFO "not implemented") 4 | 5 | 6 | endfunction() -------------------------------------------------------------------------------- /cmake/type/t_path.cmake: -------------------------------------------------------------------------------- 1 | function(t_path) 2 | path("${ARGN}") 3 | ans(res) 4 | return(true ${res}) 5 | endfunction() -------------------------------------------------------------------------------- /tests/shell/sleep_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | message("a") 4 | sleep(3) 5 | message("b") 6 | endfunction() -------------------------------------------------------------------------------- /cmake/core/return_nav.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(return_nav) 3 | assign(result = ${ARGN}) 4 | return_ref(result) 5 | endmacro() -------------------------------------------------------------------------------- /cmake/filesystem/archive/tar_lean.cmake: -------------------------------------------------------------------------------- 1 | function(tar_lean) 2 | cmake_lean(-E tar ${ARGN}) 3 | return_ans() 4 | endfunction() -------------------------------------------------------------------------------- /cmake/object/this/this_capture.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(this_capture) 3 | obj_capture(${this} ${ARGN}) 4 | endmacro() 5 | 6 | -------------------------------------------------------------------------------- /cmake/package/project/project_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toeb/cmakepp/HEAD/cmake/package/project/project_close.png -------------------------------------------------------------------------------- /cmake/package/project/project_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toeb/cmakepp/HEAD/cmake/package/project/project_open.png -------------------------------------------------------------------------------- /cmake/ref/address_delete.cmake: -------------------------------------------------------------------------------- 1 | function(address_delete ref) 2 | set_property(GLOBAL PROPERTY "${ref}") 3 | endfunction() 4 | -------------------------------------------------------------------------------- /cmake/ref/address_print.cmake: -------------------------------------------------------------------------------- 1 | function(address_print ref) 2 | address_get("${ref}") 3 | _message("${ref}") 4 | endfunction() -------------------------------------------------------------------------------- /cmake/core/return/set_ans.cmake: -------------------------------------------------------------------------------- 1 | function(set_ans ) 2 | set(__set_ans_val ${ARGN}) 3 | return_ref(__set_ans_val) 4 | endfunction() -------------------------------------------------------------------------------- /cmake/ref/address_set.cmake: -------------------------------------------------------------------------------- 1 | function(address_set ref) 2 | set_property(GLOBAL PROPERTY "${ref}" "${ARGN}") 3 | endfunction() 4 | -------------------------------------------------------------------------------- /cmake/core/return/set_ans_ref.cmake: -------------------------------------------------------------------------------- 1 | function(set_ans_ref __set_ans_ref_ref) 2 | return_ref("${__set_ans_ref_ref}") 3 | 4 | endfunction() -------------------------------------------------------------------------------- /cmake/listings/listing.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(listing) 3 | address_new() 4 | return_ans() 5 | endfunction() 6 | 7 | 8 | -------------------------------------------------------------------------------- /cmake/package/project/dependency_graph_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toeb/cmakepp/HEAD/cmake/package/project/dependency_graph_1.png -------------------------------------------------------------------------------- /cmake/package/project/project_lifecycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toeb/cmakepp/HEAD/cmake/package/project/project_lifecycle.png -------------------------------------------------------------------------------- /cmake/ref/address_append.cmake: -------------------------------------------------------------------------------- 1 | function(address_append ref) 2 | set_property( GLOBAL APPEND PROPERTY "${ref}" "${ARGN}") 3 | endfunction() -------------------------------------------------------------------------------- /cmake/sequence/sequence_get.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | macro(sequence_get map idx) 4 | map_tryget("${map}" "${idx}") 5 | endmacro() 6 | -------------------------------------------------------------------------------- /cmake/formats/json/json_print.cmake: -------------------------------------------------------------------------------- 1 | function(json_print) 2 | json_indented(${ARGN}) 3 | ans(res) 4 | _message("${res}") 5 | endfunction() -------------------------------------------------------------------------------- /cmake/map/helpers/map_keys_clear.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(map_keys_clear map) 3 | set_property(GLOBAL PROPERTY "${map}.__keys__") 4 | endfunction() -------------------------------------------------------------------------------- /cmake/object/this/this_get.cmake: -------------------------------------------------------------------------------- 1 | macro(this_get member_name) 2 | obj_get("${this}" "${member_name}") 3 | ans("${member_name}") 4 | endmacro() -------------------------------------------------------------------------------- /cmake/object/this/this_setprototype.cmake: -------------------------------------------------------------------------------- 1 | function(this_setprototype proto_ref) 2 | obj_setprototype(${this} ${proto_ref}) 3 | endfunction() -------------------------------------------------------------------------------- /cmake/sequence/sequence_count.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | macro(sequence_count map) 4 | map_get_special("${map}" count) 5 | endmacro() 6 | -------------------------------------------------------------------------------- /cmake/type/helplist.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(helplist) 3 | parameter_definition_list() 4 | ans(keys) 5 | return_ref(keys) 6 | endfunction() -------------------------------------------------------------------------------- /tests/compile_cmakepp_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | cmakepp_compile("${test_dir}/cmakepp_compile_result.cmake") 4 | 5 | endfunction() -------------------------------------------------------------------------------- /tests/shell/shell_tests.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | shell("echo hello") 3 | ans(res) 4 | assert("${res}" MATCHES "hello") 5 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/ast_parse_end_of_stream.cmake: -------------------------------------------------------------------------------- 1 | function(ast_parse_end_of_stream) 2 | token_stream_isempty(${stream}) 3 | return_ans() 4 | endfunction() -------------------------------------------------------------------------------- /cmake/core/return/return_truth.cmake: -------------------------------------------------------------------------------- 1 | macro(return_truth) 2 | if(${ARGN}) 3 | return(true) 4 | endif() 5 | return(false) 6 | endmacro() 7 | -------------------------------------------------------------------------------- /cmake/listings/listing_line.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(line line) 4 | listing_append("${__listing_current}" "${line}") 5 | endfunction() 6 | -------------------------------------------------------------------------------- /cmake/map/helpers/map_keys_set.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(map_keys_set map) 3 | set_property(GLOBAL PROPERTY "${map}.__keys__" ${ARGN}) 4 | endfunction() -------------------------------------------------------------------------------- /cmake/process/linux/nohup.cmake: -------------------------------------------------------------------------------- 1 | function(nohup) 2 | wrap_executable(nohup nohup) 3 | nohup(${ARGN}) 4 | return_ans() 5 | endfunction() -------------------------------------------------------------------------------- /cmake/sequence/sequence_index_isvalid.cmake: -------------------------------------------------------------------------------- 1 | macro(sequence_index_isvalid map idx) 2 | map_has("${map}" "${idx}") 3 | endmacro() 4 | -------------------------------------------------------------------------------- /cmake/task/tqr.cmake: -------------------------------------------------------------------------------- 1 | function(tqr) 2 | task_queue_global() 3 | ans(task_queue) 4 | task_queue_run("${task_queue}" ${ARGN}) 5 | endfunction() -------------------------------------------------------------------------------- /tests/expr2/expr_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | expr(a) 4 | ans(res) 5 | assert("${res}" STREQUAL a) 6 | 7 | 8 | 9 | endfunction() -------------------------------------------------------------------------------- /cmake/formats/csv/csv_serialize.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(csv_serialize ) 4 | set(args ${ARGN}) 5 | message(FATAL_ERROR) 6 | 7 | endfunction() -------------------------------------------------------------------------------- /cmake/listings/listing_end_compile.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | macro(listing_end_compile) 4 | listing_end() 5 | listing_compile("${__ans}") 6 | endmacro() -------------------------------------------------------------------------------- /cmake/map/helpers/map_keys_append.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(map_keys_append map) 3 | set_property(GLOBAL APPEND PROPERTY "${map}" ${ARGN}) 4 | endfunction() -------------------------------------------------------------------------------- /cmake/object/this/this_import.cmake: -------------------------------------------------------------------------------- 1 | # imports all variables specified as varargs 2 | macro(this_import) 3 | obj_import("${this}" ${ARGN}) 4 | endmacro() -------------------------------------------------------------------------------- /cmake/templating/helpers/markdown_link.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(markdown_link id name) 3 | ## get link 4 | return("[${name}](#${id})") 5 | endfunction() -------------------------------------------------------------------------------- /tests/process/process_timeout_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | process_timeout(3) 4 | ans(res) 5 | 6 | process_wait(${res}) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/expr/expr_eval_identifier.cmake: -------------------------------------------------------------------------------- 1 | function(expr_eval_identifier)# ast scope 2 | message("identifier") 3 | address_print(${ast}) 4 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/environment/os_families.cmake: -------------------------------------------------------------------------------- 1 | ## returns all known host systems 2 | function(os_families) 3 | return(Windows Unix OSX) 4 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/targets/target_list.cmake: -------------------------------------------------------------------------------- 1 | 2 | # returns all known target names 3 | macro(target_list) 4 | map_tryget(global target_names) 5 | endmacro() 6 | -------------------------------------------------------------------------------- /cmake/core/print.cmake: -------------------------------------------------------------------------------- 1 | ## prints str to console without reformatting it and no message type 2 | function(print str) 3 | _message("${str}") 4 | endfunction() -------------------------------------------------------------------------------- /cmake/map/core/map_set_hidden.cmake: -------------------------------------------------------------------------------- 1 | function(map_set_hidden map property) 2 | set_property(GLOBAL PROPERTY "${map}.${property}" ${ARGN}) 3 | endfunction() -------------------------------------------------------------------------------- /cmake/process/process_handle_get.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(process_handle_get pid) 3 | map_tryget(__process_handles ${pid}) 4 | return_ans() 5 | endfunction() -------------------------------------------------------------------------------- /cmake/regex/regex_all.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(regex_all regex) 3 | string(REGEX MATCHALL "${regex}" ans ${ARGN}) 4 | return_ref(ans) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/regex/regex_match.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(regex_match regex) 3 | string(REGEX MATCH "${regex}" ans ${ARGN}) 4 | return_ref(ans) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/shell/echo.cmake: -------------------------------------------------------------------------------- 1 | # writes the args to the console 2 | function(echo) 3 | execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${ARGN}") 4 | endfunction() -------------------------------------------------------------------------------- /cmake/type/parameter_definition_list.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(parameter_definition_list) 3 | map_keys(__global_definitions) 4 | return_ans() 5 | endfunction() -------------------------------------------------------------------------------- /samples/05-create-install-simple-package-with-install-script/my_package/include/my_header.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace mylib{ 3 | int add(int a, int b); 4 | } -------------------------------------------------------------------------------- /tests/function/wrap_platform_specific_function_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | function(environment) 4 | 5 | endfunction() 6 | 7 | endfunction() 8 | -------------------------------------------------------------------------------- /cmake/collections/encoded_list/encoded_list_remove_at.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(encoded_list_remove_at __lst) 3 | list_remove_at(${__lst} ${ARGN}) 4 | endmacro() -------------------------------------------------------------------------------- /cmake/formats/quick_map/qm_print.cmake: -------------------------------------------------------------------------------- 1 | function(qm_print) 2 | qm_serialize(${ARGN}) 3 | ans(res) 4 | 5 | message("${res}") 6 | return() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/object/this/property.cmake: -------------------------------------------------------------------------------- 1 | ## shorthand for obj_declare_property 2 | ## 3 | macro(property) 4 | obj_declare_property(${this} ${ARGN}) 5 | endmacro() 6 | -------------------------------------------------------------------------------- /cmake/ref/address_append_string.cmake: -------------------------------------------------------------------------------- 1 | function(address_append_string ref str) 2 | set_property(GLOBAL APPEND_STRING PROPERTY "${ref}" "${str}") 3 | endfunction() -------------------------------------------------------------------------------- /cmake/timer/timer_delete.cmake: -------------------------------------------------------------------------------- 1 | ## removes the specified timer 2 | function(timer_delete id) 3 | map_remove(__timers "${id}") 4 | return() 5 | endfunction() 6 | -------------------------------------------------------------------------------- /cmake/type/prompt_property.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(prompt_property prop) 4 | query_property(prompt_input "${prop}") 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /tests/core/environment_processor_count_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | environment_processor_count() 3 | ans(res) 4 | assert(NOT ${res} LESS 1) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/expr/expr_eval_string.cmake: -------------------------------------------------------------------------------- 1 | function(expr_eval_string) # scope, ast 2 | map_tryget(${ast} data) 3 | ans(data) 4 | return_ref(data) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/core/yield.cmake: -------------------------------------------------------------------------------- 1 | #adds a values to parent_scopes __ans 2 | function(yield) 3 | set(__yield_tmp ${__yield_tmp} ${ARGN} PARENT_SCOPE) 4 | 5 | endfunction() -------------------------------------------------------------------------------- /cmake/filesystem/file/fappend.cmake: -------------------------------------------------------------------------------- 1 | function(fappend path) 2 | path("${path}") 3 | ans(path) 4 | file(APPEND "${path}" ${ARGN}) 5 | return() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/filesystem/file/map_source_file_get.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(map_source_file_get) 3 | map_tryget("${ARGN}" $map_source_file) 4 | return_ans() 5 | endfunction() 6 | -------------------------------------------------------------------------------- /cmake/formats/cmake/cmake_read.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(cmake_read path) 3 | path_qualify(path) 4 | cmake_deserialize_file("${path}") 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/map/evaluate/map_conditional_switch.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(map_conditional_switch parameters) 4 | message("switch") 5 | return() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/process/linux/bash_lean.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(bash_lean) 3 | wrap_executable_bare(bash_lean bash) 4 | bash_lean(${ARGN}) 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/propref/propref_get_ref.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(propref_get_ref) 3 | string_split_at_last(ref prop "${propref}" ".") 4 | return_ref(ref) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/ref/address_set_new.cmake: -------------------------------------------------------------------------------- 1 | function(address_set_new) 2 | address_new() 3 | ans(res) 4 | address_set(${res} "${ARGN}") 5 | return(${res}) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/session/session.cmake: -------------------------------------------------------------------------------- 1 | function(session) 2 | 3 | 4 | ## maybe later some kind of session which restores values between cmakepp runs 5 | 6 | endfunction() -------------------------------------------------------------------------------- /install-bash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | wget https://raw.github.com/toeb/cmakepp/${TRAVIS_COMMIT}/install.cmake && cmake -P install.cmake && rm install.cmake && source ~/.bashrc -------------------------------------------------------------------------------- /samples/06-vanilla-cmake-project-with-install/exporting_project/include/install_lib.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace install_lib{ 5 | int add(int a, int b); 6 | } -------------------------------------------------------------------------------- /cmake/ast/json/ast_json_eval_null.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(ast_json_eval_null )#ast scope 3 | map_get(${ast} data) 4 | ans(data) 5 | return() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/core/math_min.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(math_min a b) 3 | if(${a} LESS ${b}) 4 | return(${a}) 5 | else() 6 | return(${b}) 7 | endif() 8 | endfunction() -------------------------------------------------------------------------------- /cmake/core/return/return_math.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(return_math expr) 3 | math(EXPR __return_math_res "${expr}") 4 | return(${__return_math_res}) 5 | endmacro() 6 | -------------------------------------------------------------------------------- /cmake/function/invocation_argument_string.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(invocation_argument_string) 4 | arguments_string(0 ${ARGC}) 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/function/save_function.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(save_function file_name function_string) 4 | 5 | file(WRITE "${file_name}" "${function_string}") 6 | endfunction() -------------------------------------------------------------------------------- /cmake/object/this/this_callmember.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(this_callmember function) 3 | obj_member_call("${this}" "${function}" ${ARGN}) 4 | return_ans() 5 | endfunction() -------------------------------------------------------------------------------- /cmake/string/string_concat.cmake: -------------------------------------------------------------------------------- 1 | function(string_concat) 2 | #string(CONCAT ans ${ARGN}) 3 | string(REPLACE ";" "" ans "${ARGN}") 4 | return_ref(ans) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/templating/helpers/markdown_section.cmake: -------------------------------------------------------------------------------- 1 | function(markdown_section id name) 2 | return("## ${name}") 3 | endfunction() 4 | 5 | 6 | -------------------------------------------------------------------------------- /cmake/type/prompt_input.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(prompt_input) 3 | echo_append("> ") 4 | read_line() 5 | ans(res) 6 | return_ref(res) 7 | endfunction() 8 | -------------------------------------------------------------------------------- /tests/command_line_handler_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | new(command_line_handler mycommandrunner) 5 | ans(uut) 6 | 7 | 8 | 9 | 10 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_set_at_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | set(lstA a b c d e f g) 4 | list_set_at(lstA 3 k) 5 | assert(${lstA} EQUALS a b c k e f g) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/targets/overrides/add_dependencies.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(add_dependencies) 3 | _add_dependencies(${ARGN}) 4 | event_emit(add_dependencies ${ARGN}) 5 | 6 | endmacro() -------------------------------------------------------------------------------- /cmake/core/return/ans_append.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## appends the last return value to the specified list 4 | macro(ans_append __lst) 5 | list(APPEND ${__lst} ${__ans}) 6 | endmacro() -------------------------------------------------------------------------------- /cmake/function/function_string_import.cmake: -------------------------------------------------------------------------------- 1 | function(function_string_import function_string) 2 | set_ans("") 3 | eval("${function_string}") 4 | return() 5 | endfunction() -------------------------------------------------------------------------------- /cmake/function/invocation_arguments_sequence.cmake: -------------------------------------------------------------------------------- 1 | function(invocation_arguments_sequence) 2 | arguments_sequence(0 ${ARGC}) 3 | return_ans() 4 | endfunction() 5 | -------------------------------------------------------------------------------- /cmake/listings/listing_begin.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(listing_begin) 4 | listing() 5 | ans(lst) 6 | set(__listing_current "${lst}" PARENT_SCOPE) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/process/linux/linux_ps_lean.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(linux_ps_lean) 3 | wrap_executable_bare(linux_ps_lean ps) 4 | linux_ps_lean(${ARGN}) 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/string/ascii_code.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(ascii_code char) 3 | generate_ascii_table() 4 | map_tryget(ascii_table "'${char}'") 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/string/string_to_target_name.cmake: -------------------------------------------------------------------------------- 1 | function(string_to_target_name str) 2 | string(REGEX REPLACE " \\-\\\\\\/" "_" str "${str}") 3 | return_ref(str) 4 | endfunction() -------------------------------------------------------------------------------- /cmake/testing/assertf.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(assertf) 4 | set(args ${ARGN}) 5 | list_extract_flag(args DEREF) 6 | assert(${args} DEREF) 7 | return() 8 | endfunction() -------------------------------------------------------------------------------- /cmake/type/t_bool.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(t_bool) 3 | if(ARGN) 4 | return(true true) 5 | else() 6 | return(true false) 7 | endif() 8 | endfunction() -------------------------------------------------------------------------------- /tests/process/process_list_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | process_list() 4 | ans(res) 5 | list(LENGTH res len) 6 | assert(NOT ${len} LESS 1) 7 | 8 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/json/ast_json_eval_number.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(ast_json_eval_number )#ast scope 3 | map_get(${ast} data) 4 | ans(data) 5 | return_ref(data) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/json/ast_json_eval_string.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(ast_json_eval_string )#ast scope 3 | map_get(${ast} data) 4 | ans(data) 5 | return_ref(data) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/token_stream_commit.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(token_stream_commit stream) 3 | map_get(${stream} stack) 4 | ans(stack) 5 | stack_pop(${stack}) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/cache/cache_clear.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(cache_clear cache_key) 4 | memory_cache_clear("${cache_key}") 5 | file_cache_clear("${cache_key}") 6 | 7 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/targets/overrides/include_directories.cmake: -------------------------------------------------------------------------------- 1 | macro(include_directories) 2 | _include_directories(${ARGN}) 3 | event_emit(include_directories "${ARGN}") 4 | endmacro() -------------------------------------------------------------------------------- /cmake/process/process_handle_register.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(process_handle_register process_handle) 3 | event_emit(on_process_handle_created ${process_handle}) 4 | endfunction() 5 | -------------------------------------------------------------------------------- /cmake/propref/propref_get_key.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(propref_get_key) 3 | string_split_at_last(ref prop "${propref}" ".") 4 | return_ref(prop) 5 | endfunction() 6 | 7 | -------------------------------------------------------------------------------- /cmake/timer/timers_get.cmake: -------------------------------------------------------------------------------- 1 | ## returns the list of known timers 2 | function(timers_get) 3 | map_keys(__timers) 4 | ans(timers) 5 | return_ref(timers) 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/type/t_int.cmake: -------------------------------------------------------------------------------- 1 | function(t_int) 2 | if("${ARGN}" MATCHES "-?(0|([1-9][0-9]*))") 3 | return(true ${ARGN}) 4 | else() 5 | return(false) 6 | endif() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/json/ast_json_eval_boolean.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(ast_json_eval_boolean )#ast scope 3 | map_get(${ast} data) 4 | ans(data) 5 | return_ref(data) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/collections/list_length.cmake: -------------------------------------------------------------------------------- 1 | ## returns the length of the specified list 2 | macro(list_length __list_count_lst) 3 | list(LENGTH "${__list_count_lst}" __ans) 4 | endmacro() 5 | -------------------------------------------------------------------------------- /cmake/core/echo_append_padded.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(echo_append_padded len str) 3 | string_pad("${str}" "${len}" " ") 4 | ans(str) 5 | echo_append("${str}") 6 | endfunction() -------------------------------------------------------------------------------- /cmake/core/eval_math.cmake: -------------------------------------------------------------------------------- 1 | # evaluates a cmake math expression and returns its 2 | # value 3 | function(eval_math) 4 | math(EXPR res ${ARGN}) 5 | return_ref(res) 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/core/global_config.cmake: -------------------------------------------------------------------------------- 1 | function(global_config key) 2 | map_get(global "${key}") 3 | ans(res) 4 | set("${key}" "${res}" PARENT_SCOPE) 5 | return_ref(res) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/core/message_indent_get.cmake: -------------------------------------------------------------------------------- 1 | function(message_indent_get) 2 | message_indent_level() 3 | ans(level) 4 | string_repeat(" " ${level}) 5 | return_ans() 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/function/invocation_argument_encoded_list.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(invocation_argument_encoded_list) 3 | arguments_encoded_list(0 ${ARGC}) 4 | return_ans() 5 | endfunction() -------------------------------------------------------------------------------- /cmake/listings/listing_end.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(listing_end) 3 | set(lst ${__listing_current}) 4 | set(__listing_current PARENT_SCOPE) 5 | return_ref(lst) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/listings/listing_include.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(listing_include listing) 3 | listing_compile("${listing}") 4 | eval("${__ans}") 5 | return_ans() 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/object/helpers/obj_getprototype.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(obj_getprototype obj) 3 | map_get_special("${obj}" prototype) 4 | ans(res) 5 | return_ref(res) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/object/helpers/obj_setprototype.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(obj_setprototype obj prototype) 3 | map_set_special("${obj}" prototype "${prototype}") 4 | return() 5 | endfunction() -------------------------------------------------------------------------------- /cmake/persistence/file_data/file_data_path.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function(file_data_path dir id) 5 | path("${dir}/${id}.cmake") 6 | ans(path) 7 | return_ref(path) 8 | endfunction() -------------------------------------------------------------------------------- /cmake/process/linux/bash.cmake: -------------------------------------------------------------------------------- 1 | # wraps the bash executable in cmake 2 | function(bash) 3 | wrap_executable(bash bash) 4 | bash(${ARGN}) 5 | return_ans() 6 | endfunction() 7 | 8 | -------------------------------------------------------------------------------- /cmake/regex/regex_replace.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(regex_replace regex replace) 3 | string(REGEX REPLACE "${regex}" "${replace}" ans ${ARGN}) 4 | return_ref(ans) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/type/parameter_definition_get.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(parameter_definition_get name) 4 | map_tryget(__global_definitions "${name}") 5 | return_ans() 6 | endfunction() 7 | 8 | -------------------------------------------------------------------------------- /cmake/type/prompt.cmake: -------------------------------------------------------------------------------- 1 | ## prompts the user for input on the console 2 | function(prompt type) 3 | 4 | 5 | query_type(prompt_input "${type}") 6 | return_ans() 7 | endfunction() 8 | -------------------------------------------------------------------------------- /cmake/type/t_semver.cmake: -------------------------------------------------------------------------------- 1 | function(t_semver) 2 | semver("${ARGN}") 3 | ans(res) 4 | if(NOT res) 5 | return(false) 6 | endif() 7 | 8 | return(true ${res}) 9 | endfunction() -------------------------------------------------------------------------------- /samples/05-create-install-simple-package-with-install-script/my_package/src/my_source.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | namespace mylib{ 3 | int add(int a, int b){ 4 | return a+b; 5 | } 6 | } -------------------------------------------------------------------------------- /tests/create_cpp_class_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | cpp_class_header_generate("{namespace:'a::b::c', type_name:'MyClass'}") 5 | ans(res) 6 | 7 | 8 | 9 | endfunction() -------------------------------------------------------------------------------- /cmake/core/message_indent.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(message_indent msg) 4 | message_indent_get() 5 | ans(indent) 6 | _message("${indent}${msg}") 7 | endfunction() 8 | 9 | -------------------------------------------------------------------------------- /cmake/core/status_line.cmake: -------------------------------------------------------------------------------- 1 | function(status_line) 2 | map_set(global status "${ARGN}") 3 | string_pad("${ARGN}" 100) 4 | ans(str) 5 | echo_append("\r${str}\r") 6 | endfunction() -------------------------------------------------------------------------------- /cmake/core/tock.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(tock) 3 | map_tryget(globaltick val) 4 | ans(res) 5 | if(res) 6 | _message("") 7 | map_set(globaltick val false) 8 | endif() 9 | endfunction() -------------------------------------------------------------------------------- /cmake/debugging/print_var.cmake: -------------------------------------------------------------------------------- 1 | 2 | # prints the variables name and value as a STATUS message 3 | macro(print_var varname) 4 | message(STATUS "${varname}: ${${varname}}") 5 | endmacro() 6 | -------------------------------------------------------------------------------- /cmake/filesystem/navigation/pwd.cmake: -------------------------------------------------------------------------------- 1 | # returns the current working directory 2 | function(pwd) 3 | address_get(__global_cd_current_directory) 4 | return_ans() 5 | endfunction() 6 | -------------------------------------------------------------------------------- /cmake/map/core/map_delete.cmake: -------------------------------------------------------------------------------- 1 | function(map_delete this) 2 | map_keys("${this}") 3 | ans(keys) 4 | foreach(key ${keys}) 5 | map_remove("${this}" ${key}) 6 | endforeach() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/map/helpers/map_peek_back.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(map_peek_back map prop) 3 | map_tryget("${map}" "${prop}") 4 | ans(lst) 5 | list_peek_back(lst) 6 | return_ans() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/map/helpers/map_peek_front.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(map_peek_front map prop) 3 | map_tryget("${map}" "${prop}") 4 | ans(lst) 5 | list_peek_front(lst) 6 | return_ans() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/task/task_start.cmake: -------------------------------------------------------------------------------- 1 | function(task_start task) 2 | task_queue_global() 3 | ans(task_queue) 4 | task_queue_push("${task_queue}" "${task}") 5 | return() 6 | endfunction() 7 | 8 | -------------------------------------------------------------------------------- /cmake/templating/template_run_scoped.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(template_run_scoped scope) 3 | map_import_properties_all("${scope}") 4 | template_run("${ARGN}") 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_remove_at_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | set(lstA a b c d e f g) 4 | 5 | list_remove_at(lstA 6 1 3 ) 6 | assert(${lstA} EQUALS a c e f) 7 | 8 | 9 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_to_string_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | 5 | set(lstA a b c) 6 | list_to_string(lstA " ") 7 | ans(res) 8 | assert("${res}" STREQUAL "a b c") 9 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/ast_eval_literal.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function(ast_eval_literal ast scope) 5 | map_get(${ast} literal data) 6 | ans(literal) 7 | return_ref(literal) 8 | endfunction() 9 | -------------------------------------------------------------------------------- /cmake/cache/file_cache_clear_all.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(file_cache_clear_all) 3 | cmakepp_config(temp_dir) 4 | ans(temp_dir) 5 | file(REMOVE_RECURSE "${temp_dir}/file_cache") 6 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/targets/target_set.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(target_set tgt_name key) 3 | set_property( 4 | TARGET "${tgt_name}" 5 | PROPERTY "${key}" 6 | ${ARGN} 7 | ) 8 | return() 9 | endfunction() -------------------------------------------------------------------------------- /cmake/function/is_function_cmake.cmake: -------------------------------------------------------------------------------- 1 | function(is_function_cmake result name) 2 | if(COMMAND "${name}") 3 | return_value(true) 4 | else() 5 | return_value(false) 6 | endif() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/indent_level/indent.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(indent str) 4 | indent_get(${ARGN}) 5 | ans(indent) 6 | set(str "${indent}${str}") 7 | return_ref(str) 8 | endfunction() 9 | -------------------------------------------------------------------------------- /cmake/indent_level/indent_level_pop.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(indent_level_pop) 3 | map_pop_back(global __indentlevelstack) 4 | indent_level_current() 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/object/this/this_declarefunction.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(this_declarefunction result) 3 | this_check() 4 | obj_declarefunction(${this} ${result}) 5 | return_value(${${result}}) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/platform/windows/cmd/win32_cmd_lean.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(win32_cmd_lean) 3 | wrap_executable_bare(win32_cmd_lean cmd.exe) 4 | win32_cmd_lean(${ARGN}) 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/quickmap/var.cmake: -------------------------------------------------------------------------------- 1 | 2 | ## captures a list of variable as a key value pair 3 | function(var) 4 | foreach(var ${ARGN}) 5 | kv("${var}" "${${var}}") 6 | endforeach() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/scope/scope_print.cmake: -------------------------------------------------------------------------------- 1 | # print the local scope as json 2 | function(scope_print) 3 | scope_export_map() 4 | ans(scope) 5 | json_print(${scope}) 6 | return() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/shell/alias_exists.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(alias_exists name) 3 | alias_list() 4 | ans(aliases) 5 | list_contains(aliases "${name}") 6 | ans(res) 7 | return_ref(res) 8 | endfunction() -------------------------------------------------------------------------------- /cmake/stack/stack_peek.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(stack_peek stack) 3 | map_tryget("${stack}" back) 4 | ans(back) 5 | map_tryget("${stack}" "${back}") 6 | return_ans() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/uri/uri_coerce.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## forces the specified variable reference to become an uri 3 | macro(uri_coerce __uri_ref) 4 | uri("${${__uri_ref}}") 5 | ans("${__uri_ref}") 6 | endmacro() -------------------------------------------------------------------------------- /cmake/vcs/git/git_repository_name.cmake: -------------------------------------------------------------------------------- 1 | function(git_repository_name repository_uri) 2 | get_filename_component(repo_name "${repository_uri}" NAME_WE) 3 | return("${repo_name}") 4 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_pad_set_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | 5 | list_pad_set(testList "1;4;5;10" "$" "a") 6 | assert(${testList} EQUALS $ a $ $ a a $ $ $ $ a) 7 | 8 | 9 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/targets/overrides/target_compile_options.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(target_compile_options) 3 | _target_compile_options(${ARGN}) 4 | event_emit(target_compile_options ${ARGN}) 5 | 6 | endmacro() -------------------------------------------------------------------------------- /cmake/core/echo_append_indent.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(echo_append_indent) 3 | message_indent_get() 4 | ans(indent) 5 | 6 | echo_append("${indent} ${ARGN}") 7 | return() 8 | endfunction() -------------------------------------------------------------------------------- /cmake/process/linux/linux_ps.cmake: -------------------------------------------------------------------------------- 1 | # wraps the linux ps command into an executable 2 | function(linux_ps) 3 | wrap_executable(linux_ps ps) 4 | linux_ps(${ARGN}) 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/ref/address_peek_back.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(address_peek_back ref) 3 | address_get(${ref}) 4 | ans(value) 5 | list_peek_back(value ${ARGN}) 6 | ans(res) 7 | return_ref(res) 8 | endfunction() -------------------------------------------------------------------------------- /cmake/sat/cnf_from_encoded_list.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(cnf_from_encoded_list) 3 | arguments_sequence(0 ${ARGC}) 4 | ans(clauses) 5 | cnf("${clauses}") 6 | return_ans() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/shell/echo_append.cmake: -------------------------------------------------------------------------------- 1 | # writes the args to console. does not append newline 2 | function(echo_append) 3 | execute_process(COMMAND ${CMAKE_COMMAND} -E echo_append "${ARGN}") 4 | endfunction() -------------------------------------------------------------------------------- /cmake/type/t_map.cmake: -------------------------------------------------------------------------------- 1 | function(t_map) 2 | obj("${ARGN}") 3 | ans(map) 4 | if(NOT map) 5 | return(false) 6 | endif() 7 | return(true ${map}) 8 | endfunction() 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /cmake/vcs/hg/hg_repository_name.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(hg_repository_name repository_uri) 3 | get_filename_component(repo_name "${repository_uri}" NAME_WE) 4 | return("${repo_name}") 5 | endfunction() -------------------------------------------------------------------------------- /samples/06-vanilla-cmake-project-with-install/exporting_project/src/install_lib.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace install_lib{ 4 | int add(int a, int b){ 5 | return a+b; 6 | } 7 | } -------------------------------------------------------------------------------- /cmake/collections/encoded_list/encoded_list_get.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | macro(encoded_list_get __lst idx) 5 | list(GET ${__lst} ${idx} __ans) 6 | string_decode_list("${__ans}") 7 | endmacro() 8 | -------------------------------------------------------------------------------- /cmake/collections/linked_list/linked_list_push_front.cmake: -------------------------------------------------------------------------------- 1 | function(linked_list_push_front linked_list) 2 | linked_list_insert_before("${linked_list}" "" ${ARGN}) 3 | return_ans() 4 | endfunction() 5 | -------------------------------------------------------------------------------- /cmake/collections/range/is_range.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## 3 | ## 4 | function(is_range) 5 | if("_${ARGN}_" MATCHES "^_[0-9:\\$,\\-]*_$") 6 | return(true) 7 | endif() 8 | return(false) 9 | endfunction() -------------------------------------------------------------------------------- /cmake/core/cmake/_cmake.cmake: -------------------------------------------------------------------------------- 1 | 2 | ## fast wrapper for cmake 3 | function(cmake_lean) 4 | wrap_executable_bare(cmake_lean "${CMAKE_COMMAND}") 5 | cmake_lean(${ARGN}) 6 | return_ans() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/core/cmake/cmake.cmake: -------------------------------------------------------------------------------- 1 | 2 | ## convenience function for accessing cmake 3 | function(cmake) 4 | wrap_executable(cmake "${CMAKE_COMMAND}") 5 | cmake(${ARGN}) 6 | return_ans() 7 | endfunction() 8 | -------------------------------------------------------------------------------- /cmake/core/eval_truth.cmake: -------------------------------------------------------------------------------- 1 | # evaluates a truth expression 'if' and returns true or false 2 | function(eval_truth) 3 | if(${ARGN}) 4 | return(true) 5 | endif() 6 | return(false) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/formats/cmake/cmake_write.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(cmake_write path ) 3 | cmake_serialize(${ARGN}) 4 | ans(serialized) 5 | fwrite("${path}" "${serialized}") 6 | return_ans() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/function/load_function.cmake: -------------------------------------------------------------------------------- 1 | # reads a functions and returns it 2 | function(load_function result file_name) 3 | file(READ ${file_name} func) 4 | set(${result} ${func} PARENT_SCOPE) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/listings/listing_append_lines.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(listing_append_lines listing) 4 | foreach(line ${ARGN}) 5 | listing_append(${listing} "${line}") 6 | endforeach() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/ref/address_peek_front.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(address_peek_front ref) 3 | address_get(${ref}) 4 | ans(value) 5 | list_peek_front(value ${ARGN}) 6 | ans(res) 7 | return_ref(res) 8 | endfunction() -------------------------------------------------------------------------------- /samples/06-vanilla-cmake-project-with-install/importing_project/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | //#include 4 | 5 | int main(){ 6 | //std::cout<` 2 | ## 3 | ## includes the specified cmakepp file (compiling it) 4 | macro(cmakepp_include path) 5 | cmakepp_compile_file("${path}") 6 | include("${__ans}") 7 | endmacro() -------------------------------------------------------------------------------- /cmake/filesystem/file/fread.cmake: -------------------------------------------------------------------------------- 1 | # reads the file specified and returns its content 2 | function(fread path) 3 | path("${path}") 4 | ans(path) 5 | file(READ "${path}" res) 6 | return_ref(res) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/function/check_function.cmake: -------------------------------------------------------------------------------- 1 | function(check_function func) 2 | is_function(res "${func}") 3 | if(NOT res) 4 | message(FATAL_ERROR "expected a function instead got: '${func}'") 5 | endif() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/map/helpers/map_count.cmake: -------------------------------------------------------------------------------- 1 | ## `()->` 2 | ## 3 | ## returns the number of elements for the specified map 4 | macro(map_count map) 5 | map_keys("${map}") 6 | list(LENGTH __ans __ans) 7 | endmacro() -------------------------------------------------------------------------------- /cmake/navigation/query/query_literals/query_literal_lt.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(query_literal_lt input) 3 | if("${ARGN}" LESS "${input}") 4 | return(true) 5 | endif() 6 | return(false) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/object/helpers/new.cmake: -------------------------------------------------------------------------------- 1 | # shorthand for map_new and obj_new 2 | # accepts a Type (which has to be a cmake function) 3 | function(new) 4 | obj_new(${ARGN}) 5 | return_ans() 6 | endfunction() 7 | 8 | 9 | -------------------------------------------------------------------------------- /cmake/object/this/this_declare_setter.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(this_declare_setter function_ref) 4 | obj_declare_setter(${this} _ref) 5 | set(${function_ref} ${_ref} PARENT_SCOPE) 6 | endfunction() 7 | 8 | -------------------------------------------------------------------------------- /cmake/process/linux/linux_ps_info_get.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(linux_ps_info_get pid) 3 | map_new() 4 | ans(map) 5 | linux_ps_info_capture("${pid}" "${map}" ${ARGN}) 6 | return("${map}") 7 | 8 | endfunction() 9 | -------------------------------------------------------------------------------- /cmake/string/regex_search.cmake: -------------------------------------------------------------------------------- 1 | 2 | # matches the first occurens of regex and returns it 3 | function(regex_search str regex) 4 | string(REGEX MATCH "${regex}" res "${str}") 5 | return_ref(res) 6 | endfunction() -------------------------------------------------------------------------------- /cmake/type/t_target_identifier.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(t_target_identifier) 3 | if("${ARGN}" MATCHES "^[a-zA-Z0-9_:]+$") 4 | return(true ${ARGN}) 5 | else() 6 | return(false) 7 | endif() 8 | endfunction() -------------------------------------------------------------------------------- /cmake/vcs/svn/svn_get_revision.cmake: -------------------------------------------------------------------------------- 1 | ## returns the revision for the specified svn uri 2 | function(svn_get_revision) 3 | svn_info("${ARGN}") 4 | ans(res) 5 | nav(res.revision) 6 | return_ans() 7 | endfunction() -------------------------------------------------------------------------------- /tests/map/map_navigate_set_if_missing_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | map_new() 3 | ans(m1) 4 | map_navigate_set_if_missing("m1.test" "hello") 5 | assert(DEREF "{m1.test}" STREQUAL "hello") 6 | endfunction() -------------------------------------------------------------------------------- /tests/task/task_start_anonymous_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | task_start_anonymous("abc" () return("1 \${ARGN}")) 3 | ans(task) 4 | tqr() 5 | assertf("{task.return_value}" STREQUAL "1 abc") 6 | endfunction() -------------------------------------------------------------------------------- /cmake/cache/cache_update.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(cache_update cache_key value) 3 | memory_cache_update("${cache_key}" "${value}" ${ARGN}) 4 | file_cache_update("${cache_key}" "${value}" ${ARGN}) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/cache/string_cache_hit.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(string_cache_hit cache_location key) 3 | string_cache_location("${cache_location}" "${key}") 4 | ans(location) 5 | return_truth(EXISTS "${location}") 6 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/targets/overrides/add_test.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(add_test) 3 | _add_test(${ARGN}) 4 | event_emit(add_test ${ARGN}) 5 | event_emit(on_target_added test ${ARGN}) 6 | target_register(${ARGN}) 7 | 8 | endmacro() -------------------------------------------------------------------------------- /cmake/cmake/targets/target_get.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(target_get tgt_name key) 4 | get_property( 5 | val 6 | TARGET "${tgt_name}" 7 | PROPERTY "${key}" 8 | ) 9 | return_ref(val) 10 | endfunction() 11 | -------------------------------------------------------------------------------- /cmake/cmake/targets/target_has.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(target_has tgt_name key) 3 | get_property( 4 | val 5 | TARGET "${tgt_name}" 6 | PROPERTY "${key}" 7 | SET) 8 | return_ref(val) 9 | endfunction() 10 | -------------------------------------------------------------------------------- /cmake/object/this/this_declare_member_call.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(this_declare_member_call function_ref) 3 | obj_declare_member_call(${this} _res) 4 | set(${function_ref} ${_res} PARENT_SCOPE) 5 | endfunction() 6 | -------------------------------------------------------------------------------- /cmake/platform/windows/cmd/win32_cmd.cmake: -------------------------------------------------------------------------------- 1 | # wraps the win32 console executable cmd.exe 2 | function(win32_cmd) 3 | wrap_executable(win32_cmd cmd.exe) 4 | win32_cmd(${ARGN}) 5 | return_ans() 6 | endfunction() 7 | 8 | -------------------------------------------------------------------------------- /cmake/process/linux/linux_kill.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## wraps the linux pkill command 4 | function(linux_kill) 5 | wrap_executable(linux_kill kill) 6 | linux_kill(${ARGN}) 7 | return_ans() 8 | endfunction() 9 | -------------------------------------------------------------------------------- /cmake/type/t_uri.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(t_uri) 3 | uri(${ARGN}) 4 | ans(uri) 5 | if(uri) 6 | return(true ${uri}) 7 | 8 | else() 9 | return(false) 10 | endif() 11 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_get_labelled_value_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | set(lstA a b c d) 4 | 5 | list_get_labelled_value(lstA b) 6 | ans(res) 7 | assert("${res}" STREQUAL "c") 8 | 9 | 10 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_without_range_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | set(lstA a b c d e f) 5 | 6 | list_without_range(lstA 2 4) 7 | ans(res) 8 | 9 | assert(${res} EQUALS a b e f) 10 | 11 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/is_cmake_function.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(is_cmake_function code) 4 | if("${code}" MATCHES "function.*endfunction") 5 | return(true) 6 | endif() 7 | return(false) 8 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/targets/target_append.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(target_append tgt_name key) 3 | set_property( 4 | TARGET "${tgt_name}" 5 | APPEND 6 | PROPERTY "${key}" 7 | ${ARGN}) 8 | return() 9 | endfunction() 10 | -------------------------------------------------------------------------------- /cmake/debugging/print_macros.cmake: -------------------------------------------------------------------------------- 1 | function(print_macros) 2 | get_cmake_property(_variableNames MACROS) 3 | foreach (_variableName ${_variableNames}) 4 | message(STATUS "${_variableName}") 5 | endforeach() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/filesystem/path/path_qualify.cmake: -------------------------------------------------------------------------------- 1 | 2 | ## qualifies the specified variable as a path and sets it accordingly 3 | macro(path_qualify __path_ref) 4 | path("${${__path_ref}}") 5 | ans(${__path_ref}) 6 | endmacro() 7 | -------------------------------------------------------------------------------- /cmake/function/lambda/is_lambda.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(is_lambda callable) 3 | if("${callable}" MATCHES "^\\[[a-zA-Z0-9_ ]*]*\\]\\([[a-zA-Z0-9_ ]*\\)") 4 | return(true) 5 | endif() 6 | return(false) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/log/log_default_handler.cmake: -------------------------------------------------------------------------------- 1 | function(log_default_handler) 2 | event_addhandler(on_log_message "[](msg) message(FORMAT '{msg.function}> {msg.message}') ") 3 | ans(handler) 4 | return(${handler}) 5 | endfunction() -------------------------------------------------------------------------------- /cmake/map/helpers/map_at.cmake: -------------------------------------------------------------------------------- 1 | 2 | ## returns the value at idx 3 | function(map_at map idx) 4 | map_key_at(${map} "${idx}") 5 | ans(key) 6 | map_tryget(${map} "${key}") 7 | return_ans() 8 | endfunction() -------------------------------------------------------------------------------- /cmake/navigation/query/query_literals/query_literal_eq.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(query_literal_eq input) 3 | if("${ARGN}" EQUAL "${input}") 4 | return(true) 5 | endif() 6 | return(false) 7 | endfunction() 8 | -------------------------------------------------------------------------------- /cmake/package/project/extensions/cmake/project_cmake_constants.cmake: -------------------------------------------------------------------------------- 1 | macro(project_cmake_constants) 2 | set(project_cmake_module_dir "cmake") 3 | set(project_cmake_module_include_dir "include") 4 | endmacro() 5 | -------------------------------------------------------------------------------- /cmake/persistence/file_data/file_data_write.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | function(file_data_write dir id) 5 | file_data_path("${dir}" "${id}") 6 | ans(path) 7 | qm_write("${path}" ${ARGN}) 8 | return_ref(path) 9 | endfunction() -------------------------------------------------------------------------------- /cmake/ref/address_pop_back.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(address_pop_back ref) 3 | address_get(${ref}) 4 | ans(value) 5 | list_pop_back(value) 6 | ans(res) 7 | address_set(${ref} ${value}) 8 | return_ref(res) 9 | endfunction() -------------------------------------------------------------------------------- /cmake/stack/queue_new.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(queue_new) 3 | address_new(queue) 4 | ans(queue) 5 | map_set_hidden(${queue} front 0) 6 | map_set_hidden(${queue} back 0) 7 | return(${queue}) 8 | endfunction() -------------------------------------------------------------------------------- /cmake/stack/rlist_new.cmake: -------------------------------------------------------------------------------- 1 | function(rlist_new) 2 | address_new(rlist) 3 | ans(rlist) 4 | map_set_hidden(${queue} front 0) 5 | map_set_hidden(${queue} back 0) 6 | return(${queue}) 7 | endfunction() 8 | 9 | -------------------------------------------------------------------------------- /tests/list/list_range_try_get_tst.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | 5 | 6 | set(lst a b c d e) 7 | list_range_try_get(lst 1 2 3 9 10) 8 | ans(res) 9 | assert(${res} EQUALS b c d) 10 | 11 | 12 | endfunction() -------------------------------------------------------------------------------- /tests/map/data_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | data(uut.find_handler(command1 "{a:123}")) 4 | ans(res) 5 | assert(${res} MAP_MATCHES "['uut.find_handler','(','command1',{a:123},')']") 6 | 7 | 8 | 9 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/cmakelists/cml.cmake: -------------------------------------------------------------------------------- 1 | ## `(...)->...` 2 | ## 3 | ## wrapper for cmakelists_cli 4 | function(cml) 5 | set(args ${ARGN}) 6 | cmakelists_cli(${args}) 7 | ans(res) 8 | return_ref(res) 9 | endfunction() 10 | -------------------------------------------------------------------------------- /cmake/cmake/old/cmake_function_parse.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(cmake_function_parse code) 3 | cmake_function_signature("${code}") 4 | ans(signature) 5 | map_set(${signature} code "${code}") 6 | return_ref() 7 | endfunction() 8 | -------------------------------------------------------------------------------- /cmake/collections/list_push_back.cmake: -------------------------------------------------------------------------------- 1 | # adds a value to the end of the list 2 | function(list_push_back __list_push_back_lst value) 3 | set(${__list_push_back_lst} ${${__list_push_back_lst}} ${value} PARENT_SCOPE) 4 | endfunction() -------------------------------------------------------------------------------- /cmake/core/status_line_restore.cmake: -------------------------------------------------------------------------------- 1 | function(status_line_restore) 2 | map_tryget(global status) 3 | ans(status) 4 | if("${status}_" STREQUAL "_") 5 | return() 6 | endif() 7 | echo_append("${status}") 8 | endfunction() -------------------------------------------------------------------------------- /cmake/function/callable/callable_call.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(callable_call callable) 3 | map_get_special("${callable}" callable_function) 4 | eval("${__ans}(${ARGN})") 5 | set(__ans "${__ans}" PARENT_SCOPE) 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/indent_level/indent_level.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(indent_level) 3 | map_peek_back(global __indentlevelstack) 4 | ans(lvl) 5 | if(NOT lvl) 6 | return(0) 7 | endif() 8 | return_ref(lvl) 9 | endfunction() -------------------------------------------------------------------------------- /cmake/map/core/map_new.cmake: -------------------------------------------------------------------------------- 1 | 2 | ## optimized version 3 | macro(map_new) 4 | address_new() 5 | set_property(GLOBAL PROPERTY "${__ans}.__keys__" "") ## set keys (duck typing for map is that it has property keys) 6 | endmacro() -------------------------------------------------------------------------------- /cmake/navigation/query/query_literals/query_literal_gt.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(query_literal_gt input) 4 | if("${ARGN}" GREATER "${input}") 5 | return(true) 6 | endif() 7 | return(false) 8 | endfunction() 9 | -------------------------------------------------------------------------------- /cmake/object/this/this_declare_getter.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(this_declare_getter function_name_ref) 3 | obj_declare_getter(${this} _res) 4 | set(${function_name_ref} ${_res} PARENT_SCOPE) 5 | return() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/platform/windows/taskkill/win32_taskkill.cmake: -------------------------------------------------------------------------------- 1 | # wraps the win32 taskkill command 2 | function(win32_taskkill) 3 | wrap_executable(win32_taskkill "taskkill") 4 | win32_taskkill(${ARGN}) 5 | return_ans() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/ref/address_pop_front.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(address_pop_front ref) 3 | address_get(${ref}) 4 | ans(value) 5 | list_pop_front(value) 6 | ans(res) 7 | address_set(${ref} ${value}) 8 | return_ref(res) 9 | endfunction() -------------------------------------------------------------------------------- /cmake/scope/scope_keys.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | # returns all currently defined variables of the local scope 4 | function(scope_keys) 5 | get_cmake_property(_variableNames VARIABLES) 6 | return_ref(_variableNames) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/stack/stack_new.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(stack_new) 3 | address_new(stack) 4 | ans(stack) 5 | map_set_hidden("${stack}" front 0) 6 | map_set_hidden("${stack}" back 0) 7 | return(${stack}) 8 | endfunction() -------------------------------------------------------------------------------- /cmake/type/t_callable.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(t_callable) 3 | if(NOT ARGN) 4 | return(false) 5 | endif() 6 | callable("${ARGN}") 7 | ans(callable) 8 | return(true ${callable}) 9 | endfunction() 10 | -------------------------------------------------------------------------------- /cmake/uri/uri_parse_scheme.cmake: -------------------------------------------------------------------------------- 1 | function(uri_parse_scheme uri) 2 | map_tryget(${uri} scheme) 3 | ans(scheme) 4 | 5 | string(REPLACE "+" "\;" schemes "${scheme}") 6 | map_set(${uri} schemes ${schemes}) 7 | 8 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_except_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | set(lstA a b c d e) 4 | set(lstB c e) 5 | 6 | list_except(lstA lstB) 7 | ans(res) 8 | assert(${res} EQUALS a b d) 9 | 10 | 11 | 12 | endfunction() -------------------------------------------------------------------------------- /tests/semver/semver_gt_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | semver_gt("3.0.0" "2.0.0") 5 | ans(res) 6 | assert(res) 7 | semver_gt("3.0.0" "4.0.0") 8 | ans(res) 9 | assert(NOT res) 10 | 11 | endfunction() -------------------------------------------------------------------------------- /cmake/collections/encoded_list/encoded_list_peek_back.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(encoded_list_peek_back __lst) 3 | list_peek_back(${__lst}) 4 | ans(back) 5 | string_decode_list("${back}") 6 | return_ans() 7 | endfunction() -------------------------------------------------------------------------------- /cmake/core/message_indent_level.cmake: -------------------------------------------------------------------------------- 1 | function(message_indent_level) 2 | map_peek_back("global" "message_indent_level") 3 | ans(level) 4 | if(NOT level) 5 | return(0) 6 | endif() 7 | return_ref(level) 8 | endfunction() 9 | -------------------------------------------------------------------------------- /cmake/expr/lexer/arguments_create_tokens.cmake: -------------------------------------------------------------------------------- 1 | macro(arguments_create_tokens __start_idx __end_idx) 2 | arguments_tokenize("${__start_idx}" "${__end_idx}") 3 | tokens_create("${token_strings}" "${token_types}") 4 | endmacro() 5 | -------------------------------------------------------------------------------- /cmake/filesystem/navigation/dirs.cmake: -------------------------------------------------------------------------------- 1 | # returns all directories currently on directory stack 2 | # also see pushd popd 3 | function(dirs) 4 | stack_enumerate(__global_push_d_stack) 5 | ans(res) 6 | return_ref(res) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/filesystem/path/path_combine.cmake: -------------------------------------------------------------------------------- 1 | 2 | # combines all dirs to a single path 3 | function(path_combine ) 4 | set(args ${ARGN}) 5 | list_to_string(args "/") 6 | ans(path) 7 | return_ref(path) 8 | endfunction() -------------------------------------------------------------------------------- /cmake/function/function_signature_regex.cmake: -------------------------------------------------------------------------------- 1 | function(function_signature_regex result) 2 | set(${result} "^[ ]*([mM][aA][cC][rR][oO]|[fF][uU][nN][cC][tT][iI][oO][nN])[ ]*\\([ ]*([A-Za-z0-9_\\\\-]*)(.*)\\)" PARENT_SCOPE) 3 | endfunction() -------------------------------------------------------------------------------- /cmake/map/helpers/map_flatten.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(map_flatten) 3 | set(result) 4 | foreach(map ${ARGN}) 5 | map_values(${map}) 6 | ans_append(result) 7 | endforeach() 8 | return_ref(result) 9 | endfunction() -------------------------------------------------------------------------------- /cmake/persistence/key_value/key_value_store_keys.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(key_value_store_keys) 4 | this_get(store_dir) 5 | file(GLOB keys RELATIVE "${store_dir}" "${store_dir}/*") 6 | return_ref(keys) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/process/await.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(await handle) 3 | process_wait(${handle}) 4 | 5 | map_tryget("${handle}" result_file) 6 | ans(result_file) 7 | qm_read("${result_file}") 8 | return_ans() 9 | endfunction() -------------------------------------------------------------------------------- /cmake/stack/stack_isempty.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(stack_isempty stack) 4 | map_tryget("${stack}" back) 5 | ans(count) 6 | if(count) 7 | return(false) 8 | endif() 9 | return(true) 10 | endfunction() -------------------------------------------------------------------------------- /install-powershell.ps1: -------------------------------------------------------------------------------- 1 | ((new-object net.webclient).DownloadString('https://raw.github.com/toeb/cmakepp/master/install.cmake')) |` 2 | out-file -Encoding ascii install.cmake; ` 3 | cmake -P install.cmake; ` 4 | rm install.cmake; 5 | 6 | -------------------------------------------------------------------------------- /tests/map/map_performanace.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | foreach(i RANGE 1000) 4 | map_new() 5 | ans(map) 6 | map_set(${map} key "value1") 7 | map_get(${map} key ) 8 | ans(res) 9 | endforeach() 10 | endfunction() -------------------------------------------------------------------------------- /tests/task/global_task_queue_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | task_queue_global() 5 | ans(tq1) 6 | task_queue_global() 7 | ans(tq2) 8 | assert(tq1) 9 | assert("${tq1}" STREQUAL "${tq2}") 10 | 11 | endfunction() -------------------------------------------------------------------------------- /tests/unsafe_file_operation_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | function(unsafe_scope_lock) 4 | 5 | endfunction() 6 | 7 | 8 | 9 | function(unsafe_scope_unlock) 10 | 11 | endfunction() 12 | 13 | 14 | endfunction() -------------------------------------------------------------------------------- /cmake/cache/cache_return_hit.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(cache_return_hit cache_key) 3 | cache_get("${cache_key}") 4 | ans(__cache_return) 5 | if(__cache_return) 6 | return_ref(__cache_return) 7 | endif() 8 | endmacro() 9 | 10 | -------------------------------------------------------------------------------- /cmake/cache/memory_cache_return_hit.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(memory_cache_return_hit cache_key) 3 | memory_cache_get("${cache_key}") 4 | ans(__cache_return) 5 | if(__cache_return) 6 | return_ref(__cache_return) 7 | endif() 8 | endmacro() -------------------------------------------------------------------------------- /cmake/collections/encoded_list/encoded_list.cmake: -------------------------------------------------------------------------------- 1 | ## creates encoded lists from the specified arguments 2 | function(encoded_list) 3 | arguments_encoded_list(0 ${ARGC}) 4 | set(__ans "${__ans}" PARENT_SCOPE) 5 | endfunction() 6 | 7 | 8 | -------------------------------------------------------------------------------- /cmake/core/return/return.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## 3 | ## when not to use: if your data degrades when evaluated by a macro 4 | ## for example escapes are resolved 5 | macro(return) 6 | set(__ans "${ARGN}" PARENT_SCOPE) 7 | _return() 8 | endmacro() -------------------------------------------------------------------------------- /cmake/core/vars_elevate.cmake: -------------------------------------------------------------------------------- 1 | 2 | # pushes the specified vars to the parent scope 3 | macro(vars_elevate) 4 | set(args ${ARGN}) 5 | foreach(arg ${args}) 6 | set("${arg}" ${${arg}} PARENT_SCOPE) 7 | endforeach() 8 | endmacro() 9 | -------------------------------------------------------------------------------- /cmake/debugging/print_commands.cmake: -------------------------------------------------------------------------------- 1 | function(print_commands) 2 | 3 | get_cmake_property(_variableNames COMMANDS) 4 | foreach (_variableName ${_variableNames}) 5 | message(STATUS "${_variableName}") 6 | endforeach() 7 | 8 | endfunction() -------------------------------------------------------------------------------- /cmake/function/arguments_anonymous_function.cmake: -------------------------------------------------------------------------------- 1 | macro(arguments_anonymous_function __args_start __args_end) 2 | arguments_cmake_code(${__args_start} ${__args_end}) 3 | anonymous_function_new("${__ans}") 4 | endmacro() 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cmake/string/string_eval.cmake: -------------------------------------------------------------------------------- 1 | ## evaluates the string in the current scope 2 | ## this is done by macro variable expansion 3 | ## evaluates both ${} and @@ style variables 4 | macro(string_eval str) 5 | set_ans("${str}") 6 | endmacro() -------------------------------------------------------------------------------- /package.cmake: -------------------------------------------------------------------------------- 1 | { 2 | "id":"cmakepp", 3 | "version":"0.0.0", 4 | "description":"a CMake Enhancement Suite", 5 | "license":"MIT", 6 | "authors":"toeb = Tobias P. Becker ", 7 | "owner":"toeb" 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/list/list_erase_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | set(lstA a b c d e) 4 | 5 | list_erase(lstA 1 3) 6 | ans(res) 7 | assert(${res} EQUALS ${lstA}) 8 | assert(${lstA} EQUALS a d e ) 9 | 10 | 11 | 12 | endfunction() -------------------------------------------------------------------------------- /cmake/cache/file_cache_clear.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(file_cache_clear cache_key) 4 | file_cache_key("${cache_key}") 5 | ans(path) 6 | if(EXISTS "${path}") 7 | file(REMOVE "${path}") 8 | endif() 9 | return() 10 | endfunction() -------------------------------------------------------------------------------- /cmake/cache/file_cache_exists.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(file_cache_exists cache_key) 4 | file_cache_key("${cache_key}") 5 | ans(path) 6 | if(EXISTS "${path}") 7 | return(true) 8 | endif() 9 | return(false) 10 | endfunction() -------------------------------------------------------------------------------- /cmake/cmake/targets/overrides/add_executable.cmake: -------------------------------------------------------------------------------- 1 | 2 | macro(add_executable) 3 | _add_executable(${ARGN}) 4 | event_emit(add_executable ${ARGN}) 5 | event_emit(on_target_added executable ${ARGN}) 6 | target_register(${ARGN}) 7 | endmacro() -------------------------------------------------------------------------------- /cmake/cmake/targets/target_append_string.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(target_append_string tgt_name key) 3 | set_property( 4 | TARGET "${tgt_name}" 5 | APPEND_STRING 6 | PROPERTY "${key}" 7 | ${ARGN}) 8 | return() 9 | endfunction() 10 | -------------------------------------------------------------------------------- /cmake/collections/encoded_list/encoded_list_peek_front.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(encoded_list_peek_front __lst) 3 | list_peek_front(${__lst}) 4 | ans(front) 5 | string_decode_list("${front}") 6 | return_ans() 7 | endfunction() 8 | -------------------------------------------------------------------------------- /cmake/log/log_clear.cmake: -------------------------------------------------------------------------------- 1 | ## `log_record_clear()->` 2 | ## 3 | ## removes all messages from the log record 4 | ## 5 | ## 6 | function(log_record_clear) 7 | address_set(log_record) 8 | return() 9 | endfunction() 10 | 11 | 12 | -------------------------------------------------------------------------------- /cmake/map/helpers/map_push_back.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(map_push_back map prop) 4 | map_tryget("${map}" "${prop}") 5 | ans(lst) 6 | list_push_back(lst ${ARGN}) 7 | map_set("${map}" "${prop}" ${lst}) 8 | return_ref(lst) 9 | endfunction() -------------------------------------------------------------------------------- /cmake/scope/scope_clear.cmake: -------------------------------------------------------------------------------- 1 | # clears the current local scope of any variables 2 | function(scope_clear) 3 | scope_keys() 4 | ans(vars) 5 | foreach (var ${vars}) 6 | set(${var} PARENT_SCOPE) 7 | endforeach() 8 | endfunction() -------------------------------------------------------------------------------- /cmake/uri/uri.cmake: -------------------------------------------------------------------------------- 1 | function(uri uri) 2 | is_address("${uri}") 3 | ans(ismap) 4 | if(ismap) 5 | return_ref(uri) 6 | endif() 7 | uri_parse("${uri}" ${ARGN}) 8 | ans(uri) 9 | return_ref(uri) 10 | endfunction() 11 | 12 | -------------------------------------------------------------------------------- /cmake/vcs/hg/hg_ref.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(hg_ref search) 3 | hg_match_refs("${search}") 4 | ans(res) 5 | list(LENGTH res len) 6 | if("${len}" EQUAL 1) 7 | return(${res}) 8 | endif() 9 | return() 10 | endfunction() 11 | 12 | -------------------------------------------------------------------------------- /tests/list/list_at_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | 5 | 6 | set(lstA a b c d e f g) 7 | 8 | 9 | list_at(lstA 0 0 2 2 -2 -3 -4) 10 | ans(res) 11 | assert(${res} EQUALS a a c c g f e) 12 | 13 | 14 | 15 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_find_flags_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | set(lst a b c d e f g) 5 | list_find_flags(lst a d f) 6 | ans(res) 7 | assertf("{res.a}") 8 | assertf("{res.d}") 9 | assertf("{res.f}") 10 | 11 | endfunction() -------------------------------------------------------------------------------- /tests/semver/semver_tests.cmake: -------------------------------------------------------------------------------- 1 | function(semver_tests) 2 | 3 | semver("0.1") 4 | ans(res) 5 | assert(res) 6 | assert(DEREF "{res.major}" STREQUAL "0") 7 | assert(DEREF "{res.minor}" STREQUAL "1") 8 | 9 | 10 | endfunction() -------------------------------------------------------------------------------- /cmake/collections/encoded_list/encoded_list_append.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(encoded_list_append __lst) 3 | string_encode_list("${ARGN}") 4 | list(APPEND "${__lst}" ${__ans}) 5 | set(${__lst} ${${__lst}} PARENT_SCOPE) 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/collections/list_max.cmake: -------------------------------------------------------------------------------- 1 | ## returns the maximum value in the list 2 | ## using the specified comparerer function 3 | function(list_max lst comparer) 4 | list_fold(${lst} "${comparer}") 5 | ans(res) 6 | return(${res}) 7 | endfunction() 8 | -------------------------------------------------------------------------------- /cmake/core/message_indent_level_pop.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(message_indent_pop) 3 | map_pop_back(global message_indent_level) 4 | ans(old_level) 5 | message_indent_level() 6 | ans(current_level) 7 | return_ref(current_level) 8 | endfunction() 9 | -------------------------------------------------------------------------------- /cmake/core/os.cmake: -------------------------------------------------------------------------------- 1 | # returns the identifier for the os being used 2 | function(os) 3 | if(WIN32) 4 | return(Windows) 5 | elseif(UNIX) 6 | return(Linux) 7 | else() 8 | return() 9 | endif() 10 | 11 | 12 | endfunction() 13 | -------------------------------------------------------------------------------- /cmake/function/define_function.cmake: -------------------------------------------------------------------------------- 1 | ## define an inline function 2 | ## e.g. `define_function(my_func() message(hello))` 3 | function(define_function function_name) 4 | arguments_function("${function_name}" 1 ${ARGC}) 5 | return() 6 | endfunction() -------------------------------------------------------------------------------- /cmake/package/project/extensions/hooks/on_ready_hook.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(on_ready_hook project_handle package_handle) 3 | package_handle_invoke_hook("${package_handle}" hooks.on_ready ${project_handle} ${package_handle}) 4 | endfunction() 5 | 6 | -------------------------------------------------------------------------------- /cmake/string/string_append_line_indented.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(string_append_line_indented str_ref what) 3 | indent("${what}" ${ARGN}) 4 | ans(indented) 5 | set("${str_ref}" "${${str_ref}}${indented}\n" PARENT_SCOPE) 6 | endfunction() 7 | -------------------------------------------------------------------------------- /tests/core/tick_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | 4 | 5 | foreach(i RANGE 1000) 6 | tick() 7 | endforeach() 8 | tick() 9 | tick() 10 | message("asd") 11 | tick() 12 | tick() 13 | tick() 14 | tock() 15 | 16 | endfunction() -------------------------------------------------------------------------------- /tests/filesystem/uri_format_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | uri_to_localpath("\"c:\\test\\a b\\test.txt\"") 4 | ans(res) 5 | 6 | assert("${res}" STREQUAL "c:/test/a b/test.txt") 7 | 8 | 9 | 10 | endfunction() 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/list/list_extract_any_flag_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | set(lstA a b c d e f) 4 | 5 | list_extract_any_flag(lstA c d f) 6 | ans(res) 7 | assert(res) 8 | assert(${lstA} EQUALS a b e) 9 | 10 | 11 | 12 | endfunction() -------------------------------------------------------------------------------- /tests/list/list_swap_test.cmake: -------------------------------------------------------------------------------- 1 | function(test) 2 | 3 | set(lstA a b c) 4 | 5 | list_swap(lstA 0 0) 6 | assert(${lstA} EQUALS a b c) 7 | 8 | list_swap(lstA 0 2) 9 | assert(${lstA} EQUALS c b a) 10 | 11 | 12 | 13 | endfunction() -------------------------------------------------------------------------------- /cmake/ast/token_stream_isempty.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(token_stream_isempty stream) 3 | map_tryget(${stream} current) 4 | ans(current) 5 | if(current) 6 | return(false) 7 | endif() 8 | return(true) 9 | 10 | endfunction() -------------------------------------------------------------------------------- /cmake/cache/file_cache_return_hit.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | macro(file_cache_return_hit cache_key) 4 | file_cache_get("${cache_key}") 5 | ans(__cache_return) 6 | if(__cache_return) 7 | return_ref(__cache_return) 8 | endif() 9 | 10 | endmacro() -------------------------------------------------------------------------------- /cmake/collections/encoded_list/encoded_list_set.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(encoded_list_set __lst idx) 3 | string_encode_list("${ARGN}") 4 | list_replace_at(${__lst} ${idx} ${__ans}) 5 | set(${__lst} ${${__lst}} PARENT_SCOPE) 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/map/helpers/list_match.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | # matches the object list 4 | function(list_match __list_match_lst ) 5 | map_matches("${ARGN}") 6 | ans(predicate) 7 | list_where("${__list_match_lst}" "${predicate}") 8 | return_ans() 9 | endfunction() -------------------------------------------------------------------------------- /cmake/object/helpers/obj_declare_setter.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(obj_declare_setter obj function_ref) 3 | function_new() 4 | ans(res) 5 | map_set_special(${obj} setter ${res}) 6 | set(${function_ref} ${res} PARENT_SCOPE) 7 | endfunction() 8 | -------------------------------------------------------------------------------- /cmake/persistence/fallback_data/fallback_data_set.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | function(fallback_data_set dirs id nav) 4 | list_pop_front(dirs) 5 | ans(dir) 6 | 7 | file_data_set("${dir}" "${id}" "${nav}" ${ARGN}) 8 | return_ans() 9 | endfunction() -------------------------------------------------------------------------------- /cmake/persistence/key_value/key_value_store_save.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(key_value_store_save) 3 | this_get(store_dir) 4 | assign(key = this.key(${ARGN})) 5 | qm_write("${store_dir}/${key}" ${ARGN}) 6 | return_ref(key) 7 | endfunction() -------------------------------------------------------------------------------- /cmake/platform/windows/tasklist/win32_tasklist_bare.cmake: -------------------------------------------------------------------------------- 1 | ## a bare wrapper for tasklist 2 | function(win32_tasklist_bare) 3 | wrap_executable_bare(win32_tasklist_bare "tasklist") 4 | win32_tasklist_bare(${ARGN}) 5 | return_ans() 6 | endfunction() 7 | -------------------------------------------------------------------------------- /cmake/ref/address_push_back.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(address_push_back ref) 3 | address_get(${ref}) 4 | ans(value) 5 | list_push_back(value "${ARGN}") 6 | ans(res) 7 | address_set(${ref} ${value}) 8 | return_ref(res) 9 | endfunction() -------------------------------------------------------------------------------- /cmake/ref/address_type_get.cmake: -------------------------------------------------------------------------------- 1 | function(address_type_get ref) 2 | is_address(${ref}) 3 | ans(is_ref) 4 | if(NOT is_ref) 5 | return() 6 | endif() 7 | address_get("${ref}.__type__") 8 | ans(type) 9 | return_ref(type) 10 | endfunction() -------------------------------------------------------------------------------- /cmake/templating/template/template_output_stream.cmake: -------------------------------------------------------------------------------- 1 | ## `()->