Skip to content

Commit 7e3070a

Browse files
committed
cmake: myci
1 parent b9a52ad commit 7e3070a

File tree

3 files changed

+39
-67
lines changed

3 files changed

+39
-67
lines changed

build/cmake/CMakeLists.txt

Lines changed: 33 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,43 @@
1-
cmake_minimum_required(VERSION 3.10)
2-
3-
include(GNUInstallDirs)
1+
cmake_minimum_required(VERSION 3.20)
42

53
set(name ruis-render-opengl)
6-
74
project(${name})
85

9-
# ============================
10-
# = find dependency packages =
11-
12-
find_package(utki CONFIG REQUIRED)
13-
find_package(papki CONFIG REQUIRED)
14-
find_package(ruis CONFIG REQUIRED)
15-
find_package(ZLIB REQUIRED)
16-
find_package(Freetype REQUIRED)
17-
find_package(GLEW REQUIRED)
18-
19-
# ============================
20-
21-
file(GLOB_RECURSE srcs "../../src/*.cpp")
22-
23-
add_library(
24-
${name}
25-
STATIC
26-
${srcs}
27-
)
6+
set(dir_name ruis)
287

29-
target_compile_features(${name} PUBLIC cxx_std_17)
30-
set_target_properties(${name} PROPERTIES CXX_STANDARD_REQUIRED ON)
31-
set_target_properties(${name} PROPERTIES CXX_EXTENSIONS OFF)
8+
# !!! find_package must go after project() declaration !!!
9+
# Otherwise VCPKG does not set the CMAKE_PREFIX_PATH to find packages.
10+
find_package(myci CONFIG REQUIRED)
3211

33-
target_include_directories(
34-
${name}
35-
INTERFACE
36-
$<BUILD_INTERFACE:>
37-
$<INSTALL_INTERFACE:include>
38-
)
39-
40-
target_link_libraries(
41-
${name}
42-
PUBLIC
43-
utki::utki
44-
papki::papki
45-
ruis::ruis
46-
GLEW::GLEW
47-
)
48-
49-
# install library header files preserving directory hierarchy
50-
install(
12+
set(srcs)
13+
myci_add_source_files(srcs
5114
DIRECTORY
52-
"${CMAKE_CURRENT_SOURCE_DIR}/../../src/ruis"
53-
DESTINATION
54-
"${CMAKE_INSTALL_INCLUDEDIR}"
55-
FILES_MATCHING PATTERN
56-
"*.hpp"
57-
)
58-
59-
install(
60-
TARGETS
61-
${name}
62-
EXPORT # generate cmake configs
63-
${name}-config
15+
../../src/${dir_name}
16+
RECURSIVE
6417
)
6518

66-
# install cmake configs
67-
install(
68-
EXPORT
69-
${name}-config
70-
FILE
71-
${name}-config.cmake
72-
DESTINATION
73-
${CMAKE_INSTALL_DATAROOTDIR}/${name}
74-
NAMESPACE
75-
${name}::
19+
myci_declare_library(${name}
20+
SOURCES
21+
${srcs}
22+
PUBLIC_INCLUDE_DIRECTORIES
23+
../../src
24+
INSTALL_INCLUDE_DIRECTORIES
25+
../../src/${dir_name}
26+
DEPENDENCIES
27+
rasterimage
28+
r4
29+
papki
30+
tml
31+
utki
32+
agg
33+
veg
34+
mikroxml
35+
cssom
36+
svgdom
37+
svgren
38+
ruis
39+
Freetype
40+
EXTERNAL_DEPENDENCIES
41+
JPEG
42+
GLEW
7643
)

build/vcpkg/test/vcpkg-configuration.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
{
99
"kind": "git",
1010
"repository": "https://github.com/cppfw/vcpkg-repo/",
11-
"baseline": "d8e5b1c5c3235dc67812b87badf166577db53da2",
11+
"baseline": "4a47b0b00d2a33381776da7550681a0944ab10d2",
1212
"reference": "main",
1313
"packages": [
14+
"myci",
1415
"utki",
1516
"papki",
1617
"ruis",

build/vcpkg/vcpkg.json.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"name" : "vcpkg-cmake-config",
1414
"host" : true
1515
},
16+
{
17+
"name" : "myci",
18+
"host" : true
19+
},
1620
"utki",
1721
"ruis",
1822
"glew"

0 commit comments

Comments
 (0)