Skip to content

Commit

Permalink
move some katie_definition() calls to top-level CMake file
Browse files Browse the repository at this point in the history
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
  • Loading branch information
Ivailo Monev committed Jul 25, 2016
1 parent 9c848ee commit 274d065
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 22 deletions.
44 changes: 34 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include(KatieBuildMacros)
set(KATIE_COMPONENTS "Core Gui Declarative Designer DesignerComponents Help Multimedia Network Sql Svg Xml XmlPatterns Script ScriptTools Test UiTools")
set(KATIE_TOOLS "moc uic rcc qhelpgenerator qcollectiongenerator lupdate lrelease lconvert designer")

# optional package features
# optional package
option(WITH_THREADS "Build threads support" ON)
add_feature_info(threads WITH_THREADS "an open source something")

Expand Down Expand Up @@ -109,7 +109,7 @@ add_feature_info(sqlite WITH_SQLITE "the world's most popular open source databa
option(WITH_X11 "Build X11/X.Org support" ON)
add_feature_info(x11 WITH_X11 "an open source something")

# katie features
# optional features
option(KATIE_BOOTSTRAP "Build only core tools" OFF)
add_feature_info(bootstrap KATIE_BOOTSTRAP "internal build option")

Expand Down Expand Up @@ -471,6 +471,7 @@ if(ENABLE_TESTING)
add_definitions(-DQT_BUILD_INTERNAL)
endif()

# optional packages
if(NOT WITH_THREADS OR NOT THREADS_FOUND)
katie_definition(-DQT_NO_THREAD)
endif()
Expand Down Expand Up @@ -511,10 +512,6 @@ if(NOT WITH_NIS OR NOT NIS_FOUND)
katie_definition(-DQT_NO_NIS)
endif()

if(NOT WITH_DIRECTWRITE)
katie_definition(-DQT_NO_DIRECTWRITE)
endif()

if(NOT WITH_OPENGL OR NOT OPENGL_FOUND)
katie_definition(-DQT_NO_OPENGL)
else()
Expand All @@ -525,10 +522,6 @@ if(NOT WITH_NAS OR NOT NAS_FOUND)
katie_definition(-DQT_NO_NAS)
endif()

if(NOT WITH_PNG)
katie_definition(-DQT_NO_IMAGEFORMAT_PNG)
endif()

if(NOT WITH_JPEG OR NOT JPEG_FOUND)
katie_definition(-DQT_NO_IMAGEFORMAT_JPEG)
endif()
Expand All @@ -541,6 +534,32 @@ if(NOT WITH_TIFF OR NOT TIFF_FOUND)
katie_definition(-DQT_NO_IMAGEFORMAT_TIFF)
endif()


# conditional features
if(NOT WITH_ACCESSIBILITY)
katie_definition(-DQT_NO_ACCESSIBILITY)
endif()

if(NOT WITH_DIRECTWRITE)
katie_definition(-DQT_NO_DIRECTWRITE)
endif()

if(WITH_OPENGLES1)
katie_definition(-DQT_OPENGL_ES_1)
endif()

if(WITH_OPENGLES2)
katie_definition(-DQT_OPENGL_ES_2)
endif()

# keep in sucn with multimedia audio component CMake file, only definitions setup is needed here
if(KATIE_PLATFORM MATCHES "(mac|win32|wince)" OR (UNIX AND WITH_ALSA AND ALSA_FOUND))
# NOTE: CMake's logical OR does not stop at the first met condition and
# I'd rather not have a AND condition here with negatives
else()
katie_definition(-DQT_NO_AUDIO_BACKEND)
endif()

# keep in sync with the gui component CMake file, only definitions setup is needed here
if(WITH_X11 AND X11_FOUND)
# TODO: xim
Expand All @@ -561,6 +580,11 @@ if(WITH_X11 AND X11_FOUND)
endif()
endif()

# kinda optional package
if(NOT WITH_PNG)
katie_definition(-DQT_NO_IMAGEFORMAT_PNG)
endif()

# semi-shared
include(src/shared/linguist/linguist.cmake)
include(src/shared/bootstrap.cmake)
Expand Down
3 changes: 0 additions & 3 deletions src/gui/accessible/accessible.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,4 @@ if(WITH_ACCESSIBILITY)
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessiblebridge.cpp
)
endif()
else()
# FIXME: move to global scope
katie_definition(-DQT_NO_ACCESSIBILITY)
endif()
8 changes: 3 additions & 5 deletions src/multimedia/audio/audio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set(MULTIMEDIA_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/audio/qaudiodevicefactory.cpp
)

if(BUILD_PLATFORM STREQUAL "mac")
if(KATIE_PLATFORM STREQUAL "mac")
set(MULTIMEDIA_HEADERS
${MULTIMEDIA_HEADERS}
${CMAKE_CURRENT_SOURCE_DIR}/audio/qaudioinput_mac_p.h
Expand All @@ -44,7 +44,7 @@ if(BUILD_PLATFORM STREQUAL "mac")
-framework AudioUnit
-framework AudioToolbox
)
elseif(BUILD_PLATFORM MATCHES "(win32|wince)")
elseif(KATIE_PLATFORM MATCHES "(win32|wince)")
set(MULTIMEDIA_HEADERS
${MULTIMEDIA_HEADERS}
${CMAKE_CURRENT_SOURCE_DIR}/audio/qaudioinput_win32_p.h
Expand All @@ -57,7 +57,7 @@ elseif(BUILD_PLATFORM MATCHES "(win32|wince)")
${CMAKE_CURRENT_SOURCE_DIR}/audio/qaudiooutput_win32_p.cpp
${CMAKE_CURRENT_SOURCE_DIR}/audio/qaudioinput_win32_p.cpp
)
if(BUILD_PLATFORM STREQUAL "wince")
if(KATIE_PLATFORM STREQUAL "wince")
set(EXTRA_MULTIMEDIA_LIBS
${EXTRA_MULTIMEDIA_LIBS}
coredll
Expand Down Expand Up @@ -87,7 +87,5 @@ elseif(UNIX AND WITH_ALSA AND ALSA_FOUND)
)
include_directories(${ALSA_INCLUDE_DIRS})
add_definitions(-DHAS_ALSA)
else()
katie_definition(-DQT_NO_AUDIO_BACKEND)
endif()

4 changes: 0 additions & 4 deletions src/opengl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ if(NOT WITH_OPENGLES1)
${CMAKE_CURRENT_SOURCE_DIR}/gl2paintengineex/qtriangulator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gl2paintengineex/qtextureglyphcache_gl.cpp
)
else()
katie_definition(-DQT_OPENGL_ES_1)
endif()

if(NOT WITH_OPENGLES2)
Expand All @@ -120,8 +118,6 @@ if(NOT WITH_OPENGLES2)
${OPENGL_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/qpaintengine_opengl.cpp
)
else()
katie_definition(-DQT_OPENGL_ES_2)
endif()

if(WITH_X11 AND X11_FOUND)
Expand Down

0 comments on commit 274d065

Please sign in to comment.