Skip to content

Commit

Permalink
Merge pull request #10 from jgaa/conan
Browse files Browse the repository at this point in the history
Added conan to CI
  • Loading branch information
jgaa authored Mar 9, 2024
2 parents 25521ee + c35547c commit 399c022
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
${{ env.LOCALAPPDATA }}\vcpkg\archives
${{ env.APPDATA }}\vcpkg\archives
${{ env.HOME }}/.conan2
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}
restore-keys: |
${{ runner.os }}-${{ env.BUILD_TYPE }}-
Expand Down Expand Up @@ -80,10 +81,28 @@ jobs:
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build .
popd
- name: Run tests
run: |
pushd build
ctest -C Release
popd
- name: install python
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install pipx
uses: CfirTsabari/actions-pipx@v1

- name: Install Conan
run: |
pipx install conan
conan profile detect --force
- name: Test build with Conan
run: |
mkdir conan-build && cd conan-build
conan install .. --build missing
conan create .. --build 'logfault/*'
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ include(GNUInstallDirs)

set(LOGFAULT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

message(STATUS "Using ${CMAKE_CXX_COMPILER}")

macro(SET_CPP_STANDARD target)
message(STATUS "Using C++ 11 for ${target}")
set_property(TARGET ${target} PROPERTY CXX_STANDARD 11)
endmacro(SET_CPP_STANDARD)

find_package (Threads)
set(DEFAULT_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
include_directories(
Expand Down
18 changes: 17 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@


message ("GTEST_LIBRARIES: ${GTEST_LIBRARIES}")
message ("GTest_LIBRARIES: ${GTest_LIBRARIES}")

message ("GTEST_INCLUDE_DIRS: ${GTEST_INCLUDE_DIRS}")
message ("GTest_INCLUDE_DIRS: ${GTest_INCLUDE_DIRS}")

if (NOT GTEST_LIBRARIES)
set (GTEST_LIBRARIES gtest)
set (GTEST_LIBRARIES ${GTest_LIBRARIES})
endif()

if (NOT GTEST_INCLUDE_DIRS)
set (GTEST_INCLUDE_DIRS ${GTest_INCLUDE_DIRS})
endif()

option(WITH_QT "Enable QT" OFF)
Expand All @@ -20,6 +31,7 @@ option(WITH_QT "Enable QT" OFF)

####### default_to_clog


add_executable(default_to_clog
default_to_clog.cpp
)
Expand All @@ -31,6 +43,8 @@ target_include_directories(default_to_clog
${CMAKE_CURRENT_SOURCE_DIR}
${LOGFAULT_ROOT}/include
${GTEST_INCLUDE_DIRS}
#${GTest_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}/exports
)

target_link_libraries(default_to_clog
Expand All @@ -55,6 +69,8 @@ target_include_directories(default_to_clog_with_tid
${CMAKE_CURRENT_SOURCE_DIR}
${LOGFAULT_ROOT}/include
${GTEST_INCLUDE_DIRS}
#${GTest_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}/exports
)

target_link_libraries(default_to_clog_with_tid
Expand Down

0 comments on commit 399c022

Please sign in to comment.