void CMakeBuildDirCreator::runBegin() { if(m_proc.state()==QProcess::NotRunning) { m_creatorUi->cmakeOutput->clear(); QStringList args; kDebug(9042) << "Type of build: " << buildType(); kDebug(9042) << "Installing to: " << installPrefix(); kDebug(9042) << "Build directory: " << buildFolder(); args += m_srcFolder.toLocalFile(); args += "-DCMAKE_INSTALL_PREFIX="+installPrefix().toLocalFile(); args += "-DCMAKE_BUILD_TYPE="+buildType(); m_proc.setWorkingDirectory(buildFolder().toLocalFile()); m_proc.setProgram(cmakeBinary().toLocalFile(), args); m_proc.setOutputChannelMode(KProcess::MergedChannels); m_proc.start(); updated(); m_creatorUi->cmakeOutput->setEnabled(true); m_creatorUi->status->setText(i18n("Running")); m_creatorUi->run->setText(i18n("&Cancel")); } else { m_proc.kill(); m_creatorUi->status->setText(i18n("CMake process killed")); } }
/* * Returns a Type* given an AstNode*. */ Type * buildType(AstNode * n) { NameId *ident; Type *retval = NULL; /* * n can either be an INT_NODE, an ARRAY_NODE, or a NAMEID_NODE. */ if (n->type == INT_NODE) { retval = makeIntType(); } else if (n->type == ARRAY_NODE) { retval = (Type *) makeArrayType(buildType(((Array *) n)->child)); } else { assert(n->type == NAMEID_NODE); ident = (NameId *) n; retval = (Type *) getClass(ident->name); if (retval == NULL) { error("class name expected", &ident->super); retval = makeErrorType(); } } return retval; }
int main( int, char** argv ) { const boost::filesystem::path path( argv[0] ); const std::string argvPath( path.parent_path().generic_string( )); const boost::filesystem::path execPath( lunchbox::getExecutablePath( )); TEST( boost::algorithm::ends_with( execPath.generic_string(), argvPath )); boost::filesystem::path referenceRootPath( execPath ); referenceRootPath = referenceRootPath.parent_path(); #ifdef _MSC_VER const lunchbox::Strings buildTypes { "debug", "relwithdebinfo", "release", "minsizerel" }; std::string buildType( path.stem().string( )); std::transform( buildType.begin(), buildType.end(), buildType.begin(), ::tolower ); if( std::find( buildTypes.begin(), buildTypes.end(), buildType ) != buildTypes.end( )) { referenceRootPath = referenceRootPath.parent_path(); } #endif TEST( lunchbox::getRootPath() == referenceRootPath.string( )); return EXIT_SUCCESS; }