2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
8 # This software is governed by the CeCILL-B license under French law and
9 # abiding by the rules of distribution of free software. You can use,
10 # modify and/ or redistribute the software under the terms of the CeCILL-B
11 # license as circulated by CEA, CNRS and INRIA at the following URL
12 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
13 # or in the file LICENSE.txt.
15 # As a counterpart to the access to the source code and rights to copy,
16 # modify and redistribute granted by the license, users are provided only
17 # with a limited warranty and the software's author, the holder of the
18 # economic rights, and the successive licensors have only limited
21 # The fact that you are presently reading this means that you have had
22 # knowledge of the CeCILL-B license and that you accept its terms.
23 # ------------------------------------------------------------------------ */
27 * ControlCreaDevManagerMain.cpp
29 * Created on: 5/11/2012
33 #include "ControlCreaDevManagerMain.h"
38 ControlCreaDevManagerMain::ControlCreaDevManagerMain()
42 ControlCreaDevManagerMain::~ControlCreaDevManagerMain()
46 const modelCDMProjectsTree& ControlCreaDevManagerMain::GetActiveProjects() const
51 bool ControlCreaDevManagerMain::LoadActiveProjects()
53 // TODO LoadActiveProjects
54 std::cerr << "LoadActiveProjects unimplemented yet" << std::endl;
58 bool ControlCreaDevManagerMain::UpdateActiveProjects()
60 // TODO UpdateActiveProjects
61 std::cerr << "UpdateActiveProjects unimplemented yet" << std::endl;
65 const int ControlCreaDevManagerMain::OpenProject(const std::string& actualpath)
67 std::string path = actualpath;
68 std::cout << "selection path: "<< path << std::endl;
69 std::string path1 = path + "/Makefile";
70 FILE* pFile = fopen(path1.c_str(), "r");
71 if(pFile == NULL) // not the binary folder
73 std::cerr << path1 << ": file not found..." << std::endl;
74 path1 = path + "/CMakeLists.txt";
75 pFile = fopen(path1.c_str(), "r");
76 if(pFile == NULL) //not the source folder
78 std::cerr << path1 << ": file not found..." << std::endl;
81 std::cout << "sources folder found..." << std::endl;
85 std::cout << "binary folder found..." << std::endl;
88 std::ifstream readFile;
89 readFile.open(path1.c_str());
93 while(!found && readFile >> word)
95 //cout << word << endl;
96 if(word == "CMAKE_SOURCE_DIR")
100 getline(readFile, word, '\n');
109 std::cerr << "sources not found..." << std::endl;
113 pFile = fopen(path.c_str(), "r");
114 std::cout << "sources at " << path << " open = " << (pFile != NULL) << std::endl;
119 projectsTree.SetRoot(path);
120 projectsTree.populateNode(path);
124 bool ControlCreaDevManagerMain::CloseProject(const std::string& projectName)
127 std::cerr << "CloseProject unimplemented yet" << std::endl;