[CMake] Including a header file fails

John Drescher drescherjm at gmail.com
Tue Mar 1 14:18:11 EST 2011


On Tue, Mar 1, 2011 at 2:15 PM, Enrique Izaguirre
<enrique.izaguirre at gmail.com> wrote:
> Sorry, I didn't explain correctly.
>
> All the source files are in variable ${hostFiles}
> and I generated and executable using add_executable (myprj ${hostFiles})
> now I need to add the w32api folder from Windows, which has header files
> called from one of the source files contained in ${hostFiles} and are
> located in
>
> ${MYPRJ_SOURCE_DIR}/../../../usr/include/w32api
>
> How can I do this?
>

You add the appropriate

include_directories()

command in CMake. If that header requires linking to a Microsoft
library then you do add the Microsoft library to the
target_link_libraries not the header file.

John


More information about the CMake mailing list