<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Add subdir and library in CmakeList.txt</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Is it possible to include a SUBDIR list as well as a library in one CMakeList.txt file?</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I want to be able to build a library in the current directory, as well as call the CMakeList.txt file in 2 subdirectories.&nbsp; My CMakeList.txt file looks like:</FONT></P>
<UL>
<P><FONT SIZE=2 FACE="Arial">SUBDIRS(dir1 dir2)</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">SET(SOURCES &lt;file list&gt; )</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">ADD_LIBRARY(libname SHARED ${SOURCES})</FONT>
</P>
</UL>
<P><FONT SIZE=2 FACE="Arial">But when I run cmake, I get messages looking for the files listed in the subdirectories, rather than the current directory:</FONT></P>
<UL>
<P><FONT SIZE=2 FACE="Courier New">CMake Error: can not find file /home/cmake_demo/current_dir/dir1/file1.c</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">Tried .c .C .c++ .cc .cpp .cxx .m .M .mm .h .h++ .hm .hpp .hxx .in .txx</FONT>
</P>
</UL>
<P><FONT SIZE=2 FACE="Arial">Is this possible?&nbsp; If not, how do I build the library in current dir?&nbsp; How do I say I also want to build subdirectories?&nbsp; I tried using the PREORDER flag in the SUBDIRS statement since I want to build those first, that that didn't seem to help at all.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Thanks!</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Kathy</FONT>
</P>

</BODY>
</HTML>