Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DOOMer committed Sep 14, 2010
0 parents commit b1f3079
Show file tree
Hide file tree
Showing 73 changed files with 14,150 additions and 0 deletions.
208 changes: 208 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,208 @@
cmake_minimum_required( VERSION 2.6 )

# set project's name
project( screengrab )

message(STATUS "System: " ${CMAKE_HOST_SYSTEM_NAME} " " ${CMAKE_HOST_SYSTEM_VERSION})
message(STATUS "Processor: " ${CMAKE_HOST_SYSTEM_PROCESSOR})

find_package( Qt4 REQUIRED COMPONENTS QtCore QtGui QtNetwork)
include( "${QT_USE_FILE}" )

# add version define
set(SCREENGRAB_VERSION "0.9-dev")
set(SCREENGRAB_VERSION_DEV "0.8.84")

if(SCREENGRAB_VERSION_DEV)
set(VERSION "${SCREENGRAB_VERSION} (${SCREENGRAB_VERSION_DEV})")
elseif(NOT SCREENGRAB_VERSION_DEV)
set(VERSION ${SCREENGRAB_VERSION})
endif(SCREENGRAB_VERSION_DEV)

add_definitions( -DVERSION="${VERSION}")
message(STATUS "Version: " ${VERSION})
#${CMAKE_SYSTEM_NAME} [${CMAKE_HOST_SYSTEM_PROCESSOR}]" )

#message(STATUS "Use qmake: " ${QT_QMAKE_EXECUTABLE})
# ------ build type ------------------------

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
add_definitions(-DNDEBUG)
add_definitions(-DQT_NO_DEBUG_OUTPUT)
add_definitions("-O2")
endif(${CMAKE_BUILD_TYPE} MATCHES "Release")
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})

set(CMAKE_CXX_FLAGS "-Wnon-virtual-dtor -Woverloaded-virtual -Wall")
# ------ install prefix --------------------------

set(CMAKE_INSTALL_PREFIX "/usr")

add_definitions( -DPREFIX="${CMAKE_INSTALL_PREFIX}")

message(STATUS "Install prefix: " ${CMAKE_INSTALL_PREFIX})

#------- qtsingleapplication --------
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/common/qkeysequencewidget/")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/common/singleapp/")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/qxt/")

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/common/singleapp")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/common/qkeysequencewidget/src")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/qxt/include/")

# build QxtGui
add_definitions(-DBUILD_QXT_GUI)
#------- sources --------

# with SET() command you can change variables or define new ones
# here we define SAMPLE_SRCS variable that contains a list of all .cpp files
# note that we don't need \ at the end of line
set(SCREENGRAB_SRC
src/main.cpp
src/core/screengrab.cpp
src/core/config.cpp
src/core/regionselect.cpp
src/core/cmdline.cpp
src/core/shortcutmanager.cpp
src/ui/configwidget.cpp
src/ui/about.cpp
src/ui/mainwindow.cpp
)

if(UNIX AND NOT APPLE)
set(SCREENGRAB_SRC ${SCREENGRAB_SRC} src/common/netwm/netwm.cpp)
endif(UNIX AND NOT APPLE)

if(WIN32)
set(WIN_RC screengrab.rc)
endif(WIN32)

# set headers to moc
set(SCREENGRAB_MOC
src/core/screengrab.h
src/ui/configwidget.h
src/ui/about.h
src/ui/mainwindow.h
)

# set headers to moc
set(SCREENGRAB_UI
src/ui/configwidget.ui
src/ui/aboutwidget.ui
src/ui/mainwindow.ui
)

# documentation files
set(DOCS
${CMAKE_CURRENT_SOURCE_DIR}/docs/ChangeLog.txt
${CMAKE_CURRENT_SOURCE_DIR}/docs/LICENSE.txt
${CMAKE_CURRENT_SOURCE_DIR}/docs/README.txt
)

# include headers produced by uic in our code
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)

# Qt resource file
set( SCREENGRAB_QRC ./screengrab.qrc )


include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")


# this will run uic on .ui files:
qt4_wrap_ui(SCREENGRAB_UI_H ${SCREENGRAB_UI} )

# genereate moc headers
qt4_wrap_cpp(SCREENGRAB_MOC_CPP ${SCREENGRAB_MOC} )

# genereating resource cpp
qt4_add_resources( QRC_SOURCES ${SCREENGRAB_QRC} )


#------- find lrelease & create qms ------------

# find lrelease binary
if(NOT QT_LRELEASE_EXECUTABLE)
find_program(QT_LRELEASE_EXECUTABLE
NAMES lrelease
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
endif(NOT QT_LRELEASE_EXECUTABLE)

# debian hack
if(EXISTS ${QT_BINARY_DIR}/lrelease-qt4)
set(QT_LRELEASE_EXECUTABLE ${QT_BINARY_DIR}/lrelease-qt4)
endif(EXISTS ${QT_BINARY_DIR}/lrelease-qt4)

if(QT_LRELEASE_EXECUTABLE)
message(STATUS "Found lrelease executable: " ${QT_LRELEASE_EXECUTABLE})
message(STATUS "Generating localize ...")
execute_process(COMMAND find ${CMAKE_CURRENT_SOURCE_DIR}/localize -name *.ts COMMAND xargs ${QT_LRELEASE_EXECUTABLE} -silent)
else(QT_LRELEASE_EXECUTABLE)
message(FATAL_ERROR "Could NOT find lrelease executable")
endif(QT_LRELEASE_EXECUTABLE)

#------- add icon & trmove console in win32 (mingw) ----------

if(WIN32)
if(NOT MSVC)

find_program(WINDRES
NAMES windres.exe
PATHS ${PATH}
NO_DEFAULT_PATH
)

add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/screengrabrc.o
COMMAND ${WINDRES} -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/screengrab.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/screengrabrc.o )

set(SCREENGRAB_SRC ${SCREENGRAB_SRC} ${CMAKE_CURRENT_BINARY_DIR}/screengrabrc.o)
endif(NOT MSVC)
endif(WIN32)


#------- build executable from sources ----------
add_executable( screengrab ${SCREENGRAB_SRC} ${SCREENGRAB_MOC_CPP} ${SCREENGRAB_UI_H} ${QRC_SOURCES} )


target_link_libraries( screengrab qkeysequencewidget singleapp qxt ${QT_LIBRARIES} )


if(WIN32)
if(NOT MSVC)

set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-mwindows")

endif(NOT MSVC)
endif(WIN32)

#installs unix
if(UNIX AND NOT APPLE)
#INSTALL_TARGETS(/bin screengrab)
INSTALL(TARGETS screengrab RUNTIME DESTINATION bin)

# install txt docs
INSTALL(FILES ${DOCS} DESTINATION share/doc/screengrab)
# install html docs
INSTALL(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/docs/html/" DESTINATION share/doc/screengrab/html)

# install desktop files
INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/screengrab.desktop" DESTINATION share/applications)

# install pixmap
INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/img/screengrab.png" DESTINATION share/pixmaps)

# istall localize
# FILE(GLOB qm "${CMAKE_CURRENT_SOURCE_DIR}/localize/*.qm")
# INSTALL(FILES ${qm} DESTINATION share/screengrab/localize)
INSTALL(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/localize/" DESTINATION share/screengrab/localize FILES_MATCHING PATTERN "*.qm")
endif(UNIX AND NOT APPLE)
70 changes: 70 additions & 0 deletions docs/ChangeLog.txt
@@ -0,0 +1,70 @@
0.8.1
* [Linux] fixed incorrect select default saving format in KDE 4.4.x save file dialog
* add de_DE translation
0.8
* add command line parametrs for grab modes (fullscren, active window, selection area)
* add BMP support
* add pt_BR translation
* add automaticaly hiding main window on grab process
* {linux] fixed grab active window screenshot without decorations
* [linux] add option "no window decoration"
* add shortcuts for main window buttons

0.6.2 [Linux only]
* fixed non-translated tray menu (closed issue #7)

0.6.1 [Linux only]
* fixed incorretc detect system language in some Linux distro

0.6
* default value of hiding main wnd changed to true.
* add input template for insering date-time in saved filename
* add zoom around mouse cursor in area selection mode
* small modified configuraion dialog
* add html help info (eng & rus)

0.5
* add instering date|time in saving filename [optional]
* add auto saving screens in grabbing process [option]
* add change time of display tray messages [1 - 10 src]
* add help info
* add tool tips fo ui elements
* small fixes config file syntax

v0.4
* add grabbing selection screen area
* add copying into clipboard
* add saving size of main window on exit [default is turned off]
* decreased in 2 times the volume occupied by the memory at startup
* [win32] fixed bug with place screengrab.ini
* change structure of some source code
* change buttons tab order of main window
* new application icon
* some fixes

v0.3.1
* fixed bug with non-displayed main window icon

v0.3
* main window now based on ui-file (remaked UI)
* add grabbing active window
* add option for allowing multiple copies of app
* add option for select between minimizing in tray and closing (by close window button)

v0.2
* add JPEG support
* add options dialog.
* add settings for default saving dir, filename and image format.
* add saving options into INI-file.
* add i18n support and Russian localiaztion.
* some fixes and changes in code.
* Windows version now avalible as installer

v0.1
* first public version.
* add system tray icon and menu.
* add hiding in systray.
* add blocking second instance application.

v0.0.3
- first worked build.

0 comments on commit b1f3079

Please sign in to comment.