have CMakeLists.txt install a pkgconfig file (+ other fixes for building with MSYS) (#27)
Some checks are pending
pyrite-dev/milsko/pipeline/head Build started...

Reviewed-on: #27
This commit is contained in:
IoIxD 2026-07-17 07:48:06 +09:00 • committed by IoI_xD
commit 610c63228e
2 changed files with 39 additions and 12 deletions

View file

@ -296,7 +296,8 @@ if(MW_CLASSIC_THEME)
)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
message("Building Milsko for ${CMAKE_SYSTEM_NAME}")
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "MSYS")
target_sources(
Mw
PRIVATE
@ -336,6 +337,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-framework Cocoa
)
elseif(CMAKE_SYSTEM_NAME MATCHES "Retro")
target_sources(
Mw
PRIVATE
@ -354,6 +356,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Retro")
CLASSIC_MAC_OS
)
else()
find_package(PkgConfig)
find_package(X11)
pkg_check_modules(DBUS dbus-1)
@ -386,23 +389,26 @@ else()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBRARIES dl)
endif()
find_package(DBus1)
if(${DBus1_FOUND})
list(APPEND INCLUDE_DIRS ${DBUS_INCLUDE_DIRS})
list(APPEND LIBRARY_DIRS ${DBUS_LIBRARY_DIRS})
target_compile_definitions(
Mw
PRIVATE
USE_DBUS
)
endif()
endif()
find_package(DBus1)
if(${DBus1_FOUND})
list(APPEND INCLUDE_DIRS ${DBUS_INCLUDE_DIRS})
list(APPEND LIBRARY_DIRS ${DBUS_LIBRARY_DIRS})
target_compile_definitions(
Mw
PRIVATE
USE_DBUS
)
if(UNIX)
list(APPEND LIBRARIES m)
endif()
list(APPEND LIBRARIES m)
target_include_directories(
Mw
PRIVATE
@ -457,6 +463,17 @@ install(
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/resource/${PROJECT_NAME}.pc.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
@ONLY
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION $ENV{MINGW_PREFIX}/${CMAKE_INSTALL_DATADIR}/pkgconfig
)
if(MW_INSTALL_HEADERS)
install(
DIRECTORY include/