Skip to content

Commit

Permalink
Fixed some issues with testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaa committed Mar 20, 2024
1 parent 7895669 commit 88a40db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 46 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

project(logfault
DESCRIPTION "Simple to use, header only C++ library for application-logging on all major platforms."
HOMEPAGE_URL https://github.com/jgaa/logfault
VERSION 0.5.0
VERSION 0.5.1
LANGUAGES CXX)

include(GNUInstallDirs)
Expand All @@ -27,6 +27,7 @@ option(LOGFAULT_BUILD_TESTS "Build tests" ON)

if(LOGFAULT_BUILD_TESTS)
find_package(GTest REQUIRED)
include(CTest)
enable_testing()
add_subdirectory(tests)
endif()
Expand Down
8 changes: 1 addition & 7 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@

class LogfaultConan(ConanFile):
name = "logfault"
version = "0.5.0"
version = "0.5.1"
settings = "os", "arch", "compiler", "build_type"
exports_sources = "include/*", "tests/*", "CMakeLists.txt"
no_copy_source = True
generators = "CMakeToolchain", "CMakeDeps"
options = {"with_tests": [True, False]}
default_options = {"with_tests": False}

# def source(self):
# git = Git(self)
# git.clone(url="https://github.com/conan-io/libhello.git", target=".")

def package(self):
# This will also copy the "include" folder
Expand Down
2 changes: 1 addition & 1 deletion test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project (example)

find_package (Threads)
Expand Down
38 changes: 2 additions & 36 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,5 @@


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_LIBRARIES})
endif()

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

option(WITH_QT "Enable QT" OFF)

# if (WITH_QT)
# add_definitions(-DLOGFAULT_USE_QT_LOG=1)
# find_package(Qt6 6.4 REQUIRED COMPONENTS Test)
# qt_standard_project_setup(REQUIRES 6.5)
# qt_add_executable(general_tests general_tests.cpp)

# else()
# add_executable(general_tests general_tests.cpp)
# target_link_libraries(general_tests
# ${DEFAULT_LIBRARIES}
# )
# endif()

####### default_to_clog


add_executable(default_to_clog
default_to_clog.cpp
)
Expand All @@ -43,12 +11,11 @@ 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
${GTEST_LIBRARIES}
GTest::gtest
${CMAKE_THREAD_LIBS_INIT}
)

Expand All @@ -69,12 +36,11 @@ 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
${GTEST_LIBRARIES}
GTest::gtest
${CMAKE_THREAD_LIBS_INIT}
)

Expand Down

0 comments on commit 88a40db

Please sign in to comment.