mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
rewrite GLib2 CMake module, minor build system cleanups
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7a38466cec
commit
4016b14a9b
8 changed files with 68 additions and 65 deletions
|
@ -342,8 +342,8 @@ set_package_properties(HarfBuzz PROPERTIES
|
|||
TYPE RECOMMENDED
|
||||
)
|
||||
|
||||
find_package(GLIB2)
|
||||
set_package_properties(GLIB2 PROPERTIES
|
||||
find_package(GLib2)
|
||||
set_package_properties(GLib2 PROPERTIES
|
||||
PURPOSE "Required for glib mainloop support"
|
||||
DESCRIPTION "Core application building blocks for libraries and applications written in C"
|
||||
URL "https://developer.gnome.org/glib"
|
||||
|
@ -520,6 +520,10 @@ if(NOT WITH_DIRECTWRITE)
|
|||
katie_definition(-DQT_NO_DIRECTWRITE)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_OPENGL OR NOT OPENGL_FOUND)
|
||||
katie_definition(-DQT_NO_OPENGL)
|
||||
endif()
|
||||
|
||||
# major components
|
||||
add_subdirectory(src/core)
|
||||
add_subdirectory(src/xml)
|
||||
|
@ -536,8 +540,6 @@ if(NOT KATIE_BOOTSTRAP)
|
|||
add_subdirectory(src/network)
|
||||
if(WITH_OPENGL AND OPENGL_FOUND)
|
||||
add_subdirectory(src/opengl)
|
||||
else()
|
||||
katie_definition(-DQT_NO_OPENGL)
|
||||
endif()
|
||||
add_subdirectory(src/phonon)
|
||||
add_subdirectory(src/plugins)
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
# - Try to find the GLIB2 libraries
|
||||
# Once done this will define
|
||||
#
|
||||
# GLIB2_FOUND - system has glib2
|
||||
# GLIB2_INCLUDE_DIR - the glib2 include directory
|
||||
# GLIB2_LIBRARIES - glib2 library
|
||||
|
||||
# Copyright (c) 2008 Laurent Montel, <montel@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
|
||||
# Already in cache, be silent
|
||||
set(GLIB2_FIND_QUIETLY TRUE)
|
||||
endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_LibGLIB2 QUIET glib-2.0)
|
||||
|
||||
find_path(GLIB2_MAIN_INCLUDE_DIR
|
||||
NAMES glib.h
|
||||
HINTS ${PC_LibGLIB2_INCLUDEDIR}
|
||||
PATH_SUFFIXES glib-2.0)
|
||||
|
||||
find_library(GLIB2_LIBRARY
|
||||
NAMES glib-2.0
|
||||
HINTS ${PC_LibGLIB2_LIBDIR}
|
||||
)
|
||||
|
||||
set(GLIB2_LIBRARIES ${GLIB2_LIBRARY})
|
||||
|
||||
# search the glibconfig.h include dir under the same root where the library is found
|
||||
get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH)
|
||||
|
||||
find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
|
||||
PATH_SUFFIXES glib-2.0/include
|
||||
HINTS ${PC_LibGLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})
|
||||
|
||||
set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}")
|
||||
|
||||
# not sure if this include dir is optional or required
|
||||
# for now it is optional
|
||||
if(GLIB2_INTERNAL_INCLUDE_DIR)
|
||||
set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}")
|
||||
endif(GLIB2_INTERNAL_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES)
|
55
cmake/modules/FindGLib2.cmake
Normal file
55
cmake/modules/FindGLib2.cmake
Normal file
|
@ -0,0 +1,55 @@
|
|||
# - Try to find GLib2 core application building
|
||||
# Once done this will define
|
||||
#
|
||||
# GLIB2_FOUND - system has GLib2
|
||||
# GLIB2_INCLUDES - the GLib2 include directory
|
||||
# GLIB2_CONFIG_INCLUDES - the D-Bus message bus architecture include directory
|
||||
# GLIB2_LIBRARIES - The libraries needed to use GLib2
|
||||
#
|
||||
# Copyright (c) 2015, Ivailo Monev, <xakepa10@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
|
||||
if(GLIB2_INCLUDES AND GLIB2_LIBRARIES)
|
||||
set(GLIB2_FIND_QUIETLY TRUE)
|
||||
endif()
|
||||
|
||||
find_path(GLIB2_INCLUDES
|
||||
NAMES
|
||||
glib.h
|
||||
PATH_SUFFIXES glib-2.0
|
||||
HINTS
|
||||
$ENV{GLIB2DIR}/include
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_path(GLIB2_CONFIG_INCLUDES
|
||||
NAMES
|
||||
glibconfig.h
|
||||
PATH_SUFFIXES glib-2.0/include
|
||||
HINTS
|
||||
$ENV{GLIB2DIR}/include
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
if(GLIB2_INCLUDES AND GLIB2_CONFIG_INCLUDES)
|
||||
set(GLIB2_INCLUDES ${GLIB2_INCLUDES} ${GLIB2_CONFIG_INCLUDES})
|
||||
endif()
|
||||
|
||||
find_library(GLIB2_LIBRARIES
|
||||
glib-2.0
|
||||
HINTS
|
||||
$ENV{GLIB2DIR}/lib
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLib2 DEFAULT_MSG GLIB2_INCLUDES GLIB2_CONFIG_INCLUDES GLIB2_LIBRARIES)
|
|
@ -11,7 +11,7 @@ if("${KATIE_COMPILER}" MATCHES "(gcc|clang)")
|
|||
# -Wall -Wreturn-type -fno-strict-aliasing -Wcast-align
|
||||
# -Wchar-subscripts -Wreturn-type -Wno-unused-parameter
|
||||
# -Wno-sign-compare -Wno-switch -Wno-switch-enum
|
||||
# -Wundef -Wmissing-noreturn -Winit-self
|
||||
# -Wundef -Wmissing-noreturn -Winit-self -Wunused-comparison
|
||||
)
|
||||
set(KATIE_LDFLAGS
|
||||
${KATIE_LDFLAGS}
|
||||
|
|
|
@ -303,7 +303,7 @@ if(WITH_GLIB2 AND GLIB2_FOUND)
|
|||
${EXTRA_CORE_LIBS}
|
||||
${GLIB2_LIBRARIES}
|
||||
)
|
||||
include_directories(${GLIB2_INCLUDE_DIR})
|
||||
include_directories(${GLIB2_INCLUDES})
|
||||
endif()
|
||||
|
||||
if(WITH_ZLIB AND ZLIB_FOUND)
|
||||
|
|
|
@ -86,7 +86,7 @@ if(UNIX)
|
|||
${CORE_HEADERS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qeventdispatcher_glib_p.h
|
||||
)
|
||||
include_directories(${GLIB2_INCLUDE_DIR})
|
||||
include_directories(${GLIB2_INCLUDES})
|
||||
set(EXTRA_CORE_LIBS
|
||||
${EXTRA_CORE_LIBS}
|
||||
${GLIB2_LIBRARIES}
|
||||
|
|
|
@ -126,7 +126,7 @@ if(UNIX AND WITH_X11 AND X11_FOUND)
|
|||
${EXTRA_GUI_LIBS}
|
||||
${GLIB2_LIBRARIES}
|
||||
)
|
||||
include_directories(${GLIB2_INCLUDE_DIR})
|
||||
include_directories(${GLIB2_INCLUDES})
|
||||
else()
|
||||
add_definitions(-DQT_NO_GLIB)
|
||||
endif()
|
||||
|
@ -208,9 +208,7 @@ elseif(KATIE_PLATFORM STREQUAL "qws")
|
|||
${EXTRA_GUI_LIBS}
|
||||
${GLIB2_LIBRARIES}
|
||||
)
|
||||
include_directories(${GLIB2_INCLUDE_DIR})
|
||||
else()
|
||||
add_definitions(-DQT_NO_GLIB)
|
||||
include_directories(${GLIB2_INCLUDES})
|
||||
endif()
|
||||
elseif(KATIE_PLATFORM STREQUAL "qpa")
|
||||
set(GUI_HEADERS
|
||||
|
@ -272,7 +270,7 @@ elseif(KATIE_PLATFORM STREQUAL "qpa")
|
|||
${EXTRA_GUI_LIBS}
|
||||
${GLIB2_LIBRARIES}
|
||||
)
|
||||
include_directories(${GLIB2_INCLUDE_DIR})
|
||||
include_directories(${GLIB2_INCLUDES})
|
||||
if(KATIE_PLATFORM STREQUAL "blackberry")
|
||||
set(GUI_HEADERS
|
||||
${GUI_HEADERS}
|
||||
|
|
|
@ -238,7 +238,7 @@ if(WITH_GLIB2 AND GLIB2_FOUND AND WITH_PULSEAUDIO AND PULSEAUDIO_FOUND)
|
|||
)
|
||||
add_definitions(-DHAVE_PULSEAUDIO)
|
||||
include_directories(
|
||||
${GLIB2_INCLUDE_DIR}
|
||||
${GLIB2_INCLUDES}
|
||||
${PULSEAUDIO_INCLUDE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Reference in a new issue