Project

General

Profile

Very nice framework, but...

Added by Alex Serebryakov over 2 years ago

Hi all!

I've downloaded source code. Built and installed by default. Test all examples, are okay. But I tried create my own simple "hello world" application using Wt, unfortunately get Wt not found.
Debian 11.
Additional I've found on github module FindWt.cmake. But still the same problem.
What's wrong?
Removed the Wt. :-(


Replies (2)

RE: Very nice framework, but... - Added by Alex Serebryakov over 2 years ago

Does framework provide simple example how can I create my own application using CMake? Without internal Wt's macros?

RE: Very nice framework, but... - Added by Roel Standaert over 2 years ago

Wt sticks to the standard modern CMake convention of installing CMake config files. This should work:

cmake_minimum_required(VERSION 3.16...3.21)

project(hello_wt_cmake)

find_package(Wt REQUIRED COMPONENTS Wt HTTP)

add_executable(hello.wt hello.cpp)
target_link_libraries(hello.wt PRIVATE Wt::Wt Wt::HTTP)

Then, if Wt is not installed in a standard location, you will have to use -DWt_DIR to specify the CMake config directory:

cmake ... -DWt_DIR=/path/to/wt/prefix/lib/cmake/wt ...
    (1-2/2)