Skip to content

Commit 6fb6689

Browse files
committed
cmake: use PROJECT_NAME variable
1 parent 3be3205 commit 6fb6689

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

build/cmake/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cmake_minimum_required(VERSION 3.10)
22

3-
set(name utki)
4-
project(${name})
3+
project(utki)
54

65
# !!! find_package must go after project() declaration !!!
76
# Otherwise VCPKG does not set the CMAKE_PREFIX_PATH to find packages.
@@ -10,19 +9,19 @@ find_package(myci CONFIG REQUIRED)
109
set(srcs)
1110
myci_add_source_files(srcs
1211
DIRECTORY
13-
../../src/${name}
12+
../../src/${PROJECT_NAME}
1413
RECURSIVE
1514
)
1615

17-
myci_declare_library(${name}
16+
myci_declare_library(${PROJECT_NAME}
1817
SOURCES
1918
${srcs}
2019
PUBLIC_INCLUDE_DIRECTORIES
2120
../../src
2221
PRIVATE_INCLUDE_DIRECTORIES
2322
../../src_deps
2423
INSTALL_INCLUDE_DIRECTORIES
25-
../../src/${name}
24+
../../src/${PROJECT_NAME}
2625
)
2726

2827
# if the library is compiled by vcpkg during the port build,

build/cmake/unit_tests.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ myci_add_source_files(test_srcs
1717
RECURSIVE
1818
)
1919

20-
myci_declare_application(${name}-tests
20+
myci_declare_application(${PROJECT_NAME}-tests
2121
GUI
2222
SOURCES
2323
${test_srcs}
@@ -37,5 +37,5 @@ endif()
3737
add_custom_command(TARGET test
3838
POST_BUILD
3939
COMMAND
40-
$<TARGET_FILE:${name}-tests>
40+
$<TARGET_FILE:${PROJECT_NAME}-tests>
4141
)

0 commit comments

Comments
 (0)