Before WWI every power in Europe had, at one point or another, backed a policy of maintaining the territorial integrity of the Ottoman Empire (often alternating this with periods in which they would try to take certain territories only to be opposed by the other powers.) Nonetheless, it was clear to most European countries that the Ottoman Empire would someday collapse, either of its own accord or in a war with a European power. Thus Turkey as "The Sick Man of Europe." This left what was known in the late 19th and early 20th century as "The Eastern Question." The Eastern Question was "after the Ottomans, who rules the east?"
Until WWI, no one could properly answer that question. Once war was declared (specifically, the Ottomans decided to enter the war based on German insistence and in the face of British requests that they remain neutral) the answer to the Eastern Question became obvious: Britain, France, and Russia would rule the former Ottoman Empire after the war was won.
As far as I'm aware the first notion of at least some partition came with the Constantinople Agreement in March 1915, which promised Constantinople and the Dardanelles to Russia. This was followed by the Treaty of London in April 1915 which promised Italy territory in what is today southern Turkey around Antalya if it joined the war on Britain's side.
Britain took the lead in determining how exactly the rest of the Empire would be broken up during the war. The De Bunsen Committee in April-June 1915 tried to work out what Britain's own war aims vis a vis the Ottomans ought to be. Shortly thereafter Britain also entered into negotiations with the Hashemites, promising them territory in the event of victory in the Hussein-McMahon correspondences. As a result of those promises, which alluded to vaguely understood French interests in Greater Syria, the British started negotiating with France as to what exactly its interests were. The result of those negotiations was the Sykes-Picot Agreement. Russian assent resulted in the Sykes-Picot-Sazonov treaty. At this point the promised division of the Ottoman Empire looked like this.
These treaties formed the basis for most of the post-war claims that the entente eventually had to adjudicate amongst themselves.
The war against the Ottomans officially ended with the Armistice of Mudros in October 1918. Unofficially, the fighting continued as each side scrambled for position in the post-war settlement, with the British fighting several engagements in Northern Iraq, explicitly to seize potential oil-bearing territory.
Shortly thereafter the allies occupied Constantinople and the French sent troops to Syria. The Ottoman government ordered Mustafa Kemal (later Ataturk) to not resist the landings, which infuriated him.
The partition of the Ottoman Empire was discussed at the Paris Peace talks based on these competing claims, but partly based on the American suggestion to send a team to figure out what the Arabs actually wanted (resulting in the King-Crane commission), the victors couldn't yet decide what to do.
That would come with the Treaty of Sevres, 1920, which would have partitioned Turkey as follows: https://en.wikipedia.org/wiki/Treaty_of_S%C3%A8vres#/media/File:Treaty_of_S%C3%A8vres_map_partitioning_Anatolia.png
While accepted by the Sultan, this treaty was rejected by the Grand National Assembly, which formed the basis of the Turkish independence movement. The Greco-Turkish war and the Franco-Turkish war were the two largest of the wars that resulted in Turkish independence, and eventually resulted in the revised Treaty of Lausanne (1923), which established modern Turkey essentially within its current borders.
The cost of maintaining the occupation of so much of the Middle East to prompt Winston Churchill at one point to suggest that the Ottoman Empire should be restored on fiscal grounds as a way for Britain to save money. The suggestion wasn't taken seriously and by this point partition was likely unavoidable.
Sourcewise: Sean McMeekin's Ottoman Endgame covers all of this in quite a lot of detail.