Skip to content

Commit

Permalink
use target_disable_clang_tidy(fmt::fmt)
Browse files Browse the repository at this point in the history
but this does not realy help
  • Loading branch information
ClausKlein committed Sep 2, 2022
1 parent 531bf08 commit e57657f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# this project is for using as a sub project with add_subdirectory() or with CPMAddPackage()
#
cmake_minimum_required(VERSION 3.21...3.23)
cmake_minimum_required(VERSION 3.21...3.24)

# Not ideal to use this global variable, but necessary to make sure that tooling and projects use
# the same version
Expand Down Expand Up @@ -37,7 +37,7 @@ include(GNUInstallDirs)
include(cmake/CPM.cmake)

# see https://github.com/aminya/project_options for more info
CPMAddPackage("gh:aminya/project_options@0.20.0")
CPMAddPackage("gh:aminya/project_options@0.24.1")
list(APPEND CMAKE_MODULE_PATH ${ProjectOptions_SRC_DIR})

# PackageProject.cmake will be used to make our target installable
Expand Down Expand Up @@ -65,6 +65,7 @@ dynamic_project_options(
# cmake-format: on
target_compile_features(project_options INTERFACE cxx_std_${CMAKE_CXX_STANDARD})


# ---- Add source files ----

# Note: globbing sources is considered bad practice as CMake's generators may not detect new files
Expand All @@ -87,9 +88,8 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) # mimimum requierd fo

# Link dependencies
target_link_libraries(${PROJECT_NAME} PUBLIC fmt::fmt)
target_disable_clang_tidy(fmt)

# FIXME: should be PRIVATE! CK
target_link_libraries(${PROJECT_NAME} PUBLIC project_warnings project_options)

# target_include_directories with the SYSTEM modifier will request the compiler
# to omit warnings from the provided paths, if the compiler supports that
Expand All @@ -99,6 +99,8 @@ target_include_directories(
)

if(CMAKE_SKIP_INSTALL_RULES)
# FIXME: should be PRIVATE! CK
target_link_libraries(${PROJECT_NAME} PUBLIC project_warnings project_options)
return()
endif()

Expand All @@ -109,7 +111,7 @@ endif()
# all targets recursively found for the current folder if not specified.
package_project(
NAME ${PROJECT_NAME}
TARGETS ${PROJECT_NAME} project_options project_warnings
TARGETS ${PROJECT_NAME} # XXX project_options project_warnings
PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/include
PUBLIC_DEPENDENCIES_CONFIGURED "fmt 8.1.1"
# FIXME: NO! PRIVATE_DEPENDENCIES_CONFIGURED project_options project_warnings
Expand Down
2 changes: 1 addition & 1 deletion cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CPM_DOWNLOAD_VERSION 0.35.0)
set(CPM_DOWNLOAD_VERSION 0.35.5)

if(CPM_SOURCE_CACHE)
# Expand relative path. This is important if the provided path contains a tilde (~)
Expand Down
3 changes: 2 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This project enables the developer to build, test, install the project.
# It is strongly recommended to test the exported cmake config package too!
#
cmake_minimum_required(VERSION 3.21...3.23)
cmake_minimum_required(VERSION 3.21...3.24)

project(GreeterTests LANGUAGES CXX)

Expand Down Expand Up @@ -35,6 +35,7 @@ set(sources source/main.cpp source/greeter.cpp)
add_executable(${PROJECT_NAME} ${sources})
target_link_libraries(${PROJECT_NAME} doctest::doctest greeter::greeter)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
target_disable_clang_tidy(doctest)

# ---- Add tests for ctest ----

Expand Down

0 comments on commit e57657f

Please sign in to comment.