Skip to content
Snippets Groups Projects
Commit 0cd1171d authored by Antoine Lorence's avatar Antoine Lorence
Browse files

Add CMake files to configure project

parent e1289592
No related branches found
No related tags found
No related merge requests found
project(EIImage)
cmake_minimum_required(VERSION 2.8.11)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
# Add CMake modules path
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
# Detiq-T is a submodule, it is built automatically before building eiimage
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/detiq-t AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/detiq-t)
add_subdirectory(lib/detiq-t)
include_directories(lib/detiq-t/ImageIn lib/detiq-t/GenericInterface)
else()
message(FATAL_ERROR "The Detiq-T project should be cloned before excuting this compilation. "
"Please use 'git submodule init' and 'git submodule update' to automatically get the source "
"for Detiq-T, and re-run CMake.")
endif()
add_subdirectory(core)
include_directories(core)
# Too much compile errors, have to be fixed:
# add_subdirectory(plugins)
add_subdirectory(app)
# Find the Qt libraries
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5LinguistTools REQUIRED)
find_package(Qt5Script REQUIRED)
find_package(Qt5Xml REQUIRED)
# Find RandomLib, which must be built and installed before running this compilation
find_package(RandomLib 1.7 REQUIRED)
if(RandomLib_FOUND)
include_directories(${RandomLib_INCLUDE_DIRS})
else()
message(FATAL_ERROR "Unable to find Random library. Please clone, compile and install it before compiling eiimage.")
endif()
# Find Qwt, which must be built and installed before running this compilation
find_package(Qwt 6.0 REQUIRED)
include_directories(${QWT_INCLUDE_DIRS})
set(eiimage_SOURCES
main.cpp
Tools.h
Algorithms/ClassAnalysis.cpp
Algorithms/ClassAnalysis.cpp
Algorithms/ClassAnalysis.h
Algorithms/Croissance.cpp
Algorithms/Croissance.cpp
Algorithms/Croissance.h
Algorithms/DCT.cpp
Algorithms/DCT.cpp
Algorithms/DCT.h
Algorithms/FFT.cpp
Algorithms/FFT.cpp
Algorithms/FFT.h
Algorithms/Pyramid.cpp
Algorithms/Pyramid.cpp
Algorithms/Pyramid.h
Operations/BFlitOp.cpp
Operations/BFlitOp.h
Operations/CenterOp.cpp
Operations/CenterOp.h
Operations/ClassAnalysisDialog.cpp
Operations/ClassAnalysisDialog.h
Operations/ClassAnalysisOp.cpp
Operations/ClassAnalysisOp.h
Operations/ClassResultOp.cpp
Operations/ClassResultOp.h
Operations/ColorDialog.cpp
Operations/ColorDialog.h
Operations/ColorimetryOp.cpp
Operations/ColorimetryOp.h
Operations/CombineColorOp.cpp
Operations/CombineColorOp.h
Operations/CroissanceOp.cpp
Operations/CroissanceOp.h
Operations/DCTDialog.cpp
Operations/DCTDialog.h
Operations/DCTOp.cpp
Operations/DCTOp.h
Operations/DMMDialog.cpp
Operations/DMMDialog.h
Operations/DMMOp.cpp
Operations/DMMOp.h
Operations/EntropyOp.cpp
Operations/EntropyOp.h
Operations/FFTDialog.cpp
Operations/FFTDialog.h
Operations/FFTOp.cpp
Operations/FFTOp.h
Operations/FlipOp.cpp
Operations/FlipOp.h
Operations/HadamardOp.cpp
Operations/HadamardOp.h
Operations/HistogramOp.cpp
Operations/HistogramOp.h
Operations/HoughDialog.cpp
Operations/HoughDialog.cpp
Operations/HoughDialog.h
Operations/HoughOp.cpp
Operations/HoughOp.cpp
Operations/HoughOp.h
Operations/Huffman.cpp
Operations/Huffman.h
Operations/HuffmanOp.cpp
Operations/HuffmanOp.h
Operations/IFFTOp.cpp
Operations/IFFTOp.h
Operations/InverseHoughDialog.cpp
Operations/InverseHoughDialog.cpp
Operations/InverseHoughDialog.h
Operations/InverseHoughOp.cpp
Operations/InverseHoughOp.cpp
Operations/InverseHoughOp.h
Operations/InversePyramidDialog.cpp
Operations/InversePyramidDialog.h
Operations/InversePyramidOp.cpp
Operations/InversePyramidOp.h
Operations/MeanSquaredErrorOp.cpp
Operations/MeanSquaredErrorOp.h
Operations/MICD.cpp
Operations/MICD.h
Operations/MICDDialog.cpp
Operations/MICDDialog.h
Operations/MICDEncodingOp.cpp
Operations/MICDEncodingOp.h
Operations/NoiseOp.cpp
Operations/NoiseOp.h
Operations/PointOp.cpp
Operations/PointOp.h
Operations/PseudoColorOp.cpp
Operations/PseudoColorOp.h
Operations/PyramidDialog.cpp
Operations/PyramidDialog.h
Operations/PyramidOp.cpp
Operations/PyramidOp.h
Operations/Quantification.cpp
Operations/Quantification.h
Operations/QuantificationDialog.cpp
Operations/QuantificationDialog.h
Operations/QuantificationOp.cpp
Operations/QuantificationOp.h
Operations/QuantificationWidget.cpp
Operations/QuantificationWidget.h
Operations/RandomImgOp.cpp
Operations/RandomImgOp.h
Operations/RejectionRingOp.cpp
Operations/RejectionRingOp.h
Operations/RotateOp.cpp
Operations/RotateOp.h
Operations/ScalingOp.cpp
Operations/ScalingOp.h
Operations/SeparatorOp.cpp
Operations/SeparatorOp.h
Operations/SignalToNoiseOp.cpp
Operations/SignalToNoiseOp.h
Operations/SinusSynthesisOp.cpp
Operations/SinusSynthesisOp.cpp
Operations/SinusSynthesisOp.h
Operations/SplitColorOp.cpp
Operations/SplitColorOp.h
Operations/ThresholdDialog.cpp
Operations/ThresholdDialog.cpp
Operations/ThresholdDialog.h
Operations/ThresholdOp.cpp
Operations/ThresholdOp.cpp
Operations/ThresholdOp.h
Operations/Transforms.cpp
Operations/Transforms.h
Operations/TranslateOp.cpp
Operations/TranslateOp.h
Operations/ZeroCrossingOp.cpp
Operations/ZeroCrossingOp.h
Services/EIImageService.cpp
Services/EIImageService.h
Services/FilteringService.cpp
Services/FilteringService.h
Services/MorphoMatService.cpp
Services/MorphoMatService.cpp
Services/MorphoMatService.h
Services/OperationService.cpp
Services/OperationService.h
Services/OpSetService.cpp
Services/OpSetService.h
Services/PluginManager.cpp
Services/PluginManager.h
Widgets/FilterChoice.cpp
Widgets/FilterChoice.cpp
Widgets/FilterChoice.h
Widgets/FilterEditor.cpp
Widgets/FilterEditor.h
Widgets/FilterEditorItem.cpp
Widgets/FilterEditorItem.h
Widgets/ImageZoneSelector.cpp
Widgets/ImageZoneSelector.h
Widgets/OperationBar.cpp
Widgets/OperationBar.h
Widgets/StructElemViewer.cpp
Widgets/StructElemViewer.h
Widgets/StructElemWindow.cpp
Widgets/StructElemWindow.h
)
set(UIS
Operations/HoughDialog.ui
Operations/InverseHoughDialog.ui
Operations/FFTDialog.ui
Operations/ClassAnalysisDialog.ui
Operations/InversePyramidDialog.ui
Operations/PyramidDialog.ui
Operations/MICDDialog.ui
Operations/DCTDialog.ui
Operations/ColorDialog.ui
Operations/MICDDialog_.ui
)
qt5_wrap_ui(WRAPPED_UIS ${UIS})
set(TS_FILES eiimage_en.ts eiimage_fr.ts)
# Uncommento only 1 of the 2 folowing commands, depending on your needs
# -1- Use current translations files
qt5_add_translation(QM_FILES ${TS_FILES})
# -2- Update translations files with changes from c++ sources
# qt5_create_translation(QM_FILES ${eiimage_SOURCES} ${TS_FILES})
add_executable(eiimage ${eiimage_SOURCES} ${WRAPPED_UIS} ${UIS} ${TS_FILES})
target_link_libraries(eiimage
eiimage_core
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::Script
Qt5::Xml
${RandomLib_LIBRARIES}
${QWT_LIBRARY}
${QWT_LIBRARIES}
GenericInterface
ImageIn
)
# Qt Widgets for Technical Applications
# available at http://www.http://qwt.sourceforge.net/
#
# The module defines the following variables:
# QWT_FOUND - the system has Qwt
# QWT_INCLUDE_DIR - where to find qwt_plot.h
# QWT_INCLUDE_DIRS - qwt includes
# QWT_LIBRARY - where to find the Qwt library
# QWT_LIBRARIES - aditional libraries
# QWT_MAJOR_VERSION - major version
# QWT_MINOR_VERSION - minor version
# QWT_PATCH_VERSION - patch version
# QWT_VERSION_STRING - version (ex. 5.2.1)
# QWT_ROOT_DIR - root dir (ex. /usr/local)
#=============================================================================
# Copyright 2010-2013, Julien Schueller
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# The views and conclusions contained in the software and documentation are those
# of the authors and should not be interpreted as representing official policies,
# either expressed or implied, of the FreeBSD Project.
#=============================================================================
find_path ( QWT_INCLUDE_DIR
NAMES qwt_plot.h
HINTS ${QT_INCLUDE_DIR}
PATH_SUFFIXES qwt qwt-qt3 qwt-qt4 qwt-qt5
)
set ( QWT_INCLUDE_DIRS ${QWT_INCLUDE_DIR} )
# version
set ( _VERSION_FILE ${QWT_INCLUDE_DIR}/qwt_global.h )
if ( EXISTS ${_VERSION_FILE} )
file ( STRINGS ${_VERSION_FILE} _VERSION_LINE REGEX "define[ ]+QWT_VERSION_STR" )
if ( _VERSION_LINE )
string ( REGEX REPLACE ".*define[ ]+QWT_VERSION_STR[ ]+\"(.*)\".*" "\\1" QWT_VERSION_STRING "${_VERSION_LINE}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" QWT_MAJOR_VERSION "${QWT_VERSION_STRING}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" QWT_MINOR_VERSION "${QWT_VERSION_STRING}" )
string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" QWT_PATCH_VERSION "${QWT_VERSION_STRING}" )
endif ()
endif ()
# check version
set ( _QWT_VERSION_MATCH TRUE )
if ( Qwt_FIND_VERSION AND QWT_VERSION_STRING )
if ( Qwt_FIND_VERSION_EXACT )
if ( NOT Qwt_FIND_VERSION VERSION_EQUAL QWT_VERSION_STRING )
set ( _QWT_VERSION_MATCH FALSE )
endif ()
else ()
if ( QWT_VERSION_STRING VERSION_LESS Qwt_FIND_VERSION )
set ( _QWT_VERSION_MATCH FALSE )
endif ()
endif ()
endif ()
find_library ( QWT_LIBRARY
NAMES qwt qwt-qt3 qwt-qt4 qwt-qt5
HINTS ${QT_LIBRARY_DIR}
)
set ( QWT_LIBRARIES ${QWT_LIBRARY} )
# try to guess root dir from include dir
if ( QWT_INCLUDE_DIR )
string ( REGEX REPLACE "(.*)/include.*" "\\1" QWT_ROOT_DIR ${QWT_INCLUDE_DIR} )
# try to guess root dir from library dir
elseif ( QWT_LIBRARY )
string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" QWT_ROOT_DIR ${QWT_LIBRARY} )
endif ()
# handle the QUIETLY and REQUIRED arguments
include ( FindPackageHandleStandardArgs )
if ( CMAKE_VERSION LESS 2.8.3 )
find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH )
else ()
find_package_handle_standard_args( Qwt REQUIRED_VARS QWT_LIBRARY QWT_INCLUDE_DIR _QWT_VERSION_MATCH VERSION_VAR QWT_VERSION_STRING )
endif ()
mark_as_advanced (
QWT_LIBRARY
QWT_LIBRARIES
QWT_INCLUDE_DIR
QWT_INCLUDE_DIRS
QWT_MAJOR_VERSION
QWT_MINOR_VERSION
QWT_PATCH_VERSION
QWT_VERSION_STRING
QWT_ROOT_DIR
)
\ No newline at end of file
find_package(Qt5Widgets REQUIRED)
set(SRCS
BuiltinOpSet.cpp
BuiltinOpSet.h
ImgParam.cpp
ImgParam.h
Input.h
IntParam.cpp
IntParam.h
Operation.cpp
Operation.h
OpSet.h
Parameter.h
Plugin.cpp
Plugin.h
PlugOperation.cpp
PlugOperation.h
)
add_library(eiimage_core ${SRCS})
target_link_libraries(eiimage_core
GenericInterface
ImageIn
Qt5::Widgets
)
Subproject commit f2aed64b27a547bced4298c261873dc09572281a
Subproject commit 21450774c2b26850783e0d0d88f98543c51611b8
include_directories(../core)
set(SRCS
plugin.cpp
Segmentation/segmentation.cpp
)
add_library(eiimage_plugins ${SRCS})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment