[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Port from Debian to Windows: Include files not found
From:       Pau Garcia i Quiles <pgquiles () elpauer ! org>
Date:       2015-09-18 19:49:19
Message-ID: CAKcBoksyR3V_AtorftzK6ubtU76ReMVncAtR9qZvd+sqitqJtQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

You may need something like this in the toolchain file:

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)

set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)


On Fri, Sep 18, 2015 at 7:22 PM, Randy Turner <randallsturner13@gmail.com>
wrote:

> I am having trouble building a Code Composer Studio project with CMake.
> Executing from the same directory in Linux compiles successfully, but in
> Linux it fails to find any included files that aren't in the same directory
> as the .c file that it's building. I can provide a relative path to help it
> move on, but it will just fail to find the files referenced by that one.
>
> The very first #include of the project is <stdbool.h> which is located in
> the compiler's install files. As shown in my StackOVerflow question about
> this issue (
> http://stackoverflow.com/questions/32591626/cmake-header-files-cannot-be-opened)
> I can confirm that the files are in the directory that is included in the
> CMakeLists.txt file and can be found while CMake is executing, but fail to
> be located by make. I am using MinGW's make, and using the commands make
> and mingw32-make both ellicit the same result, "fatal error: could not open
> source file "stdbool.h" (no directories in search list)."
>
> Is there something that I'm missing here? Is something else necessary
> beyond using INCLUDE_DIRECTORIES for all of the directories in the project?
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

[Attachment #5 (text/html)]

<div dir="ltr">Hello,<div><br></div><div>You may need something like this in the \
toolchain file:</div><div><br></div><div>



<div>
<span style="font-family:monospace"><span style="color:rgb(0,0,0)"># search for \
programs in the build host directories \
</span><br>SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)</span></div><div><span \
style="font-family:monospace"><br># for libraries and headers in the target \
directories <br>SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
<br>SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
<br>
<br>set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)<br>
<br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On \
Fri, Sep 18, 2015 at 7:22 PM, Randy Turner <span dir="ltr">&lt;<a \
href="mailto:randallsturner13@gmail.com" \
target="_blank">randallsturner13@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">I am having trouble building a Code Composer \
Studio project with CMake. Executing from the same directory in Linux compiles \
successfully, but in Linux it fails to find any included files that aren&#39;t in the \
same directory as the .c file that it&#39;s building. I can provide a relative path \
to help it move on, but it will just fail to find the files referenced by that one.  \
<div><br></div><div>The very first #include of the project is &lt;stdbool.h&gt; which \
is located in the compiler&#39;s install files. As shown in my StackOVerflow question \
about this issue (<a \
href="http://stackoverflow.com/questions/32591626/cmake-header-files-cannot-be-opened" \
target="_blank">http://stackoverflow.com/questions/32591626/cmake-header-files-cannot-be-opened</a>) \
I can confirm that the files are in the directory that is included in the \
CMakeLists.txt file and can be found while CMake is executing, but fail to be located \
by make. I am using MinGW&#39;s make, and using the commands make and mingw32-make \
both ellicit the same result, &quot;fatal error: could not open source file \
&quot;stdbool.h&quot; (no directories in search \
list).&quot;</div><div><br></div><div>Is there something that I&#39;m missing here? \
Is something else necessary beyond using INCLUDE_DIRECTORIES for all of the \
directories in the project?</div></div> <br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" \
target="_blank">www.kitware.com</a><br> <br>
Please keep messages on-topic and check the CMake FAQ at: <a \
href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" \
target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br> <br>
Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:<br> <br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/support.html</a><br> CMake Consulting: <a \
href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/consulting.html</a><br> CMake Training \
Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/training.html</a><br> <br>
Visit other Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" \
target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br><br \
clear="all"><div><br></div>-- <br><div class="gmail_signature">Pau Garcia i \
Quiles<br><a href="http://www.elpauer.org" \
target="_blank">http://www.elpauer.org</a><br>(Due to my workload, I may need 10 days \
to answer)</div> </div>



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic