@@ -36,6 +36,20 @@ function(enable_module target)
36
36
endif ()
37
37
endfunction ()
38
38
39
+ function (join_paths joined_path first_path_segment)
40
+ set (temp_path "${first_path_segment} " )
41
+ foreach (current_segment IN LISTS ARGN)
42
+ if (NOT ("${current_segment} " STREQUAL "" ))
43
+ if (IS_ABSOLUTE "${current_segment} " )
44
+ set (temp_path "${current_segment} " )
45
+ else ()
46
+ set (temp_path "${temp_path} /${current_segment} " )
47
+ endif ()
48
+ endif ()
49
+ endforeach ()
50
+ set (${joined_path} "${temp_path} " PARENT_SCOPE)
51
+ endfunction ()
52
+
39
53
set (FMT_USE_CMAKE_MODULES FALSE )
40
54
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.28 AND
41
55
CMAKE_GENERATOR STREQUAL "Ninja" )
@@ -72,7 +86,7 @@ option(FMT_WERROR "Halt the compilation with an error on compiler warnings."
72
86
OFF )
73
87
74
88
# Options that control generation of various targets.
75
- option (FMT_INSTALL "Generate the install target." OFF )
89
+ option (FMT_INSTALL "Generate the install target." ON )
76
90
option (FMT_OS "Include OS-specific APIs." OFF )
77
91
option (FMT_MODULE "Build a module instead of a traditional library." OFF )
78
92
option (FMT_SYSTEM_HEADERS "Expose headers with marking them as system." OFF )
@@ -168,7 +182,7 @@ endif ()
168
182
function (add_headers VAR)
169
183
set (headers ${${VAR} })
170
184
foreach (header ${ARGN} )
171
- set (headers ${headers} include /fmt-vt/${header} )
185
+ set (headers ${headers} ${CMAKE_CURRENT_SOURCE_DIR} / include /fmt-vt/${header} )
172
186
endforeach ()
173
187
set (${VAR} ${headers} PARENT_SCOPE)
174
188
endfunction ()
@@ -364,13 +378,13 @@ if (FMT_INSTALL)
364
378
VERSION ${FMT_VERSION}
365
379
COMPATIBILITY AnyNewerVersion)
366
380
367
- # join_paths(libdir_for_pc_file "\${exec_prefix}" "${FMT_LIB_DIR}")
368
- # join_paths(includedir_for_pc_file "\${prefix}" "${FMT_INC_DIR}")
381
+ join_paths(libdir_for_pc_file "\$ {exec_prefix}" "${FMT_LIB_DIR} " )
382
+ join_paths(includedir_for_pc_file "\$ {prefix}" "${FMT_INC_DIR} " )
369
383
370
- # configure_file(
371
- # "${PROJECT_SOURCE_DIR}/support/cmake/fmt.pc.in"
372
- # "${pkgconfig}"
373
- # @ONLY)
384
+ configure_file (
385
+ "${PROJECT_SOURCE_DIR} /support/cmake/fmt.pc.in"
386
+ "${pkgconfig} "
387
+ @ONLY)
374
388
configure_package_config_file(
375
389
${PROJECT_SOURCE_DIR} /support/cmake/fmt-config.cmake.in
376
390
${project_config}
0 commit comments