def main(): args = tf.parse_args(False) bin_name = args.name lines = build_lines_for_bin(bin_name, [], args.no_glob, args.to_link) tf.create_cmakelists_for_target_under(bin_name, "src", lines) cpp_lines = ['int main() { return 0; }'] tf.create_file_in_target_under(bin_name, "src", cpp_lines, "{}.cpp".format(bin_name)) tf.add_dir_to_root_cmakelists(bin_name, "src")
def main(): args = tf.parse_args(True) lib_name = args.name lines = build_lines_for_lib(lib_name, args.no_glob, args.to_link, args.lib_type) tf.create_cmakelists_for_target_under(lib_name, "src", lines) tf.create_file_in_target_under(lib_name, "src", ["#pragma once"], "{}.h".format(lib_name)) cpp_lines = ['#include "{}.h"'.format(lib_name)] tf.create_file_in_target_under(lib_name, "src", cpp_lines, "{}.cpp".format(lib_name)) test_lines = build_lines_for_test_cmake(lib_name, args.no_glob) tf.create_cmakelists_for_target_under("tests", "src/{}".format(lib_name), test_lines) unit_test_lines = build_lines_for_test(lib_name) tf.create_file_in_target_under("tests", "src/{}".format(lib_name), unit_test_lines, "{}_test.cpp".format(lib_name)) tf.add_dir_to_root_cmakelists(lib_name, "src")