Skip to content
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ else()
set(INSTALL_OS_HEADERS_DIR "include/os" CACHE PATH "Path where the headers will be installed")
endif()

if(NOT APPLE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not happen on Windows or Android, please explicitly check for Linux and BSD.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. We use pkgconfig on windows aswell, but this a specific case. I will change it to UNIX AND NOT APPLE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is "we" in this case? We (the swift project) definitely doesn't use pkg-config on Windows, nor does "we" (The Browser Company).

configure_file("${PROJECT_SOURCE_DIR}/cmake/libdispatch.pc.in"
"${PROJECT_BINARY_DIR}/libdispatch.pc" @ONLY)

install(FILES ${PROJECT_BINARY_DIR}/libdispatch.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()

add_subdirectory(dispatch)
add_subdirectory(man)
Expand Down
10 changes: 10 additions & 0 deletions cmake/libdispatch.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

Name: libdispatch
Description: libdispatch (a.k.a. Grand Central Dispatch)
Version: @PROJECT_VERSION@
Libs: -L${libdir} -ldispatch
Cflags: -I${includedir}