Skip to content

Commit

Permalink
Add boost regex as a CMake dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaute Lindkvist committed Oct 23, 2024
1 parent a8f64f8 commit d53072e
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions RestInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,62 @@ cmake_minimum_required(VERSION 3.16)
project(caffaRestInterface)

set(PUBLIC_HEADERS
cafRestAuthenticator.h
cafRestSession.h
cafRestServer.h
cafRestClient.h
cafRestServerApplication.h
cafRestClientApplication.h
cafRestServiceInterface.h
cafRestAppService.h
cafRestDocumentService.h
cafRestObjectService.h
cafRestSessionService.h
cafRestRequest.h
cafRestOpenApiService.h
cafRestRequest.h)
cafRestAuthenticator.h
cafRestSession.h
cafRestServer.h
cafRestClient.h
cafRestServerApplication.h
cafRestClientApplication.h
cafRestServiceInterface.h
cafRestAppService.h
cafRestDocumentService.h
cafRestObjectService.h
cafRestSessionService.h
cafRestRequest.h
cafRestOpenApiService.h
cafRestRequest.h)

set(PROJECT_FILES
${PUBLIC_HEADERS}
cafRestSession.cpp
cafRestServer.cpp
cafRestClient.cpp
cafRestServerApplication.cpp
cafRestClientApplication.cpp
cafRestServiceInterface.cpp
cafRestAppService.cpp
cafRestDocumentService.cpp
cafRestObjectService.cpp
cafRestSessionService.cpp
cafRestRequest.cpp
cafRestOpenApiService.cpp
cafRestRequest.cpp)
${PUBLIC_HEADERS}
cafRestSession.cpp
cafRestServer.cpp
cafRestClient.cpp
cafRestServerApplication.cpp
cafRestClientApplication.cpp
cafRestServiceInterface.cpp
cafRestAppService.cpp
cafRestDocumentService.cpp
cafRestObjectService.cpp
cafRestSessionService.cpp
cafRestRequest.cpp
cafRestOpenApiService.cpp
cafRestRequest.cpp)

if(CAFFA_BUILD_SHARED)
message(STATUS "Building ${PROJECT_NAME} shared")
add_library(${PROJECT_NAME} SHARED ${PROJECT_FILES})
else()
add_library(${PROJECT_NAME} STATIC ${PROJECT_FILES})
endif()
if (CAFFA_BUILD_SHARED)
message(STATUS "Building ${PROJECT_NAME} shared")
add_library(${PROJECT_NAME} SHARED ${PROJECT_FILES})
else ()
add_library(${PROJECT_NAME} STATIC ${PROJECT_FILES})
endif ()

set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR})
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")

if(MSVC)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127")
set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif()
if (MSVC)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127")
set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif ()

target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

find_package(Boost 1.71.0 REQUIRED COMPONENTS system)
find_package(Boost 1.71.0 REQUIRED COMPONENTS system regex)
find_package(OpenSSL REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC caffaBase caffaCore caffaRpcBase nlohmann_json::nlohmann_json OpenSSL::SSL OpenSSL::Crypto Boost::system)
target_link_libraries(${PROJECT_NAME} PUBLIC caffaBase caffaCore caffaRpcBase nlohmann_json::nlohmann_json OpenSSL::SSL OpenSSL::Crypto Boost::system Boost::regex)

install(
TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

source_group("" FILES ${PROJECT_FILES})

0 comments on commit d53072e

Please sign in to comment.