<div><br></div><div>** Apologies for double-posting my earlier message got truncated **</div><div><br></div><div>greetings!</div><div><br></div><div>I spent enough time trying to make the software work,</div><div>so I&#39;d be happy to get some feedback::</div>
<div>I built research code written in (templated) c++, size is approximately </div><div>~15K lines. I am on a mac and do not use Cocoa(/xcode), straight from </div><div>command line. Note that I choose to generate a Unix makefile, not an </div>
<div>xcode project and I am on snow leopard 10.6.5 w/ g++ 4.2.1.</div><div>The pain was that there were no makefile coming along w/ the project, </div><div>so I had to translate the *.vcproj file from scratch to CMakelists and </div>
<div>then convert it to makefile. My directories structure (directories marked </div><div>w/ DIR_ else are files, indentation denotes deeper level):: </div><div><br></div><div>DIR_4DMPU_exampleTest</div><div>      </div><div>
      4DMPU_example.cpp</div><div>      DIR_ann_1.1.2 </div><div>      DIR_cmake</div><div>      CMakeLists.txt</div><div>      FindANN.cmake</div><div>          Modules</div><div>              FindANN.cmake</div><div><br>
</div><div>      DIR_include</div><div>      </div><div>      DIR_mc4d_tables</div><div>          num_tet_table.cpp</div><div>          tet_table.cpp</div><div>          vert_table.cpp   </div><div><br></div><div>DIR_4DMPU_exampleTestBin</div>
<div><br></div><div>In the cmake GUI I add:</div><div>ANN_LIBRARY                  /Users/nikos/Downloads/4DMPU_exampleTest/ann_1.1.2/include</div><div>ANN_INCLUDE_DIR         /Users/nikos/Downloads/4DMPU_exampleTest/ann_1.1.2/lib/libANN.a</div>
<div><br></div><div>My CMakeLists.txt is::</div><div><br></div><div>cmake_minimum_required(VERSION 2.8)</div><div>project( 4DMPU_example )</div><div><br></div><div>SET (CMAKE_BUILD_TYPE DEBUG)</div><div><br></div><div>set(SOURCE_FILES</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>4DMPU_example.cpp</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>mc4d_tables/num_tet_table.cpp</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>mc4d_tables/tet_table.cpp</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>mc4d_tables/vert_table.cpp</div><div>)</div><div><br></div><div>set(INCLUDE_FILES</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>include/4dtables.h</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>include/ann_helper.h</div><div>                   ...                     # more headers</div><div>        include/Volume.h ann_1.1.2/include</div><div>        include/VolumeIO.h</div>
<div>)</div><div><br></div><div>include_directories( </div><div>  ${PROJECT_SOURCE_DIR}/ann_1.1.2/include</div><div>  ${PROJECT_SOURCE_DIR}/ann_1.1.2/lib</div><div>  include</div><div>)</div><div><br></div><div>INCLUDE(FindANN.cmake)</div>
<div>IF(ANN_FOUND)</div><div>  INCLUDE_DIRECTORIES( ${ANN_INCLUDE_DIR} )</div><div>ENDIF(ANN_FOUND)</div><div><br></div><div>set(LIBS ${LIBS} ${ANN_LIBRARY})</div><div><br></div><div>add_executable( 4DMPU_example ${SOURCE_FILES} )</div>
<div>target_link_libraries( 4DMPU_example ${LIBS} )</div><div><br></div><div>and the content of the FindANN.cmake::</div><div><br></div><div>FIND_LIBRARY(ANN_LIBRARY lANN<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>${PROJECT_SOURCE_DIR}/ann_1.1.2/lib</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>)</div><div>FIND_PATH( ANN_INCLUDE_DIR ANN/ANN.h ANN/ANNperf.h ANN/ANNx.h </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>   ${PROJECT_SOURCE_DIR}/ann_1.1.2/include</div><div>    <span class="Apple-tab-span" style="white-space:pre">        </span>   )</div><div><br></div><div>IF(ANN_LIBRARY)</div>
<div>  IF(ANN_INCLUDE_DIR)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>SET(ANN_FOUND TRUE)</div><div>  ENDIF(ANN_INCLUDE_DIR)</div><div>ENDIF(ANN_LIBRARY)</div><div><br></div><div>The project compiles fine this way.</div>
<div><br></div><div>Now, the problem is that if I follow the advice below</div><div><br></div><div><a href="http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Using_external_libraries_in_your_project">http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Using_external_libraries_in_your_project</a></div>
<div><br></div><div>and add the line</div><div><br></div><div>set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} &quot;${CMAKE_SOURCE_DIR}/cmake/Modules/&quot;)</div><div><br></div><div>and, moreover, substitute</div><div><br></div>
<div>include_directories( </div><div>  ${PROJECT_SOURCE_DIR}/ann_1.1.2/include</div><div>  ${PROJECT_SOURCE_DIR}/ann_1.1.2/lib</div><div>  include</div><div>)</div><div><br></div><div>with</div><div><br></div><div>find_package(ANN REQUIRED)</div>
<div>include_directories(${ANN_INCLUDE_DIR}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>include</div><div>)</div><div><br></div><div>into CMakeLists.txt I get a linking problem. </div><div>I do not reproduce the message -&gt; the point is that the ANN library is not linked</div>
<div>w/ my object files. Can anyone tell me what I am doing wrong in the 2nd case? </div><div><br></div><div>Note also that in the 2nd case I explicitly add::</div><div><br></div><div>ANN_DIR            /Users/nikos/Downloads/4DMPU_exampleTest/cmake/Modules </div>
<div> </div><div>in the cmake GUI.  </div><div><br></div><div><br></div><div>Thanks for any pointers</div><div dir="ltr"><div style="padding-top:10px;padding-right:0pt;padding-bottom:5px;padding-left:0pt;font-family:arial, sans-serif;font-size:13.3px">
<span style="font-family:arial;font-size:small"><div dir="ltr"><div style="padding-top:10px;padding-right:0pt;padding-bottom:5px;padding-left:0pt;font-family:arial, sans-serif;font-size:13.3px"><span style="font-family:arial;font-size:small">N</span></div>
</div></span></div></div>