mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-08-30 21:51:12 +02:00
reverted usage of to Greeter and ran fix-format
This commit is contained in:
parent
004f33fde1
commit
a377b27597
4 changed files with 12 additions and 11 deletions
|
@ -56,7 +56,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE fmt::fmt)
|
|||
|
||||
target_include_directories(
|
||||
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include/${PROJECT_NAME}-${PROJECT_VERSION}>
|
||||
$<INSTALL_INTERFACE:include/${PROJECT_NAME}-${PROJECT_VERSION}>
|
||||
)
|
||||
|
||||
# ---- Create an installable target ----
|
||||
|
|
|
@ -7,12 +7,12 @@ project(GreeterDocs)
|
|||
include(../cmake/CPM.cmake)
|
||||
|
||||
CPMAddPackage("gh:mosra/m.css#42d4a9a48f31f5df6e246c948403b54b50574a2a")
|
||||
CPMAddPackage(NAME ${CMAKE_PROJECT_NAME} SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
|
||||
CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
|
||||
|
||||
# ---- Doxygen variables ----
|
||||
|
||||
# set Doxyfile variables
|
||||
set(DOXYGEN_PROJECT_NAME ${CMAKE_PROJECT_NAME})
|
||||
set(DOXYGEN_PROJECT_NAME Greeter)
|
||||
set(DOXYGEN_PROJECT_VERSION ${Greeter_VERSION})
|
||||
set(DOXYGEN_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/..")
|
||||
set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doxygen")
|
||||
|
|
|
@ -16,7 +16,7 @@ CPMAddPackage(
|
|||
OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
|
||||
)
|
||||
|
||||
CPMAddPackage(NAME ${CMAKE_PROJECT_NAME} SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
|
||||
CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
|
||||
|
||||
# ---- Create standalone executable ----
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ CPMAddPackage("gh:onqtam/doctest#2.4.5")
|
|||
CPMAddPackage("gh:TheLartians/Format.cmake@1.7.0")
|
||||
|
||||
if(TEST_INSTALLED_VERSION)
|
||||
find_package(${CMAKE_PROJECT_NAME} REQUIRED)
|
||||
find_package(Greeter REQUIRED)
|
||||
else()
|
||||
CPMAddPackage(NAME ${CMAKE_PROJECT_NAME} SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
|
||||
CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
|
||||
endif()
|
||||
|
||||
# ---- Create binary ----
|
||||
|
@ -34,9 +34,9 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
|
|||
# enable compiler warnings
|
||||
if(NOT TEST_INSTALLED_VERSION)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC -Wall -Wpedantic -Wextra -Werror)
|
||||
target_compile_options(Greeter PUBLIC -Wall -Wpedantic -Wextra -Werror)
|
||||
elseif(MSVC)
|
||||
target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC /W4 /WX)
|
||||
target_compile_options(Greeter PUBLIC /W4 /WX)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -46,7 +46,8 @@ endif()
|
|||
enable_testing()
|
||||
|
||||
# Note: doctest and similar testing frameworks can automatically configure CMake tests. For other
|
||||
# testing frameworks add the tests target instead: add_test(NAME ${PROJECT_NAME} COMMAND GreeterTests)
|
||||
# testing frameworks add the tests target instead: add_test(NAME ${PROJECT_NAME} COMMAND
|
||||
# GreeterTests)
|
||||
|
||||
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)
|
||||
doctest_discover_tests(${PROJECT_NAME})
|
||||
|
@ -54,6 +55,6 @@ doctest_discover_tests(${PROJECT_NAME})
|
|||
# ---- code coverage ----
|
||||
|
||||
if(ENABLE_TEST_COVERAGE)
|
||||
target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC -O0 -g -fprofile-arcs -ftest-coverage)
|
||||
target_link_options(${CMAKE_PROJECT_NAME} PUBLIC -fprofile-arcs -ftest-coverage)
|
||||
target_compile_options(Greeter PUBLIC -O0 -g -fprofile-arcs -ftest-coverage)
|
||||
target_link_options(Greeter PUBLIC -fprofile-arcs -ftest-coverage)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue