Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Disclaimer: My answer is of philosophical nature which should encourage you to avoid touching CMAKE_C_FLAGS directly. For the direct answer that just solves your problem look what Bill ( <a href="http://www.kitware.com/company/team/hoffman.html" rel="noreferrer">the lead architect of the CMake btw.</a> ) wrote.</p> <p>The thing about CMake is, that it lets you describe what you want to do without referring to a specific compiler or platform. What CMake does is building the compiler and linker flags from your usage of</p> <ul> <li>include_directories</li> <li>add_definitions</li> <li>add_library</li> <li>add_executable</li> <li>target_link_libraries</li> </ul> <p>If there are no external dependencies, other than the compiler itself, this is all you need. For external dependencies use find_package It defines a set of variables, like</p> <ul> <li>find_package(SDL)</li> </ul> <p>defines</p> <ul> <li>SDL_INCLUDE_DIR</li> <li>SDL_LIBRARY</li> </ul> <p>for usage with respectively include_directories and target_link_libraries. CMake ships with a bunch of so called module files, like FindSDL.cmake and many others can be googled. </p> <p>The next lower level is to use</p> <ul> <li>find_path</li> <li>find_library</li> </ul> <p>which are used in the Find???.cmake modules itself. </p> <p>The CMAKE_C_FLAGS variable is composed by CMake from these commands. Modifying it means you bypass CMake. There are cases, like for special optimization flags, you want to do this, but at this point all power and thus responsibility transfered from CMake to you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload