use cmake to find wt.

This commit is contained in:
luocai 2024-11-25 14:41:31 +08:00
parent 45321dc2a2
commit 3235d82f67
2 changed files with 7 additions and 10 deletions

View File

@ -11,10 +11,7 @@ set(MBEDTLS_ROOT ${Libraries_ROOT}/mbedtls-3.6.2)
set(MBEDTLS_INCLUDE_DIR ${MBEDTLS_ROOT}/include) set(MBEDTLS_INCLUDE_DIR ${MBEDTLS_ROOT}/include)
set(MBEDTLS_LIBRARY_DIRS ${MBEDTLS_ROOT}/lib) set(MBEDTLS_LIBRARY_DIRS ${MBEDTLS_ROOT}/lib)
set(WT_ROOT ${Libraries_ROOT}/wt-4.11.1) set(Wt_DIR ${Libraries_ROOT}/wt-4.11.1/lib/cmake/wt)
set(WT_INCLUDE_DIR ${WT_ROOT}/include)
set(WT_LIBRARY_DIRS ${WT_ROOT}/lib)
set(WT_LIBRARIES wt wttest wthttp wtdbo wtdbosqlite3)
set(NNG_ROOT ${Libraries_ROOT}/nng-1.9.0) set(NNG_ROOT ${Libraries_ROOT}/nng-1.9.0)
set(NNG_INCLUDE_DIR ${NNG_ROOT}/include) set(NNG_INCLUDE_DIR ${NNG_ROOT}/include)

View File

@ -1,3 +1,5 @@
find_package(Wt REQUIRED Wt)
add_library(WebApplication add_library(WebApplication
WebApplication.h WebApplication.cpp WebApplication.h WebApplication.cpp
LoginWidget.h LoginWidget.cpp LoginWidget.h LoginWidget.cpp
@ -10,14 +12,12 @@ add_library(WebApplication
target_include_directories(WebApplication target_include_directories(WebApplication
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${WT_INCLUDE_DIR}
)
target_link_directories(WebApplication
PUBLIC ${WT_LIBRARY_DIRS}
) )
target_link_libraries(WebApplication target_link_libraries(WebApplication
PRIVATE ${WT_LIBRARIES}
PUBLIC Universal PUBLIC Universal
PRIVATE Wt::Wt
PRIVATE Wt::Dbo
PRIVATE Wt::HTTP
PRIVATE Wt::DboSqlite3
) )