Use ${PROJECT_NAME} instead of writing projectname multiple times (#134)

* Remove duplicate mentions of project name and replaced it with ${PROJECT_NAME} variable

Update CMakeLists.txt

* Added ${CMAKE_PROJECT_NAME}

* reverted usage of  to Greeter and ran fix-format

* Update test/CMakeLists.txt

Co-authored-by: Dominic Dinser <dominic.dinser@leica-geosystems.com>
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
This commit is contained in:
Dominic 2021-10-17 21:10:52 +02:00 committed by GitHub
parent 69320a663b
commit e0bf3f59d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 16 deletions

View file

@ -22,8 +22,8 @@ CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp)
add_executable(GreeterStandalone ${sources})
add_executable(${PROJECT_NAME} ${sources})
set_target_properties(GreeterStandalone PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter")
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter")
target_link_libraries(GreeterStandalone Greeter::Greeter cxxopts)
target_link_libraries(${PROJECT_NAME} Greeter::Greeter cxxopts)