Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If <code>A</code> and <code>B</code> are different libraries containing different header files and paths, there should be no problem doing what you are doing right now.</p> <p>That being said, if <code>A</code> and <code>B</code> are similar libraries containing header files of the same name at the same location, that is problematic. In that case, the order of the <code>include_directory()</code> call is important. I ran a little test where I had three copies of a header file. The first copy is located in my system path (say <code>/usr/include</code>). The other copies are located in two user-defined locations (say <code>/tmp/include1</code> and <code>/tmp/include2</code>). The file in <code>/tmp/include1</code> is found and used first if I put the <code>include_directory()</code> call in the following order:</p> <pre><code>include_directory("/tmp/include1") include_directory("/tmp/include2") </code></pre> <p>The file in <code>/tmp/include2</code> is found and used first if I put the <code>include_directory()</code> call in the following order:</p> <pre><code>include_directory("/tmp/include2") include_directory("/tmp/include1") </code></pre> <p>If I put no <code>include_directory()</code> statement, then the header in the system path is found and used.</p> <p>You may want to re-check how your <code>FindSomething.cmake</code> are written. The search order of the <code>find_*()</code> CMake commands can be found in the <a href="http://cmake.org/cmake/help/cmake-2-8-docs.html#command%3afind_path" rel="nofollow">CMake documentation</a>,</p> <p>As far as I can remember, there is now way of telling CMake to use <code>${A_INCLUDE_DIRS}</code> for all headers from <code>A</code> and <code>${B_INCLUDE_DIRS}</code> for all headers from <code>B</code> if the header file can be found in both location. It all depends in what order the <code>include_directory()</code> call are made. If the <code>FindSomething.cmake</code> are written properly, if the <code>CMAKE_MODULE_PATH</code> (this is the location where CMake will look for the <code>Find*.cmake</code> files) is set properly and all the paths are good, then you should be good to go. If not, I will need more information on your current CMake/library setup.</p>
 

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