Added CMake Install.

This commit is contained in:
Maurice Grönwoldt 2023-09-02 14:17:56 +02:00
commit 4367534a33
13 changed files with 68 additions and 18 deletions

View file

@ -7,9 +7,15 @@ add_executable(VWeb_Example main.cpp)
include_directories(${CMAKE_SOURCE_DIR}/..)
set(mode release)
set(mode Release)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(mode debug)
set(mode Debug)
endif ()
set(vweb_lib ${CMAKE_SOURCE_DIR}/../dist/libVWeb.${mode}.a)
SET_SOURCE_FILES_PROPERTIES(
main.cpp
PROPERTIES OBJECT_DEPENDS ${vweb_lib}
)
target_link_libraries(VWeb_Example Threads::Threads ${vweb_lib})

View file

@ -23,6 +23,8 @@ int main() {
using namespace VWeb;
VWeb::Server server;
auto& router = server.GetRouter();
// For debugging and profiling more than 1 thread can be hard.
server.GetServerConfig()->WorkerThreads = 1;
router->Get("/test", [](const Request&, Response& response) {
response << "NICE";
return true;