cmake_minimum_required(VERSION 3.10) project(PipelineRunner) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) option(FAKE "Fake mode for testing without opencode" OFF) if(FAKE) message(STATUS "FAKE mode ON — using fake process executor") else() message(STATUS "FAKE mode OFF — using real process executor") endif() # PIP find_package(PIP REQUIRED) # Google Test include(FetchContent) FetchContent_Declare( googletest GIT_REPOSITORY https://git.shstk.ru/mirrors/googletest.git GIT_TAG v1.14.0 ) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) # Source files file(GLOB ALL_SRCS "src/*.cpp") file(GLOB HDRS "src/*.h") list(FILTER ALL_SRCS EXCLUDE REGEX ".*main\\.cpp$") set(SRCS ${ALL_SRCS}) # Main executable add_executable(pipeline-runner src/main.cpp ${SRCS} ${HDRS}) target_include_directories(pipeline-runner PRIVATE src) target_link_libraries(pipeline-runner PIP PIP::HTTPServer PIP::Crypt PIP::Console) if(FAKE) target_compile_definitions(pipeline-runner PRIVATE FAKE) endif() set_target_properties(pipeline-runner PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/lib" BUILD_RPATH "\$ORIGIN;\$ORIGIN/lib" ) # Tests add_executable(test-pipeline-runner tests/test_pipeline.cpp tests/test_runner.cpp ${SRCS}) target_include_directories(test-pipeline-runner PRIVATE src tests) target_link_libraries(test-pipeline-runner PIP PIP::HTTPServer PIP::Crypt PIP::Console GTest::gtest_main) if(FAKE) target_compile_definitions(test-pipeline-runner PRIVATE FAKE) endif() include(GoogleTest) gtest_discover_tests(test-pipeline-runner) # Install install(TARGETS pipeline-runner DESTINATION bin) install(FILES pipeline-runner.conf DESTINATION bin)