Added CMake Install.
This commit is contained in:
parent
5c8c4e86b2
commit
4367534a33
13 changed files with 68 additions and 18 deletions
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue