• Stars
    star
    256
  • Rank 159,219 (Top 4 %)
  • Language
    C++
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Practical, Easy-to-copy CMake examples

CMake Examples

GitHub Ubuntu Windows macOS android

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

Currently in a refactor progress.

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:

0_helloworld

number examples directory
0 executable_example 0_helloworld/executable_example
1 find_package_example 0_helloworld/find_package_example
2 static_library_example 0_helloworld/static_library_example

1_package_management

number examples directory
0 auto_download_packages 1_package_management/auto_download_packages
1 build_and_install_packages 1_package_management/build_and_install_packages
2 manually_create_packages 1_package_management/manually_create_packages
3 pack_and_install_packages 1_package_management/pack_and_install_packages
4 use_installed_packages 1_package_management/use_installed_packages

2_global_and_target_settings

number examples directory
0 build_type 2_global_and_target_settings/build_type
1 c++_standard 2_global_and_target_settings/c++_standard
2 cmake_options 2_global_and_target_settings/cmake_options
3 compilation_database 2_global_and_target_settings/compilation_database
4 configure_file 2_global_and_target_settings/configure_file
5 debug_symbol_example 2_global_and_target_settings/debug_symbol_example
6 define_c_c++_macros 2_global_and_target_settings/define_c_c++_macros
7 flags_and_properties 2_global_and_target_settings/flags_and_properties
8 fPIC 2_global_and_target_settings/fPIC
9 include_directories 2_global_and_target_settings/include_directories
10 link_libraries 2_global_and_target_settings/link_libraries
11 postfix 2_global_and_target_settings/postfix
12 sanitizers 2_global_and_target_settings/sanitizers
13 specify_output_name 2_global_and_target_settings/specify_output_name
14 vs_debugger_working_directory 2_global_and_target_settings/vs_debugger_working_directory

3_cross_compilation

number examples directory
0 arm-linux-gnueabihf_example 3_cross_compilation/arm-linux-gnueabihf_example
1 arm-none-eabi_example 3_cross_compilation/arm-none-eabi_example
2 arm_neon_example 3_cross_compilation/arm_neon_example
3 arm_neon_example2 3_cross_compilation/arm_neon_example2
4 generator_example 3_cross_compilation/generator_example
5 linux-32bit_example 3_cross_compilation/linux-32bit_example
6 neon_intrinsics_example 3_cross_compilation/neon_intrinsics_example
7 ohos_ndk_example 3_cross_compilation/ohos_ndk_example
8 presets-example 3_cross_compilation/presets-example
9 rtos-test 3_cross_compilation/rtos-test

4_post_processing

number examples directory
0 copy_directory_example 4_post_processing/copy_directory_example
1 copy_dll_example 4_post_processing/copy_dll_example
2 copy_files_example 4_post_processing/copy_files_example
3 dll_path_example 4_post_processing/dll_path_example
4 download_example 4_post_processing/download_example
5 glob_example 4_post_processing/glob_example
6 glslc_example 4_post_processing/glslc_example
7 run_python 4_post_processing/run_python

5_testing_and_coverage

number examples directory
0 clang_coverage_example 5_testing_and_coverage/clang_coverage_example
1 ctest_example 5_testing_and_coverage/ctest_example
2 ctest_example2 5_testing_and_coverage/ctest_example2
3 doctest_example 5_testing_and_coverage/doctest_example
4 gcc_coverage_example 5_testing_and_coverage/gcc_coverage_example
5 gtest_ctest_example 5_testing_and_coverage/gtest_ctest_example
6 gtest_ctest_example2 5_testing_and_coverage/gtest_ctest_example2
7 gtest_example 5_testing_and_coverage/gtest_example
8 gtest_example2 5_testing_and_coverage/gtest_example2
9 gtest_example3 5_testing_and_coverage/gtest_example3
10 gtest_filter 5_testing_and_coverage/gtest_filter
11 test_coverage_example 5_testing_and_coverage/test_coverage_example
12 test_coverage_example2 5_testing_and_coverage/test_coverage_example2

6_bindings_and_documentation

number examples directory
0 csharp_winform_example 6_bindings_and_documentation/csharp_winform_example
1 csharp_wpf_example 6_bindings_and_documentation/csharp_wpf_example
2 c_call_python_example 6_bindings_and_documentation/c_call_python_example
3 doxygen_coverage_example 6_bindings_and_documentation/doxygen_coverage_example
4 doxygen_coverage_example2 6_bindings_and_documentation/doxygen_coverage_example2
5 doxygen_coverage_example3 6_bindings_and_documentation/doxygen_coverage_example3
6 doxygen_example 6_bindings_and_documentation/doxygen_example
7 doxygen_example2 6_bindings_and_documentation/doxygen_example2
8 jni_example 6_bindings_and_documentation/jni_example
9 jni_example2 6_bindings_and_documentation/jni_example2
10 mex_example 6_bindings_and_documentation/mex_example
11 pybind11_example1 6_bindings_and_documentation/pybind11_example1
12 pybind11_example2 6_bindings_and_documentation/pybind11_example2
13 swift_example 6_bindings_and_documentation/swift_example
14 windows_masm_example 6_bindings_and_documentation/windows_masm_example

7_debugging

number examples directory
0 debug_dependencies 7_debugging/debug_dependencies
1 sleek 7_debugging/sleek
2 vscode_debug_C++ 7_debugging/vscode_debug_C++

8_cmake_language

number examples directory
0 copy_dll_as_function 8_cmake_language/copy_dll_as_function
1 function_example1 8_cmake_language/function_example1
2 list_remove_example 8_cmake_language/list_remove_example
3 regex_replace_example 8_cmake_language/regex_replace_example

9_misc

number examples directory
0 cmake_format_usage 9_misc/cmake_format_usage
1 find_package_examples 9_misc/find_package_examples
2 generate_assemble_example 9_misc/generate_assemble_example
3 masm_example 9_misc/masm_example
4 modules 9_misc/modules
5 umake 9_misc/umake

Search

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

bash ./search.sh target

And get result:

./2_global_and_target_settings/compilation_database
./2_global_and_target_settings/postfix
./2_global_and_target_settings/flags_and_properties
./2_global_and_target_settings/flags_and_properties/msvc_runtime_mt_md_example
./2_global_and_target_settings/flags_and_properties/hpc_compute
./2_global_and_target_settings/flags_and_properties/compile_flag_example1
./2_global_and_target_settings/link_libraries
./2_global_and_target_settings/c++_standard
./2_global_and_target_settings/fPIC
./2_global_and_target_settings/configure_file
./2_global_and_target_settings/include_directories
./2_global_and_target_settings/sanitizers
./2_global_and_target_settings/sanitizers/thread_sanitizer_example
./2_global_and_target_settings/sanitizers/address_sanitizer_example
./2_global_and_target_settings/specify_output_name
./2_global_and_target_settings/cmake_options
./2_global_and_target_settings/cmake_options/option_example2
./2_global_and_target_settings/cmake_options/cmake_dependent_option
./2_global_and_target_settings/cmake_options/options_via_txt_example
./2_global_and_target_settings/cmake_options/option_example
./2_global_and_target_settings/build_type
./2_global_and_target_settings/debug_symbol_example
./2_global_and_target_settings/define_c_c++_macros

♥️ Thanks

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

Star History Chart

References

LICENSE

MIT

Acknowledgement

Proudly to gain one year license for all products from JetBrains.

More Repositories

1

awesome-ncnn

😎 A Collection of Awesome NCNN-based Projects
667
star
2

osask-linux

《30天自制操作系统》在Linux下的实践
C
95
star
3

smallcv

Lightweight Mat and imread()/imwrite()/imshow()
C
76
star
4

imageset-viewer

Pascal VOC BBox Viewer
Python
62
star
5

pixel

Image processing library for learning purpose
C
49
star
6

overlook

A CMake plugin for safer C/C++ programming
CMake
33
star
7

neon_sim

NEON intrinsics reference implementation in naive C
C
17
star
8

KantuCompare

Visual comparison for YUV and JPG/PNG images.
C++
12
star
9

HelloCpp

Learn CI/CD by doing.
CMake
11
star
10

cpp-moments

Records of learning/practising C++
C
10
star
11

ncnn-imgui-demo

GUI demo of deep neural network inference with ncnn and imgui
C++
9
star
12

py-caffe-cvprw15

Python Re-implementation of kevinlin311tw/caffe-cvprw15
Python
8
star
13

vscode-cmake-highlight

Syntax highlighting for CMake in Visual Studio Code
TypeScript
7
star
14

ean13-barcode-recognition

EAN13 bar recognition using OpenCV, GUI with Qt 1维条码识别
C++
4
star
15

opencv-build

Build opencv with github action! For VS2019 32/64 bit
Batchfile
4
star
16

clang-tidy-example

C++
3
star
17

skin_lesion_classification

A baseline model for ISBI ISIC2016 skin lesion classification contest
Python
3
star
18

min-repros

Minimal Reproduciable Examples for fundamental oss
C
2
star
19

Cyclical-Learing-Rates

A trial to reproduce the CLR algorithm
Python
2
star
20

Kamera

Get USB Camera resolutions and show video capture(windows)
C++
2
star
21

rust-ndk-example

Android console application example project based on rust & cargo-xdk
Rust
2
star
22

msbuild_export

Extract compile_commands.json from .sln files with Python
Python
1
star
23

pydemangler

CMake
1
star
24

vcpkg-registry

CMake
1
star
25

resnet-ncnn-pnnx-opencv-cpp

Convert PyTorch resnet50 to ncnn via pnnx, inference with C++ code, read image with OpenCV
Python
1
star