<div><div dir="ltr"><div style="padding-top: 10px; padding-right: 0pt; padding-bottom: 5px; padding-left: 0pt; "><font class="Apple-style-span" color="#999999"><meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80); font-family: arial, sans-serif; font-size: 13px; "><font face="georgia, serif">greetings!</font><div>
<div><font face="georgia, serif"><br></font></div><div><font face="georgia, serif">I spent enough time trying to make the software work,<br>so I&#39;d be happy to get some feedback::</font></div><div><pre style="white-space: pre-wrap; ">
<font face="georgia, serif">I built research code written in (templated) c++, size is approximately 
~15K lines. I am on a mac and do not use Cocoa(/xcode), straight from 
command line. Note that I choose to generate a Unix makefile, not an 
xcode project and I am </font><span style="border-collapse: collapse; font-family: arial, sans-serif; white-space: normal; ">on snow leopard 10.6.5 w/ g++ 4.2.1</span><span style="font-family: georgia, serif; ">.</span></pre>
<pre style="white-space: pre-wrap; "><font face="georgia, serif">The pain was that there were no makefile coming along w/ the project, 
so I had to translate the *.vcproj file from scratch to CMakelists and 
then convert it to makefile. My directories structure (directories marked 
w/ DIR_ else are files, indentation denotes deeper level):: 

</font></pre><pre style="white-space: pre-wrap; "><font size="3" color="#660000">DIR_4DMPU_exampleTest
      
      4DMPU_example.cpp
      DIR_ann_1.1.2 </font></pre><pre style="white-space: pre-wrap; "><font color="#660000"><font size="3">      </font><span style="font-size: medium; ">DIR_</span><span style="font-size: medium; ">cmake
      CMakeLists.txt
      FindANN.cmake
          Modules
              FindANN.cmake

      DIR_include
      
</span><span style="font-size: medium; ">      DIR_</span><span style="font-size: medium; ">mc4d_tables
          num_tet_table.cpp
          tet_table.cpp
          vert_table.cpp   </span></font></pre><pre style="white-space: pre-wrap; "><span style="font-size: medium; "><font color="#660000">
DIR_4DMPU_exampleTestBin
</font></span></pre><pre style="white-space: pre-wrap; "><span style="font-size: medium; ">
<font face="Times">In the cmake GUI I add:</font></span></pre><pre style="white-space: pre-wrap; font-family: Times; font-size: medium; "><i><font color="#660000">ANN_LIBRARY            /Users/nikos/Downloads/4DMPU_exampleTest/ann_1.1.2/include 
ANN_INCLUDE_DIR /Users/nikos/Downloads/4DMPU_exampleTest/ann_1.1.2/lib/libANN.a</font></i></pre><pre style="white-space: pre-wrap; "><font face="Times" size="3"><i><span style="font-family: arial; font-size: small; font-style: normal; white-space: normal; "><pre style="white-space: pre-wrap; ">
<span style="font-family: Times; font-size: medium; "><br></span></pre><pre style="white-space: pre-wrap; "><span style="font-family: Times; font-size: medium; ">My CMakeLists.txt is:: </span></pre></span></i></font></pre>
<pre style="white-space: pre-wrap; "><font face="Times" size="3" color="#660000"><i>cmake_minimum_required(VERSION 2.8)
project( 4DMPU_example )

SET (CMAKE_BUILD_TYPE DEBUG)

set(SOURCE_FILES
        4DMPU_example.cpp
        mc4d_tables/num_tet_table.cpp
        mc4d_tables/tet_table.cpp
        mc4d_tables/vert_table.cpp
)

set(INCLUDE_FILES
        include/4dtables.h
        include/ann_helper.h
                   ...                     # more headers</i></font></pre><pre style="white-space: pre-wrap; "><font face="Times" size="3" color="#660000"><i>        include/Volume.h ann_1.1.2/include
        include/VolumeIO.h
)</i></font></pre><pre style="white-space: pre-wrap; "><font face="Times" size="3"><i><font color="#660000">include_directories( 
  ${PROJECT_SOURCE_DIR}/ann_1.1.2/include
  ${PROJECT_SOURCE_DIR}/ann_1.1.2/lib
  include
)

INCLUDE(FindANN.cmake)
IF(ANN_FOUND)
  INCLUDE_DIRECTORIES( ${ANN_INCLUDE_DIR} )
ENDIF(ANN_FOUND)

set(LIBS ${LIBS} ${ANN_LIBRARY})

add_executable( 4DMPU_example ${SOURCE_FILES} )
target_link_libraries( 4DMPU_example ${LIBS} )
</font></i>
</font></pre><pre style="white-space: pre-wrap; "><font face="Times" size="3">and the content of the FindANN.cmake::

</font></pre><pre style="white-space: pre-wrap; "><font face="Times" size="3" color="#660000"><i>FIND_LIBRARY(ANN_LIBRARY lANN        
        ${PROJECT_SOURCE_DIR}/ann_1.1.2/lib
         )
FIND_PATH( ANN_INCLUDE_DIR ANN/ANN.h ANN/ANNperf.h ANN/ANNx.h 
           ${PROJECT_SOURCE_DIR}/ann_1.1.2/include
               )

IF(ANN_LIBRARY)
  IF(ANN_INCLUDE_DIR)
        SET(ANN_FOUND TRUE)
  ENDIF(ANN_INCLUDE_DIR)
ENDIF(ANN_LIBRARY)</i></font></pre><pre style="white-space: pre-wrap; "><span style="font-family: Times; font-size: medium; "><br></span></pre><pre style="white-space: pre-wrap; "><span style="font-family: Times; font-size: medium; ">The project compiles fine this way.

Now, if I </span><span style="font-family: arial; white-space: normal; ">follow the advice below</span></pre><div><a href="http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Using_external_libraries_in_your_project" target="_blank" style="color: rgb(7, 77, 143); ">http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Using_external_libraries_in_your_project</a> ,</div>
<pre style="white-space: pre-wrap; "><span style="font-family: Times; font-size: medium; ">add the line</span></pre><pre style="white-space: pre-wrap; "><font face="Times" size="3"><i><font color="#660000">set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} &quot;${CMAKE_SOURCE_DIR}/cmake/Modules/&quot;)
</font>
</i>and moreover substitute</font></pre><pre style="white-space: pre-wrap; "><font face="Times" size="3"><span style="font-family: arial; font-size: small; white-space: normal; "><pre style="white-space: pre-wrap; "><i><font face="Times" size="3" color="#660000">include_directories( 
  ${PROJECT_SOURCE_DIR}/ann_1.1.2/include
  ${PROJECT_SOURCE_DIR}/ann_1.1.2/lib
  include
) </font><span style="font-family: Times; font-size: medium; ">
</span></i></pre><div><font face="Times" size="3">with </font></div></span></font></pre><pre style="white-space: pre-wrap; "><font face="Times" size="3"><i><font color="#660000">find_package(ANN REQUIRED)
include_directories(${ANN_INCLUDE_DIR}
        include
)
</font>
</i></font><span style="font-family: Times; font-size: medium; ">into CMakeLists.txt I get a linking problem. 
I do not reproduce the message, the point is that the ANN library is not linked
w/ my object files. Can anyone tell me what I am doing wrong in the 2nd case? </span></pre><pre style="white-space: pre-wrap; "><span style="font-family: Times; font-size: medium; ">
Note also that in the </span><span style="font-family: Times; font-size: medium; ">2nd case I explicitly add</span><span style="font-family: Times; font-size: medium; ">::
</span><span style="font-family: Times; font-size: medium; ">
<i><font color="#660000">ANN_DIR            /Users/nikos/Downloads/4DMPU_exampleTest/<i><span style="font-family: arial; font-size: small; white-space: normal; "><i><pre style="white-space: pre-wrap; display: inline !important; ">
<span style="font-family: Times; font-size: medium; ">cmake/Modules</span></pre> </i></span></i><br></font></i></span><span style="font-family: Times; font-size: medium; "><i> 
</i></span><span style="font-family: arial; white-space: normal; "><i><span style="font-style: normal; "><pre style="white-space: pre-wrap; display: inline !important; "><span style="font-family: Times; font-size: medium; ">in the cmake GUI.  </span></pre>
</span></i></span></pre><div><i><span style="font-style: normal; "><pre style="white-space: pre-wrap; "><span style="font-family: Times; font-size: medium; "><br></span></pre><pre style="white-space: pre-wrap; "><span style="font-family: Times; font-size: medium; ">cheers</span></pre>
<pre style="white-space: pre-wrap; "><font face="Times" size="3"><br></font></pre></span></i></div></div><div>N</div></div></span></font><font color="#999999"></font></div></div><br></div>