Giter VIP home page Giter VIP logo

cmake_examples's Introduction

CMake Examples

GitHub Ubuntu Windows macOS android

Zhuo's CMake based C/C++ project templates.

Features

  • Modern: Use latest cmake, write target-oriented configurations.
  • Modular: Formed into > 10 groups of examples, each group consists of strong related examples.
  • Versatile: Extracted from practical, not restricted to simple tutorials.

Contents

There are above 100 examples now. Some of them are written in English, some in Chinese, but anyway, each of them are simple enough, just find your interested one, and run it!

You may search them in this page, you may search each of them in the following table:

number examples directory
1 function_example1 01_cmake_language/function_example1
2 list_remove_example 01_cmake_language/list_remove_example
3 regex_replace_example 01_cmake_language/regex_replace_example
4 create_dll_example1 02_creating_targets/create_dll_example1
5 create_dll_example2 02_creating_targets/create_dll_example2
6 create_executable_example 02_creating_targets/create_executable_example
7 create_imported_lib_example 02_creating_targets/create_imported_lib_example
8 create_shared_lib_example 02_creating_targets/create_shared_lib_example
9 header_only_library_example 02_creating_targets/header_only_library_example
10 benchmark_example 03_dependencies/01_import_dependencies/benchmark_example
11 crc32c_example 03_dependencies/01_import_dependencies/crc32c_example
12 eigen_example 03_dependencies/01_import_dependencies/eigen_example
13 find_package_examples 03_dependencies/01_import_dependencies/find_package_examples
14 include-what-you-use_example 03_dependencies/01_import_dependencies/include-what-you-use_example
15 libclang_example 03_dependencies/01_import_dependencies/libclang_example
16 mex_example 03_dependencies/01_import_dependencies/mex_example
17 ncnn_example 03_dependencies/01_import_dependencies/ncnn_example
18 opencv_example 03_dependencies/01_import_dependencies/opencv_example
19 openssl_example 03_dependencies/01_import_dependencies/openssl_example
20 pkgconfig_lmdb_example 03_dependencies/01_import_dependencies/pkgconfig_lmdb_example
21 proto_to_cpp_example 03_dependencies/01_import_dependencies/proto_to_cpp_example
22 qt_example 03_dependencies/01_import_dependencies/qt_example
23 rapidcheck_example1 03_dependencies/01_import_dependencies/rapidcheck_example1
24 rapidcheck_example2 03_dependencies/01_import_dependencies/rapidcheck_example2
25 vulkan_example 03_dependencies/01_import_dependencies/vulkan_example
26 windows_pkgconfig_zlib_example 03_dependencies/01_import_dependencies/windows_pkgconfig_zlib_example
27 zlib_example 03_dependencies/01_import_dependencies/zlib_example
28 01_import_dependencies 03_dependencies/01_import_dependencies
29 debug_example 03_dependencies/02_debug_dependencies/debug_example
30 02_debug_dependencies 03_dependencies/02_debug_dependencies
31 cpm_example 03_dependencies/03_external_dependencies/cpm_example
32 cpm_example2 03_dependencies/03_external_dependencies/cpm_example2
33 external_add_example 03_dependencies/03_external_dependencies/external_add_example
34 fetchcontent_example 03_dependencies/03_external_dependencies/fetchcontent_example
35 fetchcontent_example2 03_dependencies/03_external_dependencies/fetchcontent_example2
36 fetchcontent_example3 03_dependencies/03_external_dependencies/fetchcontent_example3
37 onetbb_fetchcontent_example 03_dependencies/03_external_dependencies/onetbb_fetchcontent_example
38 03_external_dependencies 03_dependencies/03_external_dependencies
39 copy_dll_example 03_dependencies/04_files_and_io/copy_dll_example
40 copy_files_example 03_dependencies/04_files_and_io/copy_files_example
41 dll_path_example 03_dependencies/04_files_and_io/dll_path_example
42 download_example 03_dependencies/04_files_and_io/download_example
43 glob_example 03_dependencies/04_files_and_io/glob_example
44 04_files_and_io 03_dependencies/04_files_and_io
45 cmake_build_type_example 04_global_configurations/cmake_build_type_example
46 compile_database_example 04_global_configurations/compile_database_example
47 configure_file_example 04_global_configurations/configure_file_example
48 option_example 04_global_configurations/option_example
49 option_example2 04_global_configurations/option_example2
50 options_via_txt_example 04_global_configurations/options_via_txt_example
51 arm-linux-gnueabihf_example 05_cross_compilation/arm-linux-gnueabihf_example
52 arm-none-eabi_example 05_cross_compilation/arm-none-eabi_example
53 arm_neon_example 05_cross_compilation/arm_neon_example
54 arm_neon_example2 05_cross_compilation/arm_neon_example2
55 generator_example 05_cross_compilation/generator_example
56 linux-32bit_example 05_cross_compilation/linux-32bit_example
57 ohos_ndk_example 05_cross_compilation/ohos_ndk_example
58 rtos-test 05_cross_compilation/rtos-test
59 address_sanitizer_example 06_sanitizers/address_sanitizer_example
60 thread_sanitizer_example 06_sanitizers/thread_sanitizer_example
61 clang_coverage_example 07_testing/clang_coverage_example
62 ctest_example 07_testing/ctest_example
63 ctest_example2 07_testing/ctest_example2
64 doctest_example 07_testing/doctest_example
65 gcc_coverage_example 07_testing/gcc_coverage_example
66 gtest_ctest_example 07_testing/gtest_ctest_example
67 gtest_ctest_example2 07_testing/gtest_ctest_example2
68 gtest_example 07_testing/gtest_example
69 gtest_example2 07_testing/gtest_example2
70 gtest_example3 07_testing/gtest_example3
71 test_coverage_example 07_testing/test_coverage_example
72 test_coverage_example2 07_testing/test_coverage_example2
73 doxygen_coverage_example 08_docs/doxygen_coverage_example
74 doxygen_coverage_example2 08_docs/doxygen_coverage_example2
75 doxygen_coverage_example3 08_docs/doxygen_coverage_example3
76 doxygen_example 08_docs/doxygen_example
77 doxygen_example2 08_docs/doxygen_example2
78 cpack_example 09_installing/cpack_example
79 install_example1 09_installing/install_example1
80 install_example2 09_installing/install_example2
81 install_example3 09_installing/install_example3
82 install_example4 09_installing/install_example4
83 install_find_package_example 09_installing/install_find_package_example
84 10_vscode_debug_C++ 10_vscode_debug_C++
85 cuda_example 11_hpc_compute/cuda_example
86 opencl_example 11_hpc_compute/opencl_example
87 opengl_example 11_hpc_compute/opengl_example
88 openmp_example 11_hpc_compute/openmp_example
89 openmp_example2 11_hpc_compute/openmp_example2
90 openmp_example3 11_hpc_compute/openmp_example3
91 simd_multiversion_example 11_hpc_compute/simd_multiversion_example
92 sse_example 11_hpc_compute/sse_example
93 c_call_python_example 12_language_bindings/c_call_python_example
94 csharp_winform_example 12_language_bindings/csharp_winform_example
95 csharp_wpf_example 12_language_bindings/csharp_wpf_example
96 jni_example 12_language_bindings/jni_example
97 jni_example2 12_language_bindings/jni_example2
98 pybind11_example1 12_language_bindings/pybind11_example1
99 pybind11_example2 12_language_bindings/pybind11_example2
100 compile_flag_example1 13_misc/compile_flag_example1
101 generate_assemble_example 13_misc/generate_assemble_example
102 masm_example 13_misc/masm_example
103 modules 13_misc/modules
104 ninja_colorful_output_example 13_misc/ninja_colorful_output_example
105 umake 13_misc/umake

You may also use ./search.sh for specific search, e.g. search dll as keyword:

bash ./search.sh dll

And get result:

./01_creating_targets/create_dll_example2
./01_creating_targets/create_dll_example1
./06_files_and_io/copy_dll_example
./06_files_and_io/dll_path_example

♥️ Thanks

If you like this project, welcome Star. You may also watch this project for updated notifications in the first time!

Stargazers over time

References

Note: Official cmake bundled FindXXX.cmake failed to find packages sometimes, you may be interested in my another project cmake_modules

LICENSE

MIT

Acknowledgement

Thanks JetBrains company for providing 1 year license for all products to support this open source project.

cmake_examples's People

Contributors

zchrissirhcz avatar mlbo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.