[CMake] Compiling header files

James C. Sutherland James.Sutherland at utah.edu
Tue Nov 16 14:32:50 EST 2010


Be sure that you have
  INCLUDE_DIRECTORIES( [path to Internal.h and External.h] )
set.

James


On Tue, Nov 16, 2010 at 12:24 PM, David Doria <daviddoria at gmail.com> wrote:

> Ryan,
>
> The issue is that these headers are only used internally to this
> collection of files, so I don't want to have to include them in my
> code. Here is a skeleton:
>
> The files I've been given
> ----------
> External.h
> External.cpp
> Internal.h (used by External)
> Internal.cpp
>
> My files
> ------------
> MyCode.cpp
>
> So I wanted to
>
> ADD_LIBRARY(TheLibrary External.cpp Internal.cpp)
>
> Then
>
> ADD_EXECUTABLE(MyCode MyCode.cpp)
> target_link_libraries(MyCode TheLibrary)
>
> where MyCode.cpp has only an #include "External.h"
>
> See what I mean?
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101116/ae9a9358/attachment-0001.htm>


More information about the CMake mailing list