<commit_before>
if (QTONLY)
  # ce: don't know why this is needed here - on win32 'O2' is activated by default in release mode
  if(NOT WIN32)
    add_definitions (${QT_DEFINITIONS} -O2 -msse)
  endif(NOT WIN32)
  include_directories (${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src ${QT_INCLUDE_DIR})
else (QTONLY)
  if(NOT WIN32)
    add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -O2 -msse) 
  endif(NOT WIN32)
  include_directories (${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src ${KDE4_INCLUDES})
endif (QTONLY)

if(MSVC)
  add_definitions(-D_USE_MATH_DEFINES=1)
endif(MSVC)

link_directories (${QT_LIBRARY_DIR})

set(marble_SRCS
           Quaternion.cpp
           GeoPoint.cpp
           GeoPolygon.cpp
	   TextureTile.cpp
           TextureMapper.cpp
           GridMap.cpp
           katlascontrol.cpp
           katlasview.cpp
           katlasviewinputhandler.cpp
           qtmain.cpp
           QtMainWindow.cpp
           #KdeMainWindow.cpp
           texcolorizer.cpp
           TileLoader.cpp
           katlasglobe.cpp
           katlastoolbox.cpp
           vectorcomposer.cpp
           vectormap.cpp
           clippainter.cpp
           placemarkmanager.cpp
           placecontainer.cpp
           placemark.cpp
           searchlistview.cpp
           katlasmapscale.cpp
           placemarkmodel.cpp
           placemarkpainter.cpp
           maptheme.cpp
           tilescissor.cpp
           katlastilecreatordialog.cpp
           katlasthemeselectview.cpp
           katlaswindrose.cpp
           katlasviewpopupmenu.cpp
           katlascrosshair.cpp
           xmlhandler.cpp
           placemarkinfodialog.cpp
           katlasflag.cpp
           tinywebbrowser.cpp
           httpfetchfile.cpp
           measuretool.cpp
	   katlasaboutdialog.cpp
)

set(marble_HDRS
           Quaternion.h
           GeoPoint.h
           GeoPolygon.h
           ScreenPolygon.h
           TextureTile.h
           TextureMapper.h
           GridMap.h
           katlasdirs.h
           katlascontrol.h
           katlasview.h
           katlasviewinputhandler.h
           QtMainWindow.h
           #KdeMainWindow.h
           texcolorizer.h
           TileLoader.h
           katlasglobe.h
           katlastoolbox.h
           vectorcomposer.h
           vectormap.h
           clippainter.h
           placemarkmanager.h
           placecontainer.h
           placemark.h
           searchlistview.h
           katlasmapscale.h
           placemarkmodel.h
           placemarkpainter.h
           maptheme.h
           tilescissor.h
           katlastilecreatordialog.h
           katlasthemeselectview.h
           katlaswindrose.h
           katlasviewpopupmenu.h
           katlascrosshair.h
           xmlhandler.h
           placemarkinfodialog.h
           katlasflag.h
           tinywebbrowser.h
           httpfetchfile.h
           measuretool.h
           katlasaboutdialog.h
)

# cmake does not support this for mingw - see bugtracker
if(MSVC)
  set(marble_SRCS ${marble_SRCS} marble.rc)
endif(MSVC)

set (marble_UI katlastilecreatordialog.ui
	   katlastoolbox.ui placemarkinfodialog.ui katlasaboutdialog.ui)

qt4_add_resources(marble_SRCS marble.qrc)

if (QTONLY)
  qt4_wrap_ui(marble_SRCS ${marble_UI})
  qt4_automoc(${marble_SRCS})
else (QTONLY)
  kde4_add_ui_files(marble_SRCS ${marble_UI})
  kde4_automoc(${marble_SRCS})
endif (QTONLY)

#kde4_add_library (marble SHARED ${marble_SRCS})
if (QTONLY)
  add_executable (marble WIN32 ${marble_SRCS} ${marble_HDRS})
else (QTONLY)
  kde4_add_executable (marble ${marble_SRCS} ${marble_HDRS})
endif (QTONLY)

if (QTONLY)
	target_link_libraries (marble ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTMAIN_LIBRARY})
else (QTONLY)
	target_link_libraries (marble ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${KDE4_KDECORE_LIBRARY} ${QT_QTMAIN_LIBRARY})
endif (QTONLY)
if(WIN32)
  target_link_libraries(marble ws2_32 imm32 winmm)
endif(WIN32)

## this works for win32 only because FindQt4 does not handle this correct
if(STATIC_BUILD)
    target_link_libraries(marble ${QT_PLUGINS_DIR}/imageformats/qjpeg.lib)
    target_link_libraries(marble ${QT_PLUGINS_DIR}/imageformats/qsvg.lib)
endif(STATIC_BUILD)

if(WIN32)
    install (TARGETS marble DESTINATION "")
else(WIN32)
    #set_target_properties(marble PROPERTIES VERSION 1.0.0 SOVERSION 1)
    install (TARGETS marble DESTINATION bin )
    #install (TARGETS marble DESTINATION ${LIB_INSTALL_DIR} )

    if (NOT QTONLY)
      install( FILES marble.desktop  DESTINATION ${XDG_APPS_DIR})
    else (NOT QTONLY)
      install( FILES marble.desktop  DESTINATION share/applications)
    endif (NOT QTONLY)
endif(WIN32)
<commit_msg>Use kde4 cmake macro when it's possible<commit_after>
if (QTONLY)
  # ce: don't know why this is needed here - on win32 'O2' is activated by default in release mode
  if(NOT WIN32)
    add_definitions (${QT_DEFINITIONS} -O2 -msse)
  endif(NOT WIN32)
  include_directories (${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src ${QT_INCLUDE_DIR})
else (QTONLY)
  if(NOT WIN32)
    add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -O2 -msse) 
  endif(NOT WIN32)
  include_directories (${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src ${KDE4_INCLUDES})
endif (QTONLY)

if(MSVC)
  add_definitions(-D_USE_MATH_DEFINES=1)
endif(MSVC)

link_directories (${QT_LIBRARY_DIR})

set(marble_SRCS
           Quaternion.cpp
           GeoPoint.cpp
           GeoPolygon.cpp
	   TextureTile.cpp
           TextureMapper.cpp
           GridMap.cpp
           katlascontrol.cpp
           katlasview.cpp
           katlasviewinputhandler.cpp
           qtmain.cpp
           QtMainWindow.cpp
           #KdeMainWindow.cpp
           texcolorizer.cpp
           TileLoader.cpp
           katlasglobe.cpp
           katlastoolbox.cpp
           vectorcomposer.cpp
           vectormap.cpp
           clippainter.cpp
           placemarkmanager.cpp
           placecontainer.cpp
           placemark.cpp
           searchlistview.cpp
           katlasmapscale.cpp
           placemarkmodel.cpp
           placemarkpainter.cpp
           maptheme.cpp
           tilescissor.cpp
           katlastilecreatordialog.cpp
           katlasthemeselectview.cpp
           katlaswindrose.cpp
           katlasviewpopupmenu.cpp
           katlascrosshair.cpp
           xmlhandler.cpp
           placemarkinfodialog.cpp
           katlasflag.cpp
           tinywebbrowser.cpp
           httpfetchfile.cpp
           measuretool.cpp
	   katlasaboutdialog.cpp
)

set(marble_HDRS
           Quaternion.h
           GeoPoint.h
           GeoPolygon.h
           ScreenPolygon.h
           TextureTile.h
           TextureMapper.h
           GridMap.h
           katlasdirs.h
           katlascontrol.h
           katlasview.h
           katlasviewinputhandler.h
           QtMainWindow.h
           #KdeMainWindow.h
           texcolorizer.h
           TileLoader.h
           katlasglobe.h
           katlastoolbox.h
           vectorcomposer.h
           vectormap.h
           clippainter.h
           placemarkmanager.h
           placecontainer.h
           placemark.h
           searchlistview.h
           katlasmapscale.h
           placemarkmodel.h
           placemarkpainter.h
           maptheme.h
           tilescissor.h
           katlastilecreatordialog.h
           katlasthemeselectview.h
           katlaswindrose.h
           katlasviewpopupmenu.h
           katlascrosshair.h
           xmlhandler.h
           placemarkinfodialog.h
           katlasflag.h
           tinywebbrowser.h
           httpfetchfile.h
           measuretool.h
           katlasaboutdialog.h
)

# cmake does not support this for mingw - see bugtracker
if(MSVC)
  set(marble_SRCS ${marble_SRCS} marble.rc)
endif(MSVC)

set (marble_UI katlastilecreatordialog.ui
	   katlastoolbox.ui placemarkinfodialog.ui katlasaboutdialog.ui)

qt4_add_resources(marble_SRCS marble.qrc)

if (QTONLY)
  qt4_wrap_ui(marble_SRCS ${marble_UI})
  qt4_automoc(${marble_SRCS})
else (QTONLY)
  kde4_add_ui_files(marble_SRCS ${marble_UI})
  kde4_automoc(${marble_SRCS})
endif (QTONLY)

#kde4_add_library (marble SHARED ${marble_SRCS})
if (QTONLY)
  add_executable (marble WIN32 ${marble_SRCS} ${marble_HDRS})
else (QTONLY)
  kde4_add_executable (marble ${marble_SRCS} ${marble_HDRS})
endif (QTONLY)

if (QTONLY)
	target_link_libraries (marble ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTMAIN_LIBRARY})
else (QTONLY)
	target_link_libraries (marble ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${KDE4_KDECORE_LIBRARY} ${QT_QTMAIN_LIBRARY})
endif (QTONLY)
if(WIN32)
  target_link_libraries(marble ws2_32 imm32 winmm)
endif(WIN32)

## this works for win32 only because FindQt4 does not handle this correct
if(STATIC_BUILD)
    target_link_libraries(marble ${QT_PLUGINS_DIR}/imageformats/qjpeg.lib)
    target_link_libraries(marble ${QT_PLUGINS_DIR}/imageformats/qsvg.lib)
endif(STATIC_BUILD)

if(WIN32)
    install (TARGETS marble DESTINATION "")
else(WIN32)
    #set_target_properties(marble PROPERTIES VERSION 1.0.0 SOVERSION 1)
    if( NOT QTONLY)
      install (TARGETS marble DESTINATION bin )
    else( NOT QTONLY)
      install (TARGETS marble DESTINATION ${BIN_INSTALL_DIR} )
    endif(NOT QTONLY)
    #install (TARGETS marble DESTINATION ${LIB_INSTALL_DIR} )

    if (NOT QTONLY)
      install( FILES marble.desktop  DESTINATION ${XDG_APPS_DIR})
    else (NOT QTONLY)
      install( FILES marble.desktop  DESTINATION share/applications)
    endif (NOT QTONLY)
endif(WIN32)

{'fraction_non_alphanumeric': 0.07463760666186903, 'fraction_numerical': 0.009972242212398478, 'mean_word_length': 2.4582296480625665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3555550', 'n_tokens_mistral': 3524, 'n_tokens_neox': 3367, 'n_words': 579}