Hello All,<br><br>I have a project in directory XYZ. The directory has the<br>following structure<br><br>XYZ<br>- include<br>- sources<br>- examples<br>&nbsp; - example_program1<br>&nbsp; - example_program2<br>&nbsp; - example_program3<br>
- tools<br>&nbsp; - tool1<br><br>When I use the following CMakeLists.txt file set on Linux;<br>run cmake and make I notice that it works as expected.<br>I get a libxyz.a file, xyztool, example_program1, example_program2<br>and example_program3 executables. 
<br><br>However when I use the same CMakeLists.txt file set on <br>Windows XP, and use cmake to generate a Visual Studio <br>6.0 workspace; and select Build -&gt; Build (F7) only xyz.lib<br>and xyztool.exe are created. The example programs are
<br>not compiled and linked.<br><br>I have pasted the structure of my CMakeLists.txt files below.<br>I dont understand this difference between Linux and Windows.<br>Am I missing something ? Please help.<br><br>I have a CMakeLists.txt
 file in XYZ which looks like this<br>--------------<br># File: XYZ/CMakeLists.txt<br><br>PROJECT(XYZ)<br><br>INCLUDE_DIRECTORIES(<br>${XYZ_SOURCE_DIR}/include<br>)<br><br>LINK_DIRECTORIES(<br>
${XYZ_BINARY_DIR}/<br>
)<br>
<br>ADD_LIBRARY(xyz STATIC<br>... &lt; all the cpp files go here &gt;<br>...<br>...<br>)<br><br>ADD_SUBDIRECTORY(tools)<br>ADD_SUBDIRECTORY(examples)<br>--------------<br><br clear="all">The tools/CMakeLists.txt looks like this
<br>--------------<br># File: tools/CMakeLists.txt<br><br>ADD_SUBDIRECTORY(tool1)<br>--------------<br><br>And tool1/CMakeLists.txt looks like this<br>--------------<br># File: tools/tool1/CMakeLists.txt<br><br>ADD_EXECUTABLE(xyztool
<br>&lt;cpp file list&gt;<br>)<br><br>TARGET_LINK_LIBRARIES(xyztool xyz)<br>--------------<br><br>examples/CMakeLists.txt<br>The tools/CMakeLists.txt looks like this<br>
--------------<br>
# File: examples/CMakeLists.txt<br>
<br>
ADD_SUBDIRECTORY(example_program1)<br>
ADD_SUBDIRECTORY(example_program2)<br>
ADD_SUBDIRECTORY(example_program3)<br>--------------<br>
<br>The example_program[123] directories have their CMakeLists.txt similar to <br>the tools/tool1/CMakeLists.txt file.<br><br>--------------<br>
# File: examples/example_program1/CMakeLists.txt<br>
<br>
ADD_EXECUTABLE(example_program1<br>
&lt;cpp file list&gt;<br>
)<br>
<br>
TARGET_LINK_LIBRARIES(example_program1 xyz)<br>
--------------<br>
<br>
--------------<br>

# File: examples/example_program2/CMakeLists.txt<br>

<br>

ADD_EXECUTABLE(example_program2<br>

&lt;cpp file list&gt;<br>

)<br>

<br>

TARGET_LINK_LIBRARIES(example_program2 xyz)<br>

--------------<br><br><br>
--------------<br>

# File: examples/example_program1/CMakeLists.txt<br>

<br>

ADD_EXECUTABLE(example_program3<br>

&lt;cpp file list&gt;<br>

)<br>

<br>

TARGET_LINK_LIBRARIES(example_program3 xyz)<br>

--------------<br><br>--<br>Thanks and Warm Regards,<br>Prashanth N Udupa<br><br>