Skip to content
Commits on Source (8)
.project
build
src/config.h
[Buildset]
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\n\x00b\x00e\x00a\x00d\x00s)
[CMake]
Build Directory Count=1
Current Build Directory Index=0
ProjectRootRelative=./
[CMake][CMake Build Directory 0]
Build Directory Path=file:///home/langella/developpement/git/beads/build
Build Type=
CMake Binary=file:///usr/bin/cmake
Environment Profile=
Extra Arguments=
Install Directory=file:///usr/local
[Defines And Includes][Compiler]
Name=GCC
Path=gcc
Type=GCC
[Project]
VersionControlSupport=kdevgit
......@@ -16,23 +16,21 @@ PROJECT(beads CXX C)
#message ("compiler : ${CMAKE_CXX_COMPILER} ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
IF ( CMAKE_BASE_NAME MATCHES "cl")
message ("on est sous Windows")
SET( WIN32 "true")
ENDIF(CMAKE_BASE_NAME MATCHES "cl")
#IF ( CMAKE_BASE_NAME MATCHES "cl")
# message ("on est sous Windows")
# SET( WIN32 "true")
#ENDIF(CMAKE_BASE_NAME MATCHES "cl")
if (NOT CMAKE_BUILD_TYPE)
SET( CMAKE_BUILD_TYPE "Release")
ENDIF(NOT CMAKE_BUILD_TYPE)
if (NOT CMAKE_INSTALL_PREFIX)
SET (CMAKE_INSTALL_PREFIX /usr/local)
ENDIF(NOT CMAKE_INSTALL_PREFIX)
IF (CMAKE_INSTALL_PREFIX MATCHES "/usr/local")
SET( CMAKE_BUILD_TYPE "Debug")
#SET( CMAKE_BUILD_TYPE "Release")
ENDIF (CMAKE_INSTALL_PREFIX MATCHES "/usr/local")
IF ( CMAKE_BUILD_TYPE MATCHES "Release")
MESSAGE("compiling as release version")
......@@ -46,24 +44,15 @@ ENDIF( CMAKE_BUILD_TYPE MATCHES "Release" )
#SET(WIN32 "true")
#SET(MINGW "true")
set(CMAKE_MODULE_PATH ${beads_SOURCE_DIR}/cmake_modules)
#FIND_PACKAGE ( FindPTHREADS REQUIRED )
#are we using pthreads ?
#IF ( CMAKE_USE_PTHREADS_INIT )
# INCLUDE_DIRECTORIES ( ${EXPAT_INCLUDE_DIRS} )
#ELSE ( CMAKE_USE_PTHREADS_INIT )
# MESSAGE( FATAL_ERROR "No pthread installed" )
#ENDIF( CMAKE_USE_PTHREADS_INIT )
#set(CMAKE_MODULE_PATH ${beads_SOURCE_DIR}/cmake_modules)
#IF ( PTHREADS_FOUND )
INCLUDE_DIRECTORIES ( ${PTHREADS_INCLUDE_DIR} )
# INCLUDE_DIRECTORIES ( ${PTHREADS_INCLUDE_DIR} )
#ELSE ( PTHREADS_FOUND )
# MESSAGE( FATAL_ERROR "No pthread installed" )
#ENDIF( PTHREADS_FOUND )
cmake_minimum_required(VERSION 2.6)
SET ( EXTRA_CIMG_LIBRARY "")
......@@ -75,18 +64,18 @@ IF(WIN32)
#SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
# FIND_PACKAGE(FindMagick REQUIRED)
ELSE(WIN32)
FIND_PACKAGE(Pthreads REQUIRED)
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
#FIND_PACKAGE(Pthreads REQUIRED)
SET(CMAKE_CXX_FLAGS_RELEASE "-s -O3 -DNDEBUG")
SET ( CIMG_OS 1)
ENDIF(WIN32)
#
#CMAKE_CXX_FLAGS
SET(CMAKE_CXX_FLAGS_DEBUG "-g")
SET(CMAKE_CXX_FLAGS_DEBUG "-g -s")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
SET (BEADS_VERSION "1.1.13")
SET (BEADS_VERSION "1.1.17")
SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
SET(CPACK_GENERATOR "STGZ;TGZ;TZ")
......@@ -109,21 +98,23 @@ ENDIF( CMAKE_BUILD_TYPE MATCHES "Debug")
SET(CPACK_PACKAGE_VERSION ${BEADS_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "13")
SET(CPACK_PACKAGE_VERSION_PATCH "15")
SET(CPACK_RESOURCE_FILE_LICENSE ${beads_SOURCE_DIR}/COPYING)
SET(CPACK_RESOURCE_FILE_README ${beads_SOURCE_DIR}/README)
SET(CPACK_RESOURCE_FILE_WELCOME ${beads_SOURCE_DIR}/INSTALL)
SET(CPACK_SOURCE_GENERATOR "TGZ;TZ")
SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "./CPackSourceConfig.cmake")
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_STRIP_FILES "bin/beads")
SET(CPACK_SYSTEM_NAME "Linux-i686")
SET(CPACK_TOPLEVEL_TAG "Linux-i686")
SET(CPACK_SOURCE_IGNORE_FILES
"moc_.*cxx"
"/devel_archives/"
"/build/"
"/cbuild/"
"/figures/"
".*\\\\.so"
".*\\\\.a"
"/Soumis/"
"/samples/"
"/win32/"
......@@ -141,7 +132,7 @@ SET(CPACK_SOURCE_IGNORE_FILES
"/Debug/"
"/Release/"
"/\\\\.externalToolBuilders/"
"/\\\\.svn/"
"/\\\\.git/"
"/\\\\.settings/"
"Makefile"
"\\\\.cdtbuild"
......@@ -165,6 +156,17 @@ SET(CPACK_SOURCE_IGNORE_FILES
# debuild -S -sa
# dput -f olivier-langella *changes
#dch -Djessie "message"
#cmake ..
#make deb
# scp beads* proteus.moulon.inra.fr:/var/www/apt/incoming
# reprepro -Vb /var/www/apt processincoming default
configure_file (${beads_SOURCE_DIR}/src/config.h.cmake ${beads_SOURCE_DIR}/src/config.h)
......@@ -177,16 +179,18 @@ INCLUDE(CPack)
#INCLUDE(CPack)
SET(CPACK_STRIP_FILES "src/beads;src/qtbeads/qtbeads")
# Recurse into the "src" subdirectories. This does not actually
# cause another cmake executable to run. The same process will walk through
# the project's entire directory structure.
SUBDIRS (src)
#ADD_DEFINITIONS( -lpthread)
add_subdirectory (src)
#SET(CPACK_STRIP_FILES "src/beads;src/qtbeads/qtbeads")
INSTALL(PROGRAMS src/beads DESTINATION bin)
INSTALL(PROGRAMS src/qtbeads/qtbeads DESTINATION bin)
INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/src/beads DESTINATION bin)
INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/src/qtbeads/qtbeads DESTINATION bin)
#INSTALL(DIRECTORY doc/man1 DESTINATION share/man/man1)
INSTALL(FILES doc/man1/beads.1 DESTINATION share/man/man1)
INSTALL(FILES share/applications/beads.desktop DESTINATION share/applications)
......@@ -195,3 +199,16 @@ INSTALL(FILES share/beads/beads_silver.conf DESTINATION share/beads)
INSTALL(FILES share/beads/beads_silver_small.conf DESTINATION share/beads)
INSTALL(FILES share/beads/beads_icon.svg DESTINATION share/beads)
add_custom_target(targz
cpack -G TGZ --config CPackSourceConfig.cmake && tar xvfz beads-${BEADS_VERSION}.tar.gz
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Creating .tar.gz" VERBATIM
)
add_custom_target(deb
cd beads-${BEADS_VERSION} && dpkg-buildpackage
DEPENDS targz
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Creating Debian package" VERBATIM
)
[Project]
CreatedFrom=beads
Manager=KDevCMakeManager
Name=beads
# - Try to find CImg lib
#
# The following variables are defined
#
# CImg_FOUND - system has CImg lib
# CImg_INCLUDE_DIRS - the CImg include directory
# CImg_SYSTEM_LIBS - external libraries that CImg uses
# CImg_SYSTEM_LIBS_DIR - external library directories
# CImg_CFLAGS - compilation flags
if (CImg_INCLUDE_DIR)
set(CImg_FOUND TRUE)
else (CImg_INCLUDE_DIR)
find_path(CImg_INCLUDE_DIR
NAMES CImg.h
PATHS
${CMAKE_INSTALL_PREFIX}/include
/usr/include
)
mark_as_advanced(CImg_INCLUDE_DIR)
endif(CImg_INCLUDE_DIR)
list(APPEND CImg_INCLUDE_DIRS
${CImg_INCLUDE_DIR}
)
# To use PKG_CHECK_MODULES to find some optional packages
find_package(PkgConfig)
# ### CIMG related stuff
# Flags to enable fast image display, using the XSHM library.
#SET(CIMG_XSHM_CCFLAGS -Dcimg_use_xshm)
# Flags to enable screen mode switching, using the XRandr library.
#SET(CIMG_XRANDR_CCFLAGS -Dcimg_use_xrandr)
# Flags to enable native support for JPEG image files, using the JPEG library.
# ( http://www.ijg.org/ )
SET(CIMG_JPEG_CCFLAGS -Dcimg_use_jpeg)
# Flags to enable native support for TIFF image files, using the TIFF library.
# ( http://www.libtiff.org/ )
SET(CIMG_TIFF_CCFLAGS -Dcimg_use_tiff)
# Flags to enable native support for PNG image files, using the PNG library.
# ( http://www.libpng.org/ )
SET(CIMG_PNG_CCFLAGS -Dcimg_use_png)
#Flags to enable OPENCV support (Camera)
# ( http://www.opencv.org/ )
#SET(CIMG_OPENCV_CCFLAGS -Dcimg_use_opencv)
# Flags to enable native support for EXR image files, using the OpenEXR library.
# ( http://www.openexr.com/ )
#SET(CIMG_OPENEXR_CCFLAGS -Dcimg_use_openexr)
# Flags to enable native support for various video files, using the FFMPEG library.
# ( http://www.ffmpeg.org/ )
#SET(CIMG_FFMPEG_CCFLAGS -Dcimg_use_ffmpeg)
# Flags to enable native support of most classical image file formats, using the Magick++ library.
# ( http://www.imagemagick.org/Magick++/ )
#SET(CIMG_MAGICK_CCFLAGS -Dcimg_use_magick)
# Flags to enable faster Discrete Fourier Transform computation, using the FFTW3 library
# ( http://www.fftw.org/ )
#SET(CIMG_FFTW3_CCFLAGS -Dcimg_use_fftw3)
# Flags to enable zlib.
# ( http://www.zlib.net/ )
SET(CIMG_ZLIB_CCFLAGS -Dcimg_use_zlib)
# ### Search Additional Libraries ##########
#FIND_PACKAGE(OpenCV)
FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(TIFF REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
#FIND_PACKAGE(LAPACK)
#FIND_PACKAGE(BLAS)
#PKG_CHECK_MODULES(FFTW3 fftw3)
#PKG_CHECK_MODULES(OPENEXR OpenEXR)
#PKG_CHECK_MODULES(MAGICK Magick++)
# PKG_CHECK_MODULES(LIBAVCODEC libavcodec)
# PKG_CHECK_MODULES(LIBAVFORMAT libavformat)
# PKG_CHECK_MODULES(LIBSWSCALE libswscale)
# PKG_CHECK_MODULES(LIBAVUTIL libavutil)
if(NOT WIN32)
FIND_PACKAGE(X11)
FIND_PACKAGE(Threads REQUIRED)
endif()
# #### End of additional libraries search ##########
### Configure Paths according to detected packages
if(TIFF_FOUND)
get_filename_component(TIFF_LIB_DIRS ${TIFF_LIBRARIES} PATH)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_TIFF_CCFLAGS}")
# link_directories(${TIFF_LIB_DIRS})
# include_directories(${TIFF_INCLUDE_DIR})
# SET(CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${TIFF_LIBRARIES})
list(APPEND CImg_INCLUDE_DIRS
${TIFF_INCLUDE_DIR}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${TIFF_LIB_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${TIFF_LIBRARIES}
)
endif()
if(JPEG_FOUND)
get_filename_component(JPEG_LIB_DIRS ${JPEG_LIBRARIES} PATH)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_JPEG_CCFLAGS}")
# link_directories(${JPEG_LIB_DIRS})
# include_directories(${JPEG_INCLUDE_DIR})
# SET(CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${JPEG_LIBRARIES})
list(APPEND CImg_INCLUDE_DIRS
${JPEG_INCLUDE_DIR}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${JPEG_LIB_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${JPEG_LIBRARIES}
)
endif()
if (ZLIB_FOUND)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_ZLIB_CCFLAGS}")
# link_directories(${ZLIB_LIB_DIRS})
# include_directories(${ZLIB_INCLUDE_DIR})
# SET(CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${ZLIB_LIBRARIES})
list(APPEND CImg_INCLUDE_DIRS
${ZLIB_INCLUDE_DIR}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${ZLIB_LIB_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${ZLIB_LIBRARIES}
)
# PNG requires ZLIB
if(PNG_FOUND)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_PNG_CCFLAGS}")
# link_directories(${PNG_LIB_DIRS})
# include_directories(${PNG_INCLUDE_DIR} )
# SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${PNG_LIBRARIES} )
list(APPEND CImg_INCLUDE_DIRS
${PNG_INCLUDE_DIR}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${PNG_LIB_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${PNG_LIBRARIES}
)
endif()
endif()
if(FFTW3_FOUND)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_FFTW3_CCFLAGS}")
#link_directories( ${FFTW3_LIBRARY_DIRS} )
#include_directories( ${FFTW3_INCLUDE_DIRS} )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${FFTW3_LIBRARIES} )
list(APPEND CImg_INCLUDE_DIRS
${FFTW3_INCLUDE_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${FFTW3_LIBRARY_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${FFTW3_LIBRARIES}
)
endif()
if(OPENEXR_FOUND)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_OPENEXR_CCFLAGS}")
#link_directories( ${OPENEXR_LIBRARY_DIRS} )
#include_directories( ${OPENEXR_INCLUDE_DIRS} )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${OPENEXR_LIBRARIES} )
list(APPEND CImg_INCLUDE_DIRS
${OPENEXR_INCLUDE_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${OPENEXR_LIBRARY_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${OPENEXR_LIBRARIES}
)
endif()
if(MAGICK_FOUND)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_MAGICK_CCFLAGS}")
#link_directories( ${MAGICK_LIBRARY_DIRS} )
#include_directories( ${MAGICK_INCLUDE_DIRS} )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${MAGICK_LIBRARIES} )
list(APPEND CImg_INCLUDE_DIRS
${MAGICK_INCLUDE_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${MAGICK_LIBRARY_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${MAGICK_LIBRARIES}
)
endif()
if( LIBAVCODEC_FOUND AND LIBAVFORMAT_FOUND AND LIBSWSCALE_FOUND AND LIBAVUTIL_FOUND )
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_FFMPEG_CCFLAGS}")
#link_directories( ${LIBAVFORMAT_LIBRARY_DIRS} )
#link_directories( ${LIBAVCODEC_LIBRARY_DIRS} )
#link_directories( ${LIBSWSCALE_LIBRARY_DIRS} )
#link_directories( ${LIBAVUTIL_LIBRARY_DIRS} )
#include_directories( ${LIBAVFORMAT_INCLUDE_DIRS} ${LIBAVFORMAT_INCLUDE_DIRS}/libavformat)
#include_directories( ${LIBAVCODEC_INCLUDE_DIRS} ${LIBAVCODEC_INCLUDE_DIRS}/libavcodec )
#include_directories( ${LIBSWSCALE_INCLUDE_DIRS} ${LIBSWSCALE_INCLUDE_DIRS}/libswscale)
#include_directories( ${LIBAVUTIL_INCLUDE_DIRS} ${LIBAVUTIL_INCLUDE_DIRS}/libavutil )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${LIBAVFORMAT_LIBRARIES} )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${LIBAVCODEC_LIBRARIES} )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${LIBSWSCALE_LIBRARIES} )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${LIBAVUTIL_LIBRARIES} )
list(APPEND CImg_INCLUDE_DIRS
${LIBAVFORMAT_INCLUDE_DIRS} ${LIBAVFORMAT_INCLUDE_DIRS}/libavformat
${LIBAVCODEC_INCLUDE_DIRS} ${LIBAVCODEC_INCLUDE_DIRS}/libavcodec
${LIBSWSCALE_INCLUDE_DIRS} ${LIBSWSCALE_INCLUDE_DIRS}/libswscale
${LIBAVUTIL_INCLUDE_DIRS} ${LIBAVUTIL_INCLUDE_DIRS}/libavutil
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${LIBAVFORMAT_LIBRARY_DIRS}
${LIBAVCODEC_LIBRARY_DIRS}
${LIBSWSCALE_LIBRARY_DIRS}
${LIBAVUTIL_LIBRARY_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${LIBAVFORMAT_LIBRARIES}
${LIBAVCODEC_LIBRARIES}
${LIBSWSCALE_LIBRARIES}
${LIBAVUTIL_LIBRARIES}
)
endif()
if(NOT APPLE)
if(NOT WIN32)
if(X11_FOUND)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_XSHM_CCFLAGS} ${CIMG_XRANDR_CCFLAGS}")
SET(CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} Xext Xrandr)
endif()
endif(NOT WIN32)
endif(NOT APPLE)
if(X11_FOUND)
#link_directories(${X11_LIB_DIRS})
#include_directories(${X11_INCLUDE_DIR})
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${X11_LIBRARIES} )
list(APPEND CImg_INCLUDE_DIRS
${X11_INCLUDE_DIR}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${X11_LIB_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${X11_LIBRARIES}
)
endif()
if (NOT WIN32)
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${CMAKE_THREAD_LIBS_INIT} )
list(APPEND CImg_SYSTEM_LIBS
${CMAKE_THREAD_LIBS_INIT}
)
endif()
if( WIN32)
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} gdi32 )
list(APPEND CImg_SYSTEM_LIBS
gdi32
)
endif()
if (OpenCV_FOUND)
message("OpenCV Found")
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_OPENCV_CCFLAGS}")
#include_directories(${OpenCV_INCLUDE_DIRS})
#link_directories(${OpenCV_LIB_DIRS})
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${OpenCV_LIBS} )
list(APPEND CImg_INCLUDE_DIRS
${OpenCV_INCLUDE_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${OpenCV_LIB_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${OpenCV_LIBS}
)
endif()
if(LAPACK_FOUND)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_LAPACK_CCFLAGS}")
#link_directories( ${LAPACK_LIBRARY_DIRS} )
#include_directories( ${LAPACK_INCLUDE_DIRS} )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${LAPACK_LIBRARIES} )
list(APPEND CImg_INCLUDE_DIRS
${LAPACK_INCLUDE_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${LAPACK_LIBRARY_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${LAPACK_LIBRARIES}
)
endif()
if(BLAS_FOUND)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_BLAS_CCFLAGS}")
#link_directories( ${BLAS_LIBRARY_DIRS} )
#include_directories( ${BLAS_INCLUDE_DIRS} )
#SET( CImg_SYSTEM_LIBS ${CImg_SYSTEM_LIBS} ${BLAS_LIBRARIES} )
list(APPEND CImg_INCLUDE_DIRS
${BLAS_INCLUDE_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS_DIR
${BLAS_LIBRARY_DIRS}
)
list(APPEND CImg_SYSTEM_LIBS
${BLAS_LIBRARIES}
)
endif()
# Add CIMG Flags to Compilation Flags
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CIMG_CFLAGS}")
foreach(program ${CIMG_FILES})
add_executable(${program} ${program}.cpp)
target_link_libraries(${program} ${CImg_SYSTEM_LIBS} )
endforeach(program)
# - Find Magick
# This module finds if the Magick++ libraries and headers (distributed
# with ImageMagick are installed. If you are looking for the ImageMagick
# programs please see FIND_PACKAGE(ImageMagick).
#
# This module sets the following variables:
#
# MAGICK_FOUND
# True if the Magick++ library was found
# MAGICK_INCLUDE_DIR
# The include path of the Magick++.h header file
# MAGICK_LIBRARY
# The location of the Magick library
# MAGICK++_LIBRARY
# THe location of the Magick++ library
#
# Find the Magick++ include path
FIND_PATH(MAGICK_INCLUDE_DIR Magick++.h
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include"
)
FIND_LIBRARY(MAGICK_LIBRARY Magick CORE_RL_Magick_
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib"
)
FIND_LIBRARY(MAGICK++_LIBRARY Magick++ CORE_RL_Magick++_
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib"
)
IF(MAGICK_INCLUDE_DIR AND MAGICK_LIBRARY AND MAGICK++_LIBRARY)
SET(MAGICK_FOUND true)
SET(MAGICK_INCLUDE_DIRS ${MAGICK_INCLUDE_DIR})
SET(MAGICK_LIBRARIES ${MAGICK_LIBRARY} ${MAGICK++_LIBRARY})
ENDIF(MAGICK_INCLUDE_DIR AND MAGICK_LIBRARY AND MAGICK++_LIBRARY)
IF(MAGICK_FOUND)
IF(NOT MAGICK_FIND_QUIETLY)
MESSAGE(STATUS "Found Magick: ${MAGICK_LIBRARY}")
MESSAGE(STATUS "Found Magick++: ${MAGICK++_LIBRARY}")
ENDIF(NOT MAGICK_FIND_QUIETLY)
ELSE(MAGICK_FOUND)
IF(MAGICK_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find the Magick library")
ENDIF(MAGICK_FIND_REQUIRED)
ENDIF(MAGICK_FOUND)
# The following variables are set
# CMAKE_THREAD_LIBS_INIT - the thread library
# CMAKE_USE_SPROC_INIT - are we using sproc?
# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
# CMAKE_USE_PTHREADS_INIT - are we using pthreads
# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
IF( WIN32 )
FIND_PACKAGE(Threads REQUIRED)
#FIND_PATH(EXPAT_INCLUDE_DIR NAMES pthread.h /MinGW/include)
#MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR)
#SET (EXPAT_INCLUDE_DIRS /MinGW/include)
# Look for the library.
#FIND_LIBRARY(CMAKE_THREAD_LIBS_INIT NAMES pthreadGCE2 PATHS /MinGW/lib)
#SET(CMAKE_USE_PTHREADS_INIT 1)
#MARK_AS_ADVANCED(CMAKE_USE_PTHREADS_INIT)
#ADD_LIBRARY(pthreadGCE2 STATIC)
ELSE (WIN32)
FIND_PACKAGE(Threads REQUIRED)
#ADD_LIBRARY(pthread SHARED ${CMAKE_THREAD_LIBS_INIT})
ENDIF( WIN32 )
\ No newline at end of file
# - Find the Pthreads library
# This module searches for the Pthreads library (including the
# pthreads-win32 port).
#
# This module defines these variables:
#
# PTHREADS_FOUND
# True if the Pthreads library was found
# PTHREADS_LIBRARY
# The location of the Pthreads library
# PTHREADS_INCLUDE_DIR
# The include path of the Pthreads library
# PTHREADS_DEFINITIONS
# Preprocessor definitions to define
#
# This module responds to the PTHREADS_EXCEPTION_SCHEME
# variable on Win32 to allow the user to control the
# library linked against. The Pthreads-win32 port
# provides the ability to link against a version of the
# library with exception handling. IT IS NOT RECOMMENDED
# THAT YOU USE THIS because most POSIX thread implementations
# do not support stack unwinding.
#
# PTHREADS_EXCEPTION_SCHEME
# C = no exceptions (default)
# (NOTE: This is the default scheme on most POSIX thread
# implementations and what you should probably be using)
# CE = C++ Exception Handling
# SE = Structure Exception Handling (MSVC only)
#
#
# Define a default exception scheme to link against
# and validate user choice.
#
IF(NOT DEFINED PTHREADS_EXCEPTION_SCHEME)
# Assign default if needed
SET(PTHREADS_EXCEPTION_SCHEME "C")
ELSE(NOT DEFINED PTHREADS_EXCEPTION_SCHEME)
# Validate
IF(NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "C" AND
NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "CE" AND
NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "SE")
MESSAGE(FATAL_ERROR "See documentation for FindPthreads.cmake, only C, CE, and SE modes are allowed")
ENDIF(NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "C" AND
NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "CE" AND
NOT PTHREADS_EXCEPTION_SCHEME STREQUAL "SE")
IF(NOT MSVC AND PTHREADS_EXCEPTION_SCHEME STREQUAL "SE")
MESSAGE(FATAL_ERROR "Structured Exception Handling is only allowed for MSVC")
ENDIF(NOT MSVC AND PTHREADS_EXCEPTION_SCHEME STREQUAL "SE")
ENDIF(NOT DEFINED PTHREADS_EXCEPTION_SCHEME)
#
# Find the header file
#
FIND_PATH(PTHREADS_INCLUDE_DIR pthread.h)
#
# Find the library
#
SET(names)
IF(MSVC)
SET(names
pthreadV${PTHREADS_EXCEPTION_SCHEME}2
pthread
)
ELSEIF(MINGW)
SET(names
pthreadG${PTHREADS_EXCEPTION_SCHEME}2
pthread
)
ELSE(MSVC) # Unix / Cygwin / Apple
SET(names pthread)
ENDIF(MSVC)
FIND_LIBRARY(PTHREADS_LIBRARY ${names}
DOC "The Portable Threads Library")
IF(PTHREADS_INCLUDE_DIR AND PTHREADS_LIBRARY)
SET(PTHREADS_FOUND true)
SET(PTHREADS_DEFINITIONS -DHAVE_PTHREAD_H)
SET(PTHREADS_INCLUDE_DIRS ${PTHREADS_INCLUDE_DIR})
SET(PTHREADS_LIBRARIES ${PTHREADS_LIBRARY})
ENDIF(PTHREADS_INCLUDE_DIR AND PTHREADS_LIBRARY)
IF(PTHREADS_FOUND)
IF(NOT PTHREADS_FIND_QUIETLY)
MESSAGE(STATUS "Found Pthreads: ${PTHREADS_LIBRARY}")
ENDIF(NOT PTHREADS_FIND_QUIETLY)
ELSE(PTHREADS_FOUND)
IF(PTHREADS_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find the Pthreads Library")
ENDIF(PTHREADS_FIND_REQUIRED)
ENDIF(PTHREADS_FOUND)
beads (1.1.17+dfsg-1) UNRELEASED; urgency=medium
* New upstream version
* Watch file now reports new upstream URLs (not fit for proper download
yet since some more sophisticated name mangling is needed)
* Standards-Version: 4.1.3
* debhelper 11
* Build-Depends: libodsstream-qt5-dev
-- Andreas Tille <tille@debian.org> Mon, 12 Feb 2018 10:22:39 +0100
beads (1.1.13+dfsg-2) unstable; urgency=medium
* replacing the build dependency on qttools5-dev-tools with qttools5-dev
......
......@@ -4,12 +4,13 @@ Uploaders: Andreas Tille <tille@debian.org>,
Olivier Langella <olivier.langella@moulon.inra.fr>
Section: science
Priority: optional
Build-Depends: debhelper (>= 10),
Build-Depends: debhelper (>= 11),
cmake,
qtbase5-dev,
qttools5-dev,
libodsstream-qt5-dev,
cimg-dev
Standards-Version: 4.1.1
Standards-Version: 4.1.3
Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/beads.git
Vcs-Git: https://anonscm.debian.org/git/debian-med/beads.git
Homepage: http://moulon.inra.fr/beads/beads.html
......
Author: Juhani Numminen <juhaninumminen0@gmail.com>
Last-Update: 2017-10-21
Description: CMakeFiles.txt assumed in-source build
but we are using separate build directory.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -186,8 +186,8 @@ SET(CPACK_STRIP_FILES "src/beads;src/qtb
# the project's entire directory structure.
SUBDIRS (src)
-INSTALL(PROGRAMS src/beads DESTINATION bin)
-INSTALL(PROGRAMS src/qtbeads/qtbeads DESTINATION bin)
+INSTALL(PROGRAMS "${CMAKE_BINARY_DIR}/src/beads" DESTINATION bin)
+INSTALL(PROGRAMS "${CMAKE_BINARY_DIR}/src/qtbeads/qtbeads" DESTINATION bin)
#INSTALL(DIRECTORY doc/man1 DESTINATION share/man/man1)
INSTALL(FILES doc/man1/beads.1 DESTINATION share/man/man1)
INSTALL(FILES share/applications/beads.desktop DESTINATION share/applications)
......@@ -2,55 +2,9 @@ Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 19 Oct 2017 14:58:04 +0200
Description: Port from Qt4 to Qt5
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,12 +1,7 @@
- # this command finds Qt4 libraries and sets all required variables
- # note that it's Qt4, not QT4 or qt4
-FIND_PACKAGE( Qt4 REQUIRED )
-
-
- # add some useful macros and variables
- # (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that contains a path to CMake script)
-INCLUDE( ${QT_USE_FILE} )
+ # this command finds Qt5 libraries and sets all required variables
+ # note that it's Qt5, not QT5 or qt5
+FIND_PACKAGE( Qt5 REQUIRED COMPONENTS Widgets LinguistTools )
SET( BEADS_CPP
beads.cpp
@@ -62,7 +57,7 @@
target_link_libraries (beads ${EXTRA_CIMG_LIBRARY} ${QT_LIBRARIES} )
ELSE(WIN32)
# Link the executable to the Hello library.
- target_link_libraries (beads ${X11_LIBRARIES} m ${PTHREADS_LIBRARY} ${EXTRA_CIMG_LIBRARY} ${QT_LIBRARIES} )
+ target_link_libraries (beads ${X11_LIBRARIES} m ${PTHREADS_LIBRARY} ${EXTRA_CIMG_LIBRARY} Qt5::Widgets )
ENDIF(WIN32)
-SUBDIRS (qtbeads)
\ No newline at end of file
+SUBDIRS (qtbeads)
--- a/src/qtbeads/CMakeLists.txt
+++ b/src/qtbeads/CMakeLists.txt
@@ -1,12 +1,9 @@
- # this command finds Qt4 libraries and sets all required variables
- # note that it's Qt4, not QT4 or qt4
-FIND_PACKAGE( Qt4 REQUIRED )
+ # this command finds Qt5 libraries and sets all required variables
+ # note that it's Qt5, not QT5 or qt5
+FIND_PACKAGE( Qt5 REQUIRED COMPONENTS Widgets PrintSupport LinguistTools )
-
- # add some useful macros and variables
- # (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that contains a path to CMake script)
-INCLUDE( ${QT_USE_FILE} )
+SET(CMAKE_AUTOMOC ON)
SET( BEADS_FOR_QT_CPP
../ConfigFile/ConfigFile
@@ -47,11 +44,6 @@
@@ -16,11 +16,6 @@ SET( QTBEADS_SRCS
QCimg.cpp
q_gel_image.cpp
q_gel_image_scroll.cpp
......@@ -62,48 +16,3 @@ Description: Port from Qt4 to Qt5
main_window.h
q_gel_image.h
)
@@ -80,7 +72,7 @@
# Translation files
SET(GLOB TRANS translations/*.ts)
# add translations ...
-QT4_ADD_TRANSLATION(QM ${TRANS})
+QT5_ADD_TRANSLATION(QM ${TRANS})
@@ -90,25 +82,13 @@
#FIND_PACKAGE(Qwt5 REQUIRED)
-
-
- # this command will generate rules that will run rcc on all files from SAMPLE_RCS
- # in result SAMPLE_RC_SRCS variable will contain paths to files produced by rcc
-QT4_ADD_RESOURCES( QTBEADS_SRCS ${SAMPLE_RCS} )
-
- # this will run uic on .ui files:
- #QT4_WRAP_UI( SAMPLE_UI_HDRS ${SAMPLE_UIS} )
-
- # and finally this will run moc:
-QT4_WRAP_CPP( QTBEADS_MOC_SRCS ${QTBEADS_MOC_HDRS} )
-
# we need this to be able to 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)
#INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ${Qwt5_INCLUDE_DIR})
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR})
# here we instruct CMake to build "sample" executable from all of the source files
-ADD_EXECUTABLE( qtbeads ${BEADS_FOR_QT_CPP} ${QTBEADS_SRCS} ${QTBEADS_MOC_SRCS} ${SAMPLE_RC_SRCS} ${SAMPLE_UI_HDRS} ${QM} )
+ADD_EXECUTABLE( qtbeads ${BEADS_FOR_QT_CPP} ${QTBEADS_SRCS} ${QM} )
# last thing we have to do is to tell CMake what libraries our executable needs,
@@ -118,7 +98,7 @@
IF(WIN32)
TARGET_LINK_LIBRARIES( qtbeads ${QT_LIBRARIES} ${EXTRA_CIMG_LIBRARY})
ELSE(WIN32)
- TARGET_LINK_LIBRARIES( qtbeads ${QT_LIBRARIES} m ${PTHREADS_LIBRARY} ${EXTRA_CIMG_LIBRARY})
+ TARGET_LINK_LIBRARIES( qtbeads Qt5::Widgets Qt5::PrintSupport m ${PTHREADS_LIBRARY} ${EXTRA_CIMG_LIBRARY})
ENDIF(WIN32)
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 19 Oct 2017 14:58:04 +0200
Description: Add missing headers
--- a/src/qtbeads/main_window.cpp
+++ b/src/qtbeads/main_window.cpp
@@ -10,6 +10,12 @@
#include <QMenu>
#include <QMenuBar>
#include <QFileDialog>
+#include <QLineEdit>
+#include <QMessageBox>
+#include <QInputDialog>
+#include <QStatusBar>
+#include <QPrintDialog>
+#include <QFontDialog>
#include "main_window.h"
#include "QCimg.h"
#include "../config.h"
Author: Juhani Numminen <juhaninumminen0@gmail.com>
Last-Update: 2017-10-21
Description: Remove unusual statements, which gets rid of rpath.
There is no directory with the literal name X11_INCLUDE_DIR.
The other statement added -L/usr/include which is not correct.
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -34,7 +34,6 @@ IF(WIN32)
ELSE(WIN32)
FIND_PACKAGE(X11 REQUIRED)
- INCLUDE_DIRECTORIES(X11_INCLUDE_DIR)
# X11_FOUND is true if X11 is available.
# * X11_INCLUDE_DIR contains the include directories to use X11.
# * X11_LIBRARIES points to the libraries to link against to use X11.
@@ -44,8 +43,6 @@ ELSE(WIN32)
ADD_DEFINITIONS(${PTHREADS_DEFINITIONS})
# -m -pthread FindThreads
- # Make sure the linker can find the Hello library once it is built.
- link_directories (${X11_INCLUDE_DIR})
ENDIF(WIN32)
qt5.patch
qt5_headers.patch
# qt5.patch
use_debian_packaged_cimg.h
installation.patch
rpath.patch
spelling.patch
......@@ -4,46 +4,11 @@ Description: Use Debian packaged CImg.h from cimg-dev package since
the code copy shipped together with upstream is outdated and does not
build with recent gcc
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -29,7 +29,6 @@
spot_document_gnumeric
spotSvgDocument
images/imageDeNovo
- CImg
)
IF(WIN32)
ELSE(WIN32)
--- a/src/qtbeads/CMakeLists.txt
+++ b/src/qtbeads/CMakeLists.txt
@@ -30,7 +30,6 @@
../spot_document_gnumeric
../spotSvgDocument
../images/imageDeNovo
- ../CImg
)
# with SET() command you can change variables or define new ones
--- a/src/images/imageCode.h
+++ b/src/images/imageCode.h
@@ -3,8 +3,10 @@
#include "../config.h"
-#include "../CImg.h"
-//#include <CImg.h>
+#include <CImg.h>
+//CImg.h includes Xlib.h, which has evil "#define Bool int" that
+//interferes with QMetaType::Bool in files generated by Qt MOC!
+#undef Bool
//Images pour lesquelles les valeurs des pixels sont des codes et non des valeurs quantitatives
//Sont des codes: l'image des directions, l'image des numeros
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,6 +78,7 @@
FIND_PACKAGE(Pthreads REQUIRED)
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
@@ -67,6 +67,7 @@ ELSE(WIN32)
#FIND_PACKAGE(Pthreads REQUIRED)
SET(CMAKE_CXX_FLAGS_RELEASE "-s -O3 -DNDEBUG")
SET ( CIMG_OS 1)
+ SET(EXTRA_CIMG_LIBRARY "X11")
ENDIF(WIN32)
......
version=4
# FIXME: this needs proper URL mangling
opts="repacksuffix=+dfsg,dversionmangle=s/\+dfsg//g,repack,compression=xz" \
http://pappso.inra.fr/bioinfo/beads/index.php .*/downloads/beads-@ANY_VERSION@@ARCHIVE_EXT@
https://sourcesup.renater.fr/projects/beads/ .*/.*#beads-_@ANY_VERSION@-title-content
# this command finds Qt4 libraries and sets all required variables
# note that it's Qt4, not QT4 or qt4
FIND_PACKAGE( Qt4 REQUIRED )
FIND_PACKAGE( Qt5 COMPONENTS Core Gui Xml REQUIRED )
list( APPEND CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake_modules
)
set (CImg_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/src/cimg")
find_package( CImg REQUIRED )
# Add CIMG Flags to Compilation Flags
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CIMG_CFLAGS}")
#INCLUDE_DIRECTORIES(${ODSSTREAM_INCLUDE_DIR})
if (MINGW32)
INCLUDE_DIRECTORIES( ${QUAZIP_INCLUDE_DIR} )
ELSE (MINGW32)
FIND_PACKAGE( Odsstream REQUIRED )
ENDIF (MINGW32)
# add some useful macros and variables
# (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that contains a path to CMake script)
INCLUDE( ${QT_USE_FILE} )
SET( BEADS_CPP
beads.cpp
SET( BEADS_FOR_QT_CPP
ConfigFile/ConfigFile
parameters
encode/base64
......@@ -31,38 +43,54 @@ SET( BEADS_CPP
spotPROTICdbDocument
spot
spotDocument
spot_document_gnumeric
spotSvgDocument
images/imageDeNovo
CImg
)
IF(WIN32)
ELSE(WIN32)
FIND_PACKAGE(X11 REQUIRED)
#FIND_PACKAGE(X11 REQUIRED)
INCLUDE_DIRECTORIES(X11_INCLUDE_DIR)
#INCLUDE_DIRECTORIES(X11_INCLUDE_DIR)
# X11_FOUND is true if X11 is available.
# * X11_INCLUDE_DIR contains the include directories to use X11.
# * X11_LIBRARIES points to the libraries to link against to use X11.
# Make sure the compiler can find include files from our Hello library.
include_directories (${X11_INCLUDE_DIR})
#include_directories (${X11_INCLUDE_DIR})
ADD_DEFINITIONS(${PTHREADS_DEFINITIONS})
#ADD_DEFINITIONS(${PTHREADS_DEFINITIONS})
# -m -pthread FindThreads
# Make sure the linker can find the Hello library once it is built.
link_directories (${X11_INCLUDE_DIR})
#link_directories (${X11_INCLUDE_DIR})
ENDIF(WIN32)
add_executable (beads ${BEADS_CPP})
add_executable (beads beads.cpp )
target_include_directories (beads PUBLIC ${ODSSTREAM_INCLUDE_DIR} ${CImg_INCLUDE_DIRS} ${CImg_SYSTEM_LIBS_DIR})
SET_TARGET_PROPERTIES(beads
PROPERTIES OUTPUT_NAME beads
CLEAN_DIRECT_OUTPUT 1
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CImg_CFLAGS}"
)
target_link_libraries (beads cppbeads
${ODSSTREAM_QT5_LIBRARY} ${CImg_SYSTEM_LIBS} Qt5::Core Qt5::Gui Qt5::Xml)
add_library ( cppbeads STATIC
${BEADS_FOR_QT_CPP}
)
target_include_directories (cppbeads PUBLIC ${ODSSTREAM_INCLUDE_DIR}
${CImg_INCLUDE_DIRS} ${CImg_SYSTEM_LIBS_DIR})
SET_TARGET_PROPERTIES(cppbeads
PROPERTIES OUTPUT_NAME cppbeads-qt5
CLEAN_DIRECT_OUTPUT 1
CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CImg_CFLAGS}"
)
target_link_libraries (cppbeads
${ODSSTREAM_QT5_LIBRARY} ${CImg_SYSTEM_LIBS} Qt5::Core Qt5::Gui Qt5::Xml)
IF(WIN32)
# Link the executable to the Hello library.
target_link_libraries (beads ${EXTRA_CIMG_LIBRARY} ${QT_LIBRARIES} )
ELSE(WIN32)
# Link the executable to the Hello library.
target_link_libraries (beads ${X11_LIBRARIES} m ${PTHREADS_LIBRARY} ${EXTRA_CIMG_LIBRARY} ${QT_LIBRARIES} )
ENDIF(WIN32)
SUBDIRS (qtbeads)
......@@ -18,6 +18,8 @@
#include "parameters.h"
#include <QFileInfo>
#include <odsstream/tsvoutputstream.h>
#include <odsstream/odsdocwriter.h>
using namespace std;
......@@ -95,13 +97,18 @@ bool exist(const string filename) {
int main(int argc, char ** argv) {
cout << "beads " << BEADS_VERSION << endl;
// no sub function : detect spots and write ouput
const std::string input_filename(cimg_option("-i","","input gel image file"));
const std::string output_filename(
cimg_option("-o","output.xml","output data file"));
QString outfile(output_filename.c_str());
QString infile(input_filename.c_str());
const bool save_steps =
cimg_option("--steps",false,"save each step of the beads process");
//argument for parameter file :
string parameter_filename =
cimg_option("--param","","configuration file for beads");
cimg_option("--param","beads.conf","configuration file for beads");
if (parameter_filename == "") {
parameter_filename
= cimg_option("-p","beads.conf","configuration file for beads");
......@@ -127,7 +134,9 @@ int main(int argc, char * * argv) {
const std::string sub_function(
cimg_option("-sub","nosub","function to apply"));
qDebug() << "command line parsed";
if (sub_function == "total") {
qDebug() << "sub_function == total";
#ifndef MINGW32 //deactivate the sub total for mingw32 version
cimg_usage("Spot detection and quantification");
const char * file_i1 =
......@@ -326,10 +335,18 @@ int main(int argc, char * * argv) {
// ecriture fichier de spots
cout << "Writing text tabulated spot file" << endl;
spotDocument fspot;
fspot.open(source_filename);
QFile file(source_filename);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
return 1;
// }
QTextStream flux(&file);
TsvOutputStream doc_writer(flux);
spotDocument fspot(&doc_writer);
fspot.open();
fspot.write_detection(the_detection_from_prob);
fspot.close();
file.close();
if (svg_output) {
cout << "Computing SVG file" << endl;
......@@ -376,22 +393,19 @@ int main(int argc, char * * argv) {
//else {
// image.save(output_filename.c_str());
//}
}
} else {
// no sub function : detect spots and write ouput
QString input_filename = cimg_option("-i","","input gel image file");
QString output_filename =
cimg_option("-o","output.xml","output data file");
qDebug() << "no sub function";
if (input_filename == "") {
cerr << "please use argument -i to provide a gel image file."
<< endl;
return 1;
}
QString source_filename(input_filename);
QString source_filename(infile);
QFileInfo source_fileinfo(source_filename);
QFileInfo output_fileinfo(output_filename);
QFileInfo output_fileinfo(outfile);
source_filename = source_fileinfo.baseName();
......@@ -399,9 +413,9 @@ int main(int argc, char * * argv) {
qDebug() << "main output_extension : " << output_extension;
cout << "Loading input image file " << input_filename.toStdString()
cout << "Loading input image file " << input_filename
<< endl;
imageIntensity gel_image_loaded(input_filename);
imageIntensity gel_image_loaded(infile);
imageIntensity * p_gel_image;
if (inverse) {
......@@ -533,33 +547,60 @@ int main(int argc, char * * argv) {
// the SVG output is a drawing of detected spots viewable with any SVG compatible software
// (example : http://www.inkscape.org)
cout << "Writing PROTICdbML xml spot file "
<< output_filename.toStdString() << endl;
<< output_filename << endl;
spotPROTICdbDocument proticdbml_file;
proticdbml_file.set_gel_image_file_name(input_filename);
proticdbml_file.open(output_filename);
proticdbml_file.set_gel_image_file_name(infile);
proticdbml_file.open(outfile);
proticdbml_file.write_detection(the_detection_from_prob);
proticdbml_file.close();
}
if (output_extension == "ods") {
the_detection_from_prob.quantify_spots_with_image(*p_gel_image,
numbers);
cout << "Writing ods spot file "
<< output_filename << endl;
OdsDocWriter doc_writer(outfile);
spotDocument fspot(&doc_writer);
fspot.open();
fspot.write_detection(the_detection_from_prob);
fspot.close();
}
if (output_extension == "txt") {
the_detection_from_prob.quantify_spots_with_image(*p_gel_image,
numbers);
cout << "Writing text tabulated spot file "
<< output_filename.toStdString() << endl;
<< output_filename << endl;
spotDocument fspot;
fspot.open(output_filename);
QFile file(outfile);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
return 1;
}
QTextStream flux(&file);
TsvOutputStream doc_writer(flux);
spotDocument fspot(&doc_writer);
fspot.open();
fspot.write_detection(the_detection_from_prob);
fspot.close();
file.close();
}
if (output_extension == "jpg") {
imageContours contours;
contours.compute_from_gel_image_and_numeros(*p_gel_image, numbers);
contours.draw_contours(the_detection_from_prob, inverse);
cout << "Writing jpeg file of spot contours"
<< output_filename.toStdString() << endl;
cout << "Writing jpeg file " << output_filename.toStdString()
cout << "Writing jpeg file " << output_filename
<< endl;
contours.save_inversed(output_filename);
contours.save_inversed(outfile);
}
if (output_extension == "png") {
imageContours contours;
contours.compute_from_gel_image_and_numeros(*p_gel_image, numbers);
contours.draw_contours(the_detection_from_prob, inverse);
cout << "Writing png file " << output_filename
<< endl;
contours.save_inversed(outfile);
}
if (output_extension == "jpg2") {
//draw spot barycenters instead of detected spot centers
......@@ -568,37 +609,31 @@ int main(int argc, char * * argv) {
the_detection_from_prob.quantify_spots_with_image(*p_gel_image,
numbers);
contours.draw_contours(the_detection_from_prob, inverse);
cout << "Writing jpeg file of spot contours"
<< output_filename.toStdString() << endl;
cout << "Writing jpeg file " << output_filename.toStdString()
cout << "Writing jpeg file " << output_filename
<< endl;
contours.save_inversed(output_filename);
contours.save_inversed(outfile);
}
if ((output_extension == "tiff") || (output_extension == "tif")) {
imageContours contours;
contours.compute_from_gel_image_and_numeros(*p_gel_image, numbers);
contours.draw_contours(the_detection_from_prob, inverse);
cout << "Write tiff file of spot contours"
<< output_filename.toStdString() << endl;
cout << "Writing tiff file " << output_filename.toStdString()
cout << "Writing tiff file " << output_filename
<< endl;
contours.save_inversed(output_filename);
contours.save_inversed(outfile);
}
if (output_extension == "svg") {
cout << "Writing SVG file of spot contours"
<< output_filename.toStdString() << endl;
<< output_filename << endl;
the_detection_from_prob.store_spot_edges(numbers);
spotSvgDocument svg_file;
svg_file.set_gel_image_file_name(input_filename);
svg_file.set_gel_image_file_name(infile);
svg_file.set_css_class("detection",
"fill:blue;fill-opacity:1;stroke:none");
svg_file.set_css_class("contour",
"stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:none");
svg_file.embed_gel_image(gel_image_loaded);
//svg_file.embed_gel_image();
svg_file.open(output_filename);
svg_file.open(outfile);
svg_file.write_detection(the_detection_from_prob, "detection");
svg_file.draw_spot_numbers(the_detection_from_prob, "detection");
......@@ -612,4 +647,3 @@ int main(int argc, char * * argv) {
}
return 0;
}