have CMakeLists.txt install a pkgconfig file (+ other fixes for building with MSYS)
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit
This commit is contained in:
commit
cddfbb8c85
2 changed files with 39 additions and 12 deletions
|
|
@ -296,7 +296,8 @@ if(MW_CLASSIC_THEME)
|
||||||
)
|
)
|
||||||
endif()
|
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(
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|
@ -336,6 +337,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
-framework Cocoa
|
-framework Cocoa
|
||||||
)
|
)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Retro")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Retro")
|
||||||
|
|
||||||
target_sources(
|
target_sources(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|
@ -354,6 +356,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Retro")
|
||||||
CLASSIC_MAC_OS
|
CLASSIC_MAC_OS
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
|
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
find_package(X11)
|
find_package(X11)
|
||||||
pkg_check_modules(DBUS dbus-1)
|
pkg_check_modules(DBUS dbus-1)
|
||||||
|
|
@ -386,23 +389,26 @@ else()
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
list(APPEND LIBRARIES dl)
|
list(APPEND LIBRARIES dl)
|
||||||
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
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(DBus1)
|
|
||||||
|
|
||||||
if(${DBus1_FOUND})
|
|
||||||
list(APPEND INCLUDE_DIRS ${DBUS_INCLUDE_DIRS})
|
if(UNIX)
|
||||||
list(APPEND LIBRARY_DIRS ${DBUS_LIBRARY_DIRS})
|
list(APPEND LIBRARIES m)
|
||||||
target_compile_definitions(
|
|
||||||
Mw
|
|
||||||
PRIVATE
|
|
||||||
USE_DBUS
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND LIBRARIES m)
|
|
||||||
|
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
Mw
|
Mw
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|
@ -457,6 +463,17 @@ install(
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
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)
|
if(MW_INSTALL_HEADERS)
|
||||||
install(
|
install(
|
||||||
DIRECTORY include/
|
DIRECTORY include/
|
||||||
|
|
|
||||||
10
resource/milsko.pc.in
Normal file
10
resource/milsko.pc.in
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
prefix="@CMAKE_INSTALL_PREFIX@"
|
||||||
|
includedir="@CMAKE_INSTALL_PREFIX@/include"
|
||||||
|
libdir="@CMAKE_INSTALL_PREFIX@/bin"
|
||||||
|
|
||||||
|
Name: @PROJECT_NAME@
|
||||||
|
Description: @PROJECT_DESCRIPTION@
|
||||||
|
URL: @PROJECT_HOMEPAGE_URL@
|
||||||
|
Version: @PROJECT_VERSION@
|
||||||
|
Cflags: -I"${includedir}"/
|
||||||
|
Libs: -L"${libdir}" -lMw
|
||||||
Loading…
Add table
Add a link
Reference in a new issue