[CMake] Problem finding installed library on Windows platform
Michael Hertling
mhertling at online.de
Mon Jun 20 09:24:35 EDT 2011
On 06/20/2011 02:49 PM, Stephen Torri wrote:
> Subject: Finding libraries on Windows platform
>
> --------
>
> 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:
>
> IF(UNIX)
> FIND_PATH ( TARGET_INCLUDE_DIR interface.hpp /usr/include/target
> /usr/local/include/target)
> FIND_LIBRARY ( TARGET_LIBRARY NAMES target PATH /usr/lib /usr/local/lib)
> ELSE(UNIX)
> FIND_PATH ( TARGET_INCLUDE_DIR interface.hpp
> $ENV{TARGET_INCLUDE_DIR}
> "C:/Program Files/target/include"
> "C:/Program Files (x86)/target/include"
> "C:/Program Files (x86)/target 1.0.0/include"
> DOC "If you installed Target where did you install it?" )
>
> FIND_LIBRARY ( TARGET_LIBRARY NAMES sgp4 PATH
FIND_LIBRARY ( TARGET_LIBRARY NAMES sgp4 PATHS
-----^-
Perhaps that typo?
Regards,
Michael
> $ENV{TARGET_LIBRARY}
> "C:/Program Files/target"
> "C:/Program Files (x86)/target"
> "C:/Program Files (x86)/target 1.0.0" )
> ENDIF(UNIX)
>
> IF (TARGET_INCLUDE_DIR AND TARGET_LIBRARY)
> SET(TARGET_FOUND TRUE)
> ENDIF(TARGET_INCLUDE_DIR AND TARGET_LIBRARY)
>
> IF (TARGET_FOUND)
> IF (NOT target_FIND_QUIETLY)
> MESSAGE(STATUS "Found Target: ${TARGET_LIBRARY}")
> ENDIF (NOT target_FIND_QUIETLY)
> ELSE (TARGET_FOUND)
> IF (target_FIND_REQUIRED)
> MESSAGE(FATAL_ERROR "Could not find Target")
> ENDIF (target_FIND_REQUIRED)
> ENDIF (TARGET_FOUND)
>
> The macro is finding the include header fine but is always failing to find
> the library.
> Stephen
More information about the CMake
mailing list