The announcement of a nationwide June 25 vote came after the parliament met in what lawmakers had hoped would be a secret location.
A missile was fired at the hotel where the session was taking place, causing panic but no injuries.
The general, Khalifa Hifter, has launched an armed campaign he says is aimed at imposing stability after three years of chaos since the ouster and death of dictator Moammar Gadhafi in 2011.
Hifter denies seeking power but indicated today that he would be interested in running for presiden an office which has remained vacant since the revolution, pending the drafting of a new constitution.
Also Read
Leaders of the Muslim Brotherhood group, one of the biggest factions in parliament, denounced Hifter as "a counter-revolutionary allying with remnants of Gadhafi's forces."
Mohammed Gair, a leading group member, called for dialogue to avert a struggle in which "no one is a winner and the only loser is the Libyan people."
Hifter's allied militias are positioned along the road to Tripoli's airport, south of the capital, while Islamist-led militias from Libya's third-largest city, Misrata, have mobilized and are positioned to move into the capital.
Libya has not had an effective government since the fall of Gadhafi in a destructive civil war. The rebel brigades that rose up to fight Gadhafi transformed into armed militias after his regime's collapse and have mushroomed in size, power and armaments.
Some remain rooted in local loyalties but have spread their power to other regions. Others are ideologically based particularly al-Qaida-inspired extremist militias, which have waged a campaign of violence in Bengazhi, almost daily gunning down military and police officers and other opponents.