mirror of
https://github.com/eddyem/eddys_snippets.git
synced 2026-03-20 00:30:59 +03:00
Added image view module
This commit is contained in:
@@ -22,23 +22,11 @@ aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} SOURCES)
|
||||
# add_definitions(-DSOME_DEFS)
|
||||
#endif()
|
||||
|
||||
# cmake -DDEBUG=1 -> debugging
|
||||
if(DEFINED DEBUG)
|
||||
# cmake -DEBUG=1 -> debugging
|
||||
if(DEFINED EBUG)
|
||||
add_definitions(-DEBUG)
|
||||
endif()
|
||||
|
||||
# directory should contain dir locale/ru for gettext translations
|
||||
set(LCPATH ${CMAKE_SOURCE_DIR}/locale/ru)
|
||||
|
||||
if(NOT DEFINED LOCALEDIR)
|
||||
if(DEFINED DEBUG)
|
||||
set(LOCALEDIR ${CMAKE_CURRENT_SOURCE_DIR}/locale)
|
||||
else()
|
||||
set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# gettext modules
|
||||
set(MODULES libavformat libavcodec libswscale libavutil libavdevice)
|
||||
# additional modules on condition
|
||||
#if(DEFINED SOMETHING)
|
||||
@@ -54,6 +42,17 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND CMAKE_INSTALL_PREFIX MATCHES
|
||||
endif()
|
||||
message("Install dir prefix: ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# directory should contain dir locale/ru for gettext translations
|
||||
set(LCPATH ${CMAKE_SOURCE_DIR}/locale/ru)
|
||||
|
||||
if(NOT DEFINED LOCALEDIR)
|
||||
if(DEFINED DEBUG)
|
||||
set(LOCALEDIR ${CMAKE_CURRENT_SOURCE_DIR}/locale)
|
||||
else()
|
||||
set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# gettext files
|
||||
set(PO_FILE ${LCPATH}/messages.po)
|
||||
set(MO_FILE ${LCPATH}/LC_MESSAGES/${PROJ}.mo)
|
||||
@@ -61,26 +60,46 @@ set(RU_FILE ${LCPATH}/ru.po)
|
||||
|
||||
# pkgconfig
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(${PROJ} REQUIRED ${MODULES})
|
||||
#find_package(OpenGL REQUIRED)
|
||||
#find_package(GTK2 REQUIRED)
|
||||
# etc
|
||||
# set(${${PROJ}_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} )
|
||||
# set(${${PROJ}_LIBRARY_DIRS} ...)
|
||||
|
||||
if(MODULES)
|
||||
pkg_check_modules(${PROJ} REQUIRED ${MODULES})
|
||||
endif()
|
||||
|
||||
#OpenMP
|
||||
#include(FindOpenMP)
|
||||
#if(OPENMP_FOUND)
|
||||
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
|
||||
#endif()
|
||||
|
||||
# exe file
|
||||
add_executable(${PROJ} ${SOURCES} ${PO_FILE} ${MO_FILE})
|
||||
target_link_libraries(${PROJ} ${${PROJ}_LIBRARIES})
|
||||
include_directories(${${PROJ}_INCLUDE_DIRS})
|
||||
link_directories(${${PROJ}_LIBRARY_DIRS})
|
||||
target_link_libraries(${PROJ} ${${PROJ}_LIBRARIES} ${OPENGL_LIBRARIES} ...)
|
||||
include_directories(${${PROJ}_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ...)
|
||||
link_directories(${${PROJ}_LIBRARY_DIRS} )
|
||||
add_definitions(${CFLAGS} -DLOCALEDIR=\"${LOCALEDIR}\"
|
||||
-DPACKAGE_VERSION=\"${VERSION}\" -DGETTEXT_PACKAGE=\"${PROJ}\"
|
||||
-DMINOR_VERSION=\"${MINOR_VERSION}\" -DMID_VERSION=\"${MID_VERSION}\"
|
||||
-DMAJOR_VERSION=\"${MAJOR_VESION}\")
|
||||
|
||||
# Installation of the program
|
||||
INSTALL(FILES ${MO_FILE} DESTINATION "share/locale/ru/LC_MESSAGES")
|
||||
#PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
||||
INSTALL(TARGETS ${PROJ} DESTINATION "bin")
|
||||
#PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
# Script to be executed at installation time (kind of post-intallation script) to
|
||||
# change the right accesses on the installed files
|
||||
#INSTALL(SCRIPT inst.cmake)
|
||||
if(NOT DEFINED DEBUG)
|
||||
INSTALL(FILES ${MO_FILE} DESTINATION "share/locale/ru/LC_MESSAGES")
|
||||
#PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
||||
INSTALL(TARGETS ${PROJ} DESTINATION "bin")
|
||||
#PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
# Script to be executed at installation time (kind of post-intallation script) to
|
||||
# change the right accesses on the installed files
|
||||
#INSTALL(SCRIPT inst.cmake)
|
||||
else()
|
||||
install(CODE "MESSAGE(\"Don't install in DEBUG mode! First run cmake without -DEBUG defined.\")")
|
||||
endif(NOT DEFINED DEBUG)
|
||||
|
||||
find_package(Gettext REQUIRED)
|
||||
find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
|
||||
|
||||
Reference in New Issue
Block a user