Commit 13ad2cb8 authored by cfouard's avatar cfouard
Browse files

FIXED FindCamiTK.cmake once CamiTK found do not look for it again !

FIXED CMakeLists on Windows share has no more subdirectory camitk-shortVersion

FIXED Wizard Bug #75 "When creating a component with no representation, a "#include <QFileInfo>" is missing in the .cpp"
FIXED Wizard Bug #80 "When creating a component with no representation, the properties are not added in the .cpp file."
FIXED In extensions generated by the wizard, a return appeard at the end of the file (after the method save), outside all functions. 
FIXED Wizard Bug #74 "If we have multiple QString properties in a component, there is multiple "#include <QString>" in the corresponding header."

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@120 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 994a2970
......@@ -25,14 +25,14 @@ void ActionGenerator::createElement() throw (QString) {
if (hasParameters)
this->theParams = theAction->parameters().get().parameter();
this->parentClass = QString("Action");
this->additionalIncludes.push_back(QString("QString"));
this->additionalIncludes.push_back(QString("QTextStream"));
this->additionalIncludes.push_back(QString("QMessageBox"));
this->additionalIncludes.insert(QString("QString"));
this->additionalIncludes.insert(QString("QTextStream"));
this->additionalIncludes.insert(QString("QMessageBox"));
if (hasParameters) {
for (Parameters::parameter_const_iterator it = theParams.begin(); it < theParams.end(); it++) {
QString parameterType = QString((*it).type().c_str());
if ((parameterType != "int") && (parameterType != "bool") && (parameterType != "double")) {
this->additionalIncludes.push_back(parameterType);
this->additionalIncludes.insert(parameterType);
}
}
}
......@@ -40,10 +40,10 @@ void ActionGenerator::createElement() throw (QString) {
this->isItkFilter = theAction->classification().itkFilter().present();
this->hasImplementationFile = theAction->classification().itkFilter().present();
if (this->isItkFilter) {
this->additionalIncludes.push_back(QString("Application.h"));
this->additionalIncludes.push_back(QString("itkVTKImageToImageFilter.h"));
this->additionalIncludes.push_back(QString("itkImageToVTKImageFilter.h"));
this->additionalIncludes.push_back(QString("ItkProgressObserver.h"));
this->additionalIncludes.insert(QString("Application.h"));
this->additionalIncludes.insert(QString("itkVTKImageToImageFilter.h"));
this->additionalIncludes.insert(QString("itkImageToVTKImageFilter.h"));
this->additionalIncludes.insert(QString("ItkProgressObserver.h"));
}
......@@ -83,15 +83,15 @@ void ActionGenerator::writeDeclareApply() {
(*out) << endl;
(*out) << "private: " << endl;
(*out) << " /// helper method to simplify the target component processing" << endl;
(*out) << " virtual void apply(" << this->theAction->classNames().componentClass().c_str() << " * comp);" << endl;
(*out) << " virtual void process(" << this->theAction->classNames().componentClass().c_str() << " * comp);" << endl;
if (isItkFilter) {
(*out) << endl;
(*out) << "private: " << endl;
(*out) << " vtkSmartPointer<vtkImageData> implementApply(vtkSmartPointer<vtkImageData> img); " << endl;
(*out) << " vtkSmartPointer<vtkImageData> implementProcess(vtkSmartPointer<vtkImageData> img); " << endl;
(*out) << endl;
(*out) << " template <class InputPixelType, class OutputPixelType, const int dim> " << endl;
(*out) << " vtkSmartPointer<vtkImageData> applyFilter(vtkSmartPointer<vtkImageData> img); " << endl;
(*out) << " vtkSmartPointer<vtkImageData> itkProcess(vtkSmartPointer<vtkImageData> img); " << endl;
(*out) << endl;
}
......@@ -189,13 +189,11 @@ void ActionGenerator::writeApply() {
(*out) << "void " << elementClassName << "::apply() {" << endl;
(*out) << " foreach (Component *comp, targetComponents) {" << endl;
(*out) << " " << theComponent << " * input = dynamic_cast<" << theComponent << " *> ( comp );" << endl;
(*out) << " if(input) {" << endl;
(*out) << " apply(input);" << endl;
(*out) << " }" << endl;
(*out) << " process(input);" << endl;
(*out) << " }" << endl;
(*out) << "}" << endl;
(*out) << endl;
(*out) << "void " << elementClassName << "::apply(" << theComponent << " * comp) {" << endl;
(*out) << "void " << elementClassName << "::process(" << theComponent << " * comp) {" << endl;
if (hasParameters) {
(*out) << " // Get the parameters" << endl;
for (Parameters::parameter_const_iterator it = theParams.begin(); it < theParams.end(); it++) {
......@@ -263,7 +261,7 @@ void ActionGenerator::writeApply() {
(*out) << endl;
(*out) << " // ITK filter implementation using templates " << endl;
(*out) << " vtkSmartPointer<vtkImageData> inputImage = comp->getImageData(); " << endl;
(*out) << " vtkSmartPointer<vtkImageData> outputImage = implementApply (inputImage);" << endl;
(*out) << " vtkSmartPointer<vtkImageData> outputImage = implementProcess (inputImage);" << endl;
(*out) << " QString newName; " << endl;
(*out) << " QTextStream(&newName) << comp->getName() << \"_processed\"; " << endl;
(*out) << " new ImageComponent(outputImage, newName);" << endl;
......@@ -284,7 +282,7 @@ void ActionGenerator::writeSpecificITKImplementation() {
(*out) << endl;
(*out) << "// ITK filter implementation" << endl;
(*out) << "template <class InputPixelType, class OutputPixelType, const int dim> " << endl;
(*out) << "vtkSmartPointer<vtkImageData> " << elementClassName << "::applyFilter(vtkSmartPointer<vtkImageData> img) " << endl;
(*out) << "vtkSmartPointer<vtkImageData> " << elementClassName << "::itkProcess(vtkSmartPointer<vtkImageData> img) " << endl;
(*out) << "{ " << endl;
(*out) << " vtkSmartPointer<vtkImageData> result = vtkSmartPointer<vtkImageData>::New(); " << endl;
(*out) << endl;
......@@ -388,7 +386,7 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
QString iType;
QString oType;
(*out) << "vtkSmartPointer<vtkImageData> " << elementClassName << "::implementApply(vtkSmartPointer<vtkImageData> img)" << endl;
(*out) << "vtkSmartPointer<vtkImageData> " << elementClassName << "::implementProcess(vtkSmartPointer<vtkImageData> img)" << endl;
(*out) << "{ " << endl;
(*out) << " vtkSmartPointer<vtkImageData> result = NULL; " << endl;
(*out) << " if (img == NULL) " << endl;
......@@ -412,9 +410,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_CHAR : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -425,9 +423,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_UNSIGNED_CHAR : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -438,9 +436,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_SIGNED_CHAR : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -451,9 +449,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_SHORT : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -464,9 +462,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_UNSIGNED_SHORT : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -477,9 +475,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_INT : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -490,9 +488,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_UNSIGNED_INT : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -503,9 +501,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_LONG : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -516,9 +514,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_UNSIGNED_LONG : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -529,9 +527,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_FLOAT : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......@@ -542,9 +540,9 @@ void ActionGenerator::writeElementImplementationFile() throw (QString) {
oType = outputType;
(*out) << " case VTK_DOUBLE : " << endl;
(*out) << " if (dim == 2) " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 2>(img); " << endl;
(*out) << " else // if dim == 3 " << endl;
(*out) << " result = applyFilter<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " result = itkProcess<" << iType << ", " << oType << ", 3>(img); " << endl;
(*out) << " break; " << endl;
(*out) << endl;
......
......@@ -24,7 +24,7 @@ void ComponentGenerator::createElement() throw (QString) {
for (Parameters::parameter_const_iterator it = theParams.begin(); it < theParams.end(); it++) {
QString parameterType = QString((*it).type().c_str());
if ((parameterType != "int") && (parameterType != "bool") && (parameterType != "double")) {
this->additionalIncludes.push_back(parameterType);
this->additionalIncludes.insert(parameterType);
}
}
}
......@@ -49,17 +49,17 @@ void ComponentGenerator::createElement() throw (QString) {
break;
case MESH:
this->parentClass = QString("MeshComponent");
this->additionalIncludes.push_back(QString("vtkSmartPointer.h"));
this->additionalIncludes.push_back(QString("vtkPoints.h"));
this->additionalIncludes.push_back(QString("vtkPointData.h"));
this->additionalIncludes.push_back(QString("vtkCellArray.h"));
this->additionalIncludes.push_back(QString("vtkFloatArray.h"));
this->additionalIncludes.push_back(QString("vtkPolyData.h"));
this->additionalIncludes.push_back(QString("InteractiveViewer.h"));
this->additionalIncludes.insert(QString("vtkSmartPointer.h"));
this->additionalIncludes.insert(QString("vtkPoints.h"));
this->additionalIncludes.insert(QString("vtkPointData.h"));
this->additionalIncludes.insert(QString("vtkCellArray.h"));
this->additionalIncludes.insert(QString("vtkFloatArray.h"));
this->additionalIncludes.insert(QString("vtkPolyData.h"));
this->additionalIncludes.insert(QString("InteractiveViewer.h"));
break;
case NONE:
case OTHER:
this->parentClass = QString("Component");
this->additionalIncludes.insert(QString("QFileInfo"));
break;
default:
break;
......@@ -204,16 +204,15 @@ void ComponentGenerator::writeConstructor() {
case NONE:
(*out) << " // Read the input file" << endl;
(*out) << endl;
if (this->hasParameters) {
writeParametersInitialization();
}
(*out) << " // Possibly create sub-components: " << endl;
(*out) << " // Component * subComp = new ....." << endl;
(*out) << " // add it as sub-component: " << endl;
(*out) << " // addChild(subComp);" << endl;
(*out) << endl;
break;
case OTHER:
(*out) << " // Read the input file and create your component. " << endl;
(*out) << endl;
break;
default:
break;
}
......
......@@ -149,8 +149,9 @@ void ElementGenerator::writeElementHFile() {
void ElementGenerator::writeElementCFile() {
(*out) << "#include \"" << elementClassName <<".h\"" << endl;
(*out) << endl;
for (std::vector<QString>::const_iterator it = this->additionalIncludes.begin();
it < additionalIncludes.end(); it++)
// erase duplicates in the include
for (std::set<QString>::const_iterator it = this->additionalIncludes.begin();
it != additionalIncludes.end(); it++)
(*out) << "#include <" << (*it) << "> " << endl;
(*out) << endl;
(*out) << "using namespace camitk;" << endl;
......
// include from STD
#include <set>
// includes from Qt
#include <QString>
#include <QTextStream>
......@@ -50,7 +53,7 @@ protected:
QString parentClass;
QTextStream * out;
std::vector<QString> additionalIncludes;
std::set<QString> additionalIncludes;
Parameters::parameter_sequence theParams;
......
......@@ -69,11 +69,8 @@ void ExtensionGenerator::setXmlFileName(QString xmlFileName) throw (QString) {
}
void ExtensionGenerator::generateCMakeLists() throw (QString) {
std::cout << "Generating CMakeLists file... " << std::endl;
QString extensionClassName(this->theExtension->extensionClass().c_str());
// Copying FindCamiTK.cmake
std::cout << "Copying FindCamiTK.cmake..." << std::endl;
// Copying FindCamiTK.cmake
QDir cMakeModuleDir = camitk::Core::getTestDataDir();
cMakeModuleDir.cdUp();
cMakeModuleDir.cd("cmake");
......@@ -81,6 +78,12 @@ void ExtensionGenerator::generateCMakeLists() throw (QString) {
std::cout << "Copying " << findCamiTK.fileName().toStdString() << std::endl;
findCamiTK.copy(this->devDirectoryName.canonicalPath() + "/" + "FindCamiTK.cmake");
std::cout << "Generating CMakeLists file... " << std::endl;
QString extensionClassName(this->theExtension->extensionClass().c_str());
// Building CMakeLists.txt
QFileInfo cmakeFileName;
cmakeFileName.setFile(this->devDirectoryName, "CMakeLists.txt");
......@@ -402,8 +405,8 @@ void ExtensionGenerator::generateComponentExtensionFiles() throw (QString) {
outc << " // or component->getImageData() (for a ImageComponent derived class)" << endl;
outc << " // and save the data in the managed format in the file component->getFileName()" << endl;
outc << endl;
outc << " return false;" << endl;
outc << "}" << endl;
outc << " return " << endl;
}
......
......@@ -7,13 +7,21 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../CamiTKBuildSettings.cmake"
# install the cmake files
file(GLOB CAMITK_CMAKE_FILES "modules/*.cmake")
set(SHARE_CMAKE_PATH)
if ( MSVC )
# Do NOT add ${CAMITK_SHORT_VERSION_STRING} to the share/cmake path for Win32 MSVC !
set (SHARE_CMAKE_PATH share/cmake)
else ()
set (SHARE_CMAKE_PATH share/${CAMITK_SHORT_VERSION_STRING}/cmake)
endif ()
install(FILES ${CAMITK_CMAKE_FILES}
DESTINATION share/${CAMITK_SHORT_VERSION_STRING}/cmake
DESTINATION ${SHARE_CMAKE_PATH}
COMPONENT cmake-modules)
file(GLOB CAMITK_CMAKE_FILES "modules/launcher-templates/*.in")
install(FILES ${CAMITK_CMAKE_FILES}
DESTINATION share/${CAMITK_SHORT_VERSION_STRING}/cmake/launcher-templates
DESTINATION ${SHARE_CMAKE_PATH}/launcher-templates
COMPONENT cmake-modules)
......@@ -406,9 +406,17 @@ macro(component_extension)
# during installation, copy the files to install directory
set (TESTDATA_DEST_DIR)
if ( MSVC )
# Do NOT add ${CAMITK_SHORT_VERSION_STRING} to the testdata path for Win32 MSVC !
set (TESTDATA_DEST_DIR share/testdata)
else ()
set (TESTDATA_DEST_DIR share/${CAMITK_SHORT_VERSION_STRING}/testdata)
endif ()
install(DIRECTORY testdata/
#DESTINATION share/testdata
DESTINATION share/${CAMITK_SHORT_VERSION_STRING}/testdata
#DESTINATION share/${CAMITK_SHORT_VERSION_STRING}/testdata
DESTINATION ${TESTDATA_DEST_DIR}
COMPONENT ${COMPONENT_TARGET_NAME}
PATTERN ".svn" EXCLUDE
PATTERN "*~" EXCLUDE
......
......@@ -49,7 +49,7 @@ if (NOT CAMITK_INSTALL_ROOT)
set(CAMITK_INCLUDE_DIR_SUFFIX_TEMP "include/${CAMITK_SHORT_VERSION_STRING}/${CAMITK_CORE_LIB_TEMP}")
# find the caracteristic header using a (reasonably) long good list for the guess
find_path(CAMITK_ROOT_DIR_GUESS
find_path(CAMITK_ROOT_DIR_GUESS_INSTALLED
NAMES CamiTKAPI.h
PATHS "/usr"
"/usr/local"
......@@ -65,13 +65,13 @@ if (NOT CAMITK_INSTALL_ROOT)
PATH_SUFFIXES "${CAMITK_INCLUDE_DIR_SUFFIX_TEMP}"
)
mark_as_advanced(CAMITK_ROOT_DIR_GUESS)
mark_as_advanced(CAMITK_ROOT_DIR_GUESS_INSTALLED)
set(CAMITK_VERSION "${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}" CACHE STRING "The CamiTK version to find")
# if guess is alright
if (CAMITK_ROOT_DIR_GUESS)
string(REGEX REPLACE "${CAMITK_INCLUDE_DIR_SUFFIX_TEMP}" "" CAMITK_INSTALL_ROOT_TEMP ${CAMITK_ROOT_DIR_GUESS})
if (CAMITK_ROOT_DIR_GUESS_INSTALLED)
string(REGEX REPLACE "${CAMITK_INCLUDE_DIR_SUFFIX_TEMP}" "" CAMITK_INSTALL_ROOT_TEMP ${CAMITK_ROOT_DIR_GUESS_INSTALLED})
set(CAMITK_INSTALL_ROOT ${CAMITK_INSTALL_ROOT_TEMP} CACHE PATH "${CAMITK_SHORT_VERSION_STRING} install root" FORCE)
else()
set(CAMITK_INSTALL_ROOT "" CACHE PATH "${CAMITK_SHORT_VERSION_STRING} install root")
......@@ -98,21 +98,23 @@ if(NOT ${CAMITK_INSTALL_ROOT} EQUAL "")
set (CAMITK_BIN_DIR ${CAMITK_INSTALL_ROOT}/bin CACHE PATH "CamiTK bin dir." FORCE)
set (CAMITK_LIB_DIR ${CAMITK_INSTALL_ROOT}/lib/${CAMITK_SHORT_VERSION_STRING} CACHE PATH "CamiTK lib dir." FORCE)
set (CAMITK_INCLUDE_DIR ${CAMITK_INSTALL_ROOT}/include/${CAMITK_SHORT_VERSION_STRING} CACHE PATH "CamiTK include dir." FORCE)
set (CAMITK_TESTDATA_DIR ${CAMITK_INSTALL_ROOT}/share/${CAMITK_SHORT_VERSION_STRING}/testdata CACHE PATH "CamiTK share dir. for test data" FORCE)
set (CAMITK_SHARE_DIR ${CAMITK_INSTALL_ROOT}/share/${CAMITK_SHORT_VERSION_STRING} CACHE PATH "CamiTK share dir." FORCE)
else()
# use build directory to get includes and lib
set (CAMITK_BIN_DIR ${CAMITK_BUILD_ROOT}/bin CACHE PATH "CamiTK bin dir." FORCE)
set (CAMITK_LIB_DIR ${CAMITK_BUILD_ROOT}/lib CACHE PATH "CamiTK lib dir." FORCE)
set (CAMITK_INCLUDE_DIR ${CAMITK_BUILD_ROOT}/include CACHE PATH "CamiTK include dir." FORCE)
set (CAMITK_TESTDATA_DIR ${CAMITK_BUILD_ROOT}/share/testdata CACHE PATH "CamiTK share dir. for test data" FORCE)
set (CAMITK_SHARE_DIR ${CAMITK_INSTALL_ROOT}/share CACHE PATH "CamiTK share dir." FORCE)
endif()
mark_as_advanced(CAMITK_BIN_DIR CAMITK_LIB_DIR CAMITK_INCLUDE_DIR CAMITK_TESTDATA_DIR)
set (CAMITK_TESTDATA_DIR ${CAMITK_SHARE_DIR}/testdata CACHE PATH "CamiTK share dir. for test data" FORCE)
mark_as_advanced(CAMITK_BIN_DIR CAMITK_LIB_DIR CAMITK_INCLUDE_DIR CAMITK_SHARE_DIR CAMITK_TESTDATA_DIR)
# Needed due to installation reason
link_directories(${CAMITK_INSTALL_ROOT}/lib)
link_directories(${CAMITK_LIB_DIR})
# update module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CAMITK_LIB_DIR}/cmake ${CAMITK_INSTALL_ROOT}/camitk/cmake/modules)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CAMITK_SHARE_DIR}/cmake ${CAMITK_INSTALL_ROOT}/camitk/cmake/modules)
message(STATUS "module path=${CMAKE_MODULE_PATH}")
# include useful modules
include(CamiTKVariables)
......
......@@ -107,7 +107,7 @@ const QString Core::getTestDataDir() {
QString exampleSubDir = "share";
if (isInstalled())
if (hasBinaryVersionSubdir())
exampleSubDir += "/" + QString(Core::shortVersion);
exampleSubDir += "/testdata";
......
......@@ -79,10 +79,6 @@ throw(AbortException) : Component("", name) {
// -------------------- destructor --------------------
ImageComponent::~ImageComponent() {
//if (myPropertyWidget)
// delete myPropertyWidget;
//myPropertyWidget = NULL;
if (myPopupMenu)
delete myPopupMenu;
myPopupMenu = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment