2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
30 * ControlCreaDevManagerMain.cpp
32 * Created on: 5/11/2012
36 #include "ControlCreaDevManagerMain.h"
41 ControlCreaDevManagerMain::ControlCreaDevManagerMain()
45 ControlCreaDevManagerMain::~ControlCreaDevManagerMain()
49 const modelCDMProjectsTree& ControlCreaDevManagerMain::GetActiveProjects() const
54 bool ControlCreaDevManagerMain::LoadActiveProjects()
56 // TODO LoadActiveProjects
57 std::cerr << "LoadActiveProjects unimplemented yet" << std::endl;
61 bool ControlCreaDevManagerMain::UpdateActiveProjects()
63 // TODO UpdateActiveProjects
64 std::cerr << "UpdateActiveProjects unimplemented yet" << std::endl;
68 const int ControlCreaDevManagerMain::OpenProject(const std::string& actualpath)
70 std::string path = actualpath;
71 std::cout << "selection path: "<< path << std::endl;
72 std::string path1 = path + "/Makefile";
73 FILE* pFile = fopen(path1.c_str(), "r");
74 if(pFile == NULL) // not the binary folder
76 std::cerr << path1 << ": file not found..." << std::endl;
77 path1 = path + "/CMakeLists.txt";
78 pFile = fopen(path1.c_str(), "r");
79 if(pFile == NULL) //not the source folder
81 std::cerr << path1 << ": file not found..." << std::endl;
84 std::cout << "sources folder found..." << std::endl;
88 std::cout << "binary folder found..." << std::endl;
91 std::ifstream readFile;
92 readFile.open(path1.c_str());
96 while(!found && readFile >> word)
98 //cout << word << endl;
99 if(word == "CMAKE_SOURCE_DIR")
103 getline(readFile, word, '\n');
112 std::cerr << "sources not found..." << std::endl;
116 pFile = fopen(path.c_str(), "r");
117 std::cout << "sources at " << path << " open = " << (pFile != NULL) << std::endl;
122 projectsTree.SetRoot(path);
123 projectsTree.populateNode(path);
127 bool ControlCreaDevManagerMain::CloseProject(const std::string& projectName)
130 std::cerr << "CloseProject unimplemented yet" << std::endl;