modern camke

Modern Cmake

Modern CMake is defined around Target and Property , and strives to avoid the definition of variable. Variable rampant is a typical style of CMake2.8 period. The modern version of CMake is more like following the rules of OOP, restricting the scope of link, compile and other related attributes through targets. If you think of a Target as an Object , you will find that the organization of the two is very similar:

  • Constructor:

    • add_executable
    • add_library
  • Member function:

    • get_target_property()
    • set_target_properties()
    • get_property(TARGET)
    • set_property(TARGET)
    • target_compile_definitions()
    • target_compile_features()
    • target_compile_options()
    • target_include_directories()
    • target_link_libraries()
    • target_sources()
  • Member variables

    • Target properties (too many)

Guess you like

Origin blog.csdn.net/ahelloyou/article/details/112982088