
cpp-pistache-server.cmake.mustache Maven / Gradle / Ivy
cmake_minimum_required (VERSION 3.2)
project(server)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pg -g3" )
{{#addExternalLibs}}
include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external)
ExternalProject_Add(PISTACHE
GIT_REPOSITORY https://github.com/oktal/pistache.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
ExternalProject_Add(NLOHMANN
GIT_REPOSITORY https://github.com/nlohmann/json.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include/nlohmann)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
{{/addExternalLibs}}
link_directories(/usr/local/lib/)
aux_source_directory(model MODEL_SOURCES)
{{=<% %>=}}
<%#apiInfo.apis%>
<%#operations%>
file(GLOB <%classnameSnakeUpperCase%>_SOURCES
"api/<%classname%>.h"
"api/<%classname%>.cpp"
"impl/<%classname%>Impl.h"
"impl/<%classname%>Impl.cpp"
)
<%/operations%>
<%/apiInfo.apis%>
include_directories(model)
include_directories(api)
include_directories(impl)
<%#apiInfo.apis%>
<%#operations%>
set(<%classnameSnakeUpperCase%>_SERVER_SOURCES
<%classname%>MainServer.cpp
${MODEL_SOURCES}
${<%classnameSnakeUpperCase%>_SOURCES})
<%/operations%>
<%/apiInfo.apis%>
<%#apiInfo.apis%>
<%#operations%>
add_executable(<%classnameSnakeLowerCase%>_server
${<%classnameSnakeUpperCase%>_SERVER_SOURCES})
<%/operations%>
<%/apiInfo.apis%>
<%#apiInfo.apis%>
<%#operations%>
target_link_libraries(<%classnameSnakeLowerCase%>_server pistache pthread)
<%/operations%>
<%/apiInfo.apis%>
<%={{ }}=%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy