Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ option(CAPIO_CL_BUILD_TESTS "Build CAPIO-CL test suite" OFF)
option(BUILD_PYTHON_BINDINGS "Build python bindings for CAPIO-CL" OFF)
option(ENABLE_COVERAGE "Enable code coverage collection" FALSE)
option(ENABLE_COVERAGE_PIPELINE "Add dedicated target to execute and collect coverage" OFF)
option(BUILD_UTILS "Build CAPIO-CL utility binaries" OFF)
option(ADD_BUILDER "Add ncurses based builder" ON)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-O0 -g)
Expand Down Expand Up @@ -157,6 +159,55 @@ if(LIBANL)
target_link_libraries(libcapio_cl PRIVATE ${LIBANL})
endif ()


#####################################
# CAPIO-CL Utilities
#####################################

if (BUILD_UTILS)
find_package(Curses)

if (NOT CURSES_FOUND)
message(FATAL_ERROR "ncurses not found. If you do not need the interactive builder, add -DADD_BUILDER=FALSE to cmake")
endif ()

FetchContent_Declare(
args
GIT_REPOSITORY https://github.com/Taywee/args.git
GIT_TAG 6.4.7
)

set(ARGS_BUILD_EXAMPLE OFF CACHE INTERNAL "")
set(ARGS_BUILD_UNITTESTS OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(args)

add_executable(capiocl_utils
utilities/capiocl-utils.cpp
${CAPIO_SRC}
${CAPIO_CL_HEADERS})

if (ADD_BUILDER)
add_compile_definitions(capiocl_utils _INTERACTIVE_BUILDER)
endif ()


target_include_directories(capiocl_utils PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
${jsoncons_SOURCE_DIR}/include
${TOMLPLUSPLUS_SOURCE_DIR}/include
${CAPIOCL_JSON_SCHEMAS_DIRECTORY}
${args_SOURCE_DIR}
${CURSES_INCLUDE_DIR}
)

target_link_libraries(capiocl_utils PUBLIC ${CURSES_LIBRARIES})
target_link_libraries(capiocl_utils PRIVATE
tomlplusplus::tomlplusplus
httplib::httplib
)
endif (BUILD_UTILS)

#####################################
# Install rules
#####################################
Expand Down
1 change: 0 additions & 1 deletion capiocl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ struct defaults;
namespace webapi {
class CapioClWebApiServer;
}

} // namespace capiocl

#endif // CAPIO_CL_CAPIOCL_HPP
Loading
Loading