Project

General

Profile

Actions

Bug #2211

open

FindWt.cmake does not work

Added by Saif Rehman over 10 years ago. Updated over 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/12/2013
Due date:
% Done:

0%

Estimated time:

Description

Hi,

I tried using FindWt.cmake but it gives an error. I have both Release and Debug libs in my system. I've correctly set the include folder for Wt.

Here is the error:

CMake Error at CMake/FindWt.cmake:132 (MESSAGE):
  Could NOT find Wt
Call Stack (most recent call first):
  CMakeLists.txt:10 (FIND_PACKAGE)
Actions #1

Updated by Pau Garcia i Quiles over 10 years ago

Could you please provide more information?

E. g:

  • How did you install Wt (packages? build it yourself?)
  • Where is Wt installed (full path to bin, lib, include, etc folders)
  • What parameters did you use for CMake
  • Anything else you may consider useful

Thank you

Actions #2

Updated by Saif Rehman over 10 years ago

I used a git repo to clone a recent version and compiled/installed on Windows 7 Visual Studio 2012 with the x64 configuration in C:\Program Files\WT. The library and header folders are in C:\Program Files\WT.

On first cmake generation I get the error

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Wt_INCLUDE_DIR
   used as include directory in directory C:/Users/hp/WtProject

Then I tried generating with WT_INCLUDE_DIR set as "C:/Program Files/WT/include", "C:/Program Files/WT", "C:/Program Files/WT/lib" and each time I get the same error

CMake Error at CMake/FindWt.cmake:132 (MESSAGE):
  Could NOT find Wt
Call Stack (most recent call first):
  CMakeLists.txt:10 (FIND_PACKAGE)

I'm not sure but I think that none of the FIND_LIBRARY() in the .cmake file use WT_INCLUDE_DIR to find the libraries

Actions #3

Updated by Saif Rehman over 10 years ago

I edited the file to work with Windows and I also added MySQL and Firebird to the library look up. However is there a way to include boost in my own project using the same method Wt uses. This is to make sure same boost libraries are used with the Wt installation.

# Find Wt includes and libraries
#
# This script sets the following variables:
#
#  Wt_INCLUDE_DIR
#  Wt_LIBRARIES  - Release libraries
#  Wt_FOUND  - True if release libraries found
#  Wt_DEBUG_LIBRARIES  - Debug libraries
#  Wt_DEBUG_FOUND  - True if debug libraries found
#
# To direct the script to a particular Wt installation, use the
# standard cmake variables CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH
#
# To use this script to find Wt, when using the new style for include files:
#   #include <Wt/WLineEdit>
#   #include <Wt/Ext/LineEdit>
#   #include <Wt/Chart/WPieChart>
#
# include the following CMake snippet in your project:
#
#  FIND_PACKAGE( Wt REQUIRED )
#  INCLUDE_DIRECTORIES( ${Wt_INCLUDE_DIR} )
#  TARGET_LINK_LIBRARIES( yourexe
#    ${Wt_DEBUG_LIBRARY}        # or {Wt_LIBRARY}
#    ${Wt_HTTP_DEBUG_LIBRARY}   # or {Wt_HTTP_LIBRARY}
#    ${Wt_EXT_DEBUG_LIBRARY}    # or {Wt_EXT_LIBRARY}
#  )
#
# To use this script to find Wt, when using the old include style:
#   #include <WLineEdit>
#   #include <Ext/LineEdit>
#   #include <Chart/WPieChart>
# style of include files, change the INCLUDE_DIRECTORIES statement to:
#   INCLUDE_DIRECTORIES( ${Wt_INCLUDE_DIR} ${Wt_INCLUDE_DIR}/Wt )
#
#
#
#
# Copyright (c) 2007, Pau Garcia i Quiles, <pgquiles@elpauer.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

FIND_PATH( Wt_INCLUDE_DIR NAMES Wt/WObject PATHS ENV PATH ${Wt_PREFIX}/include PATH_SUFFIXES include wt )

SET( Wt_FIND_COMPONENTS Release Debug )

IF( Wt_INCLUDE_DIR )
        FIND_LIBRARY( Wt_LIBRARY NAMES wt PATHS PATH ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )
        FIND_LIBRARY( Wt_EXT_LIBRARY NAMES wtext PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )
        FIND_LIBRARY( Wt_HTTP_LIBRARY NAMES wthttp PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )
        FIND_LIBRARY( Wt_FCGI_LIBRARY NAMES wtfcgi PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )
        FIND_LIBRARY( Wt_DBO_LIBRARY NAMES wtdbo PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )
        FIND_LIBRARY( Wt_DBOSQLITE3_LIBRARY NAMES wtdbosqlite3 PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )
        FIND_LIBRARY( Wt_DBOPOSTGRES_LIBRARY NAMES wtdbopostgres PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )
        FIND_LIBRARY( Wt_DBOMYSQL_LIBRARY NAMES wtdbomysql PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )
        FIND_LIBRARY( Wt_DBOFIREBIRD_LIBRARY NAMES wtdbofirebird PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-release lib_release )

        FIND_LIBRARY( Wt_DEBUG_LIBRARY NAMES wtd wt PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib libd lib-debug lib_debug HINTS /usr/lib/debug/usr/lib)
        FIND_LIBRARY( Wt_EXT_DEBUG_LIBRARY NAMES wtextd wtext PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib libd lib-debug lib_debug HINTS /usr/lib/debug/usr/lib)
        FIND_LIBRARY( Wt_HTTP_DEBUG_LIBRARY NAMES wthttpd wthttp PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib libd lib-debug lib_debug HINTS /usr/lib/debug/usr/lib)
        FIND_LIBRARY( Wt_FCGI_DEBUG_LIBRARY NAMES wtfcgid wtfcgi PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib libd lib-debug lib_debug HINTS /usr/lib/debug/usr/lib)
        FIND_LIBRARY( Wt_DBO_DEBUG_LIBRARY NAMES wtdbod wtdbo PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-debug lib_debug HINTS /usr/lib/debug/usr/lib)
        FIND_LIBRARY( Wt_DBOSQLITE3_DEBUG_LIBRARY NAMES wtdbosqlite3d wtdbosqlite3 PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-debug lib_debug HINTS /usr/lib/debug/usr/lib)
        FIND_LIBRARY( Wt_DBOPOSTGRES_DEBUG_LIBRARY NAMES wtdbopostgresd wtdbopostgres PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-debug lib_debug HINTS /usr/lib/debug/usr/lib)
        FIND_LIBRARY( Wt_DBOMYSQL_DEBUG_LIBRARY NAMES wtdbomysqld wtdbomysql PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-debug lib_debug HINTS /usr/lib/debug/usr/lib )
        FIND_LIBRARY( Wt_DBOFIREBIRD_DEBUG_LIBRARY NAMES wtdbofirebirdd wtdbofirebird PATHS PATH  ${Wt_PREFIX}/lib PATH_SUFFIXES lib lib-debug lib_debug HINTS /usr/lib/debug/usr/lib )

        IF( Wt_LIBRARY )
            IF( Wt_HTTP_LIBRARY )
                SET( Wt_FOUND TRUE )
        SET( Wt_FIND_REQUIRED_Release TRUE )
                SET( Wt_LIBRARIES ${Wt_HTTP_LIBRARY} ${Wt_LIBRARY} )

        IF( Wt_FCGI_LIBRARY )
                    SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_FCGI_LIBRARY} )
        ENDIF( Wt_FCGI_LIBRARY )
        ELSE( Wt_HTTP_LIBRARY )
        IF( Wt_FCGI_LIBRARY )
                    SET( Wt_FOUND TRUE )
            SET( Wt_FIND_REQUIRED_Release TRUE )
                    SET( Wt_LIBRARIES ${Wt_FCGI_LIBRARY} ${Wt_LIBRARY} )
        ENDIF( Wt_FCGI_LIBRARY )
            ENDIF( Wt_HTTP_LIBRARY )
        ENDIF( Wt_LIBRARY )

        IF( Wt_EXT_LIBRARY )
        SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_EXT_LIBRARY} )
        ENDIF( Wt_EXT_LIBRARY )

        IF( Wt_DBO_LIBRARY )
        SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_DBO_LIBRARY} )
        IF( Wt_DBOSQLITE3_LIBRARY )
        SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_DBOSQLITE3_LIBRARY} )
        ENDIF( Wt_DBOSQLITE3_LIBRARY )
        IF( Wt_DBOPOSTGRES_LIBRARY )
        SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_DBOPOSTGRES_LIBRARY} )
        ENDIF( Wt_DBOPOSTGRES_LIBRARY )
        IF( Wt_DBOMYSQL_LIBRARY )
        SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_DBOMYSQL_LIBRARY} )
        ENDIF( Wt_DBOMYSQL_LIBRARY )
        IF( Wt_DBOFIREBIRD_LIBRARY )
        SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_DBOFIREBIRD_LIBRARY} )
        ENDIF( Wt_DBOFIREBIRD_LIBRARY )
        ENDIF( Wt_DBO_LIBRARY )

        IF( Wt_DEBUG_LIBRARY )
        IF ( Wt_HTTP_DEBUG_LIBRARY)
                SET( Wt_DEBUG_FOUND TRUE )
        SET( Wt_FIND_REQUIRED_Debug TRUE )
                SET( Wt_DEBUG_LIBRARIES ${Wt_HTTP_DEBUG_LIBRARY} ${Wt_DEBUG_LIBRARY} )

        IF( Wt_FCGI_DEBUG_LIBRARY )
                    SET( Wt_DEBUG_LIBRARIES ${Wt_DEBUG_LIBRARIES} ${Wt_FCGI_DEBUG_LIBRARY} )
        ENDIF( Wt_FCGI_DEBUG_LIBRARY )
        ELSE( Wt_HTTP_DEBUG_LIBRARY )
            IF( Wt_FCGI_DEBUG_LIBRARY )
                    SET( Wt_DEBUG_FOUND TRUE )
            SET( Wt_FIND_REQUIRED_Debug TRUE )
                    SET( Wt_DEBUG_LIBRARIES ${Wt_FCGI_DEBUG_LIBRARY} ${Wt_DEBUG_LIBRARY} )
        ENDIF( Wt_FCGI_DEBUG_LIBRARY )
        ENDIF( Wt_HTTP_DEBUG_LIBRARY)       
        ENDIF( Wt_DEBUG_LIBRARY )

         IF( Wt_DBO_DEBUG_LIBRARY )
        SET( Wt_DEBUG_LIBRARIES ${Wt_DEBUG_LIBRARIES} ${Wt_DBO_DEBUG_LIBRARY} )
        IF( Wt_DBOSQLITE3_DEBUG_LIBRARY )
            SET( Wt_DEBUG_LIBRARIES ${Wt_DEBUG_LIBRARIES} ${Wt_DBOSQLITE3_DEBUG_LIBRARY} )
        ENDIF( Wt_DBOSQLITE3_DEBUG_LIBRARY )
        IF( Wt_DBOPOSTGRES_DEBUG_LIBRARY )
            SET( Wt_DEBUG_LIBRARIES ${Wt_DEBUG_LIBRARIES} ${Wt_DBOPOSTGRES_DEBUG_LIBRARY} )
        ENDIF( Wt_DBOPOSTGRES_DEBUG_LIBRARY )
        IF( Wt_DBOMYSQL_DEBUG_LIBRARY )
            SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_DBOMYSQL_DEBUG_LIBRARY} )
        ENDIF( Wt_DBOMYSQL_DEBUG_LIBRARY )
        IF( Wt_DBOFIREBIRD_DEBUG_LIBRARY )
            SET( Wt_LIBRARIES ${Wt_LIBRARIES} ${Wt_DBOFIREBIRD_DEBUG_LIBRARY} )
        ENDIF( Wt_DBOFIREBIRD_DEBUG_LIBRARY )
        ENDIF( Wt_DBO_DEBUG_LIBRARY )

        IF(Wt_FOUND)
                IF (NOT Wt_FIND_QUIETLY)
                        MESSAGE(STATUS "Found the Wt libraries at ${Wt_LIBRARIES}")
                        MESSAGE(STATUS "Found the Wt headers at ${Wt_INCLUDE_DIR}")
                ENDIF (NOT Wt_FIND_QUIETLY)
        ELSE(Wt_FOUND)
                IF(Wt_FIND_REQUIRED)
                        MESSAGE(FATAL_ERROR "Could NOT find Wt")
                ENDIF(Wt_FIND_REQUIRED)
        ENDIF(Wt_FOUND)

        IF(Wt_DEBUG_FOUND)
                IF (NOT Wt_FIND_QUIETLY)
                        MESSAGE(STATUS "Found the Wt debug libraries at ${Wt_DEBUG_LIBRARIES}")
                        MESSAGE(STATUS "Found the Wt debug headers at ${Wt_INCLUDE_DIR}")
                ENDIF (NOT Wt_FIND_QUIETLY)
        ELSE(Wt_DEBUG_FOUND)
                IF(Wt_FIND_REQUIRED_Debug)
                        MESSAGE(FATAL_ERROR "Could NOT find Wt debug libraries")
                ENDIF(Wt_FIND_REQUIRED_Debug)
        ENDIF(Wt_DEBUG_FOUND)

ENDIF( Wt_INCLUDE_DIR )
Actions

Also available in: Atom PDF