@@ -36,6 +36,20 @@ function(enable_module target)
3636 endif ()
3737endfunction ()
3838
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+
3953set (FMT_USE_CMAKE_MODULES FALSE )
4054if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.28 AND
4155 CMAKE_GENERATOR STREQUAL "Ninja" )
@@ -72,7 +86,7 @@ option(FMT_WERROR "Halt the compilation with an error on compiler warnings."
7286 OFF )
7387
7488# 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 )
7690option (FMT_OS "Include OS-specific APIs." OFF )
7791option (FMT_MODULE "Build a module instead of a traditional library." OFF )
7892option (FMT_SYSTEM_HEADERS "Expose headers with marking them as system." OFF )
@@ -168,7 +182,7 @@ endif ()
168182function (add_headers VAR)
169183 set (headers ${${VAR} })
170184 foreach (header ${ARGN} )
171- set (headers ${headers} include /fmt-vt/${header} )
185+ set (headers ${headers} ${CMAKE_CURRENT_SOURCE_DIR} / include /fmt-vt/${header} )
172186 endforeach ()
173187 set (${VAR} ${headers} PARENT_SCOPE)
174188endfunction ()
@@ -364,13 +378,13 @@ if (FMT_INSTALL)
364378 VERSION ${FMT_VERSION}
365379 COMPATIBILITY AnyNewerVersion)
366380
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} " )
369383
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)
374388 configure_package_config_file(
375389 ${PROJECT_SOURCE_DIR} /support/cmake/fmt-config.cmake.in
376390 ${project_config}
0 commit comments