<div>Subject: Finding libraries on Windows platform<br><br>--------<br><br>I am using CMake 2.8 on Windows XP to create a Visual Studio 2010 solution. The problem I am having is that I cannot get CMake to find libraries on the system. These libraries were created by us for other project. Here is the CMake module for finding one of those libraries:<br>
<br>IF(UNIX)<br> FIND_PATH ( TARGET_INCLUDE_DIR interface.hpp /usr/include/target /usr/local/include/target)<br> FIND_LIBRARY ( TARGET_LIBRARY NAMES target PATH /usr/lib /usr/local/lib)<br>ELSE(UNIX)<br> FIND_PATH ( TARGET_INCLUDE_DIR interface.hpp<br>
$ENV{TARGET_INCLUDE_DIR}<br> "C:/Program Files/target/include"<br> "C:/Program Files (x86)/target/include"<br> "C:/Program Files (x86)/target 1.0.0/include"<br> DOC "If you installed Target where did you install it?" )<br>
<br> FIND_LIBRARY ( TARGET_LIBRARY NAMES sgp4 PATH<br> $ENV{TARGET_LIBRARY}<br> "C:/Program Files/target"<br> "C:/Program Files (x86)/target"<br> "C:/Program Files (x86)/target 1.0.0" )<br>
ENDIF(UNIX)<br><br>IF (TARGET_INCLUDE_DIR AND TARGET_LIBRARY)<br> SET(TARGET_FOUND TRUE)<br>ENDIF(TARGET_INCLUDE_DIR AND TARGET_LIBRARY)<br><br>IF (TARGET_FOUND)<br> IF (NOT target_FIND_QUIETLY)<br> MESSAGE(STATUS "Found Target: ${TARGET_LIBRARY}")<br>
ENDIF (NOT target_FIND_QUIETLY)<br>ELSE (TARGET_FOUND)<br> IF (target_FIND_REQUIRED)<br> MESSAGE(FATAL_ERROR "Could not find Target")<br> ENDIF (target_FIND_REQUIRED)<br>ENDIF (TARGET_FOUND)<br><br>The macro is finding the include header fine but is always failing to find the library.<br>
</div>
<div>Stephen<br></div>