/* ** ClanLib SDK ** Copyright (c) 1997-2005 The ClanLib Team ** ** This software is provided 'as-is', without any express or implied ** warranty. In no event will the authors be held liable for any damages ** arising from the use of this software. ** ** Permission is granted to anyone to use this software for any purpose, ** including commercial applications, and to alter it and redistribute it ** freely, subject to the following restrictions: ** ** 1. The origin of this software must not be misrepresented; you must not ** claim that you wrote the original software. If you use this software ** in a product, an acknowledgment in the product documentation would be ** appreciated but is not required. ** 2. Altered source versions must be plainly marked as such, and must not be ** misrepresented as being the original software. ** 3. This notice may not be removed or altered from any source distribution. ** ** Note: Some of the libraries ClanLib may link to may have additional ** requirements or restrictions. ** ** File Author(s): ** ** Lih-Hern (Lf3T-Hn4D) ** (if your name is missing here, please add it) */ #include "vc++toolkit.h" #include "codeblock_gen.h" void setup_vc_clanlib_workspace( const std::list &defines_list, const std::string &input_lib_dir, const std::string &input_include_dir, const std::string &output_lib_dir, const std::string &output_include_dir ) { Workspace workspace; // setup workspace paths workspace.input_lib_dir = input_lib_dir; workspace.input_include_dir = input_include_dir; workspace.output_lib_dir = output_lib_dir; workspace.output_include_dir = output_include_dir; // Write all library project files: std::list libs_list_shared; std::list libs_list_release; std::list libs_list_debug; Project clanCore("Core", "clanCore", "core.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanSignals("Signals", "clanSignals", "signals.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanApp("Application", "clanApp", "application.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanNetwork("Network", "clanNetwork", "network.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanDisplay("Display", "clanDisplay", "display.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanSound("Sound", "clanSound", "sound.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanGL("GL", "clanGL", "gl.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanSDL("SDL", "clanSDL", "sdl.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanGUI("GUI", "clanGUI", "gui.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanGUIStyleSilver("GUIStyleSilver", "clanGUIStyleSilver", "guistylesilver.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanVorbis("Vorbis", "clanVorbis", "vorbis.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); Project clanMikMod("MikMod", "clanMikMod", "mikmod.h", libs_list_shared, libs_list_release, libs_list_debug, defines_list); // Add projects to workspace: workspace.projects.push_back(clanSignals); workspace.projects.push_back(clanCore); workspace.projects.push_back(clanApp); workspace.projects.push_back(clanNetwork); workspace.projects.push_back(clanDisplay); workspace.projects.push_back(clanSound); workspace.projects.push_back(clanGL); workspace.projects.push_back(clanSDL); workspace.projects.push_back(clanGUI); workspace.projects.push_back(clanGUIStyleSilver); workspace.projects.push_back(clanVorbis); workspace.projects.push_back(clanMikMod); std::list::iterator iter; for (iter = workspace.projects.begin(); iter != workspace.projects.end(); iter++) (*iter).defines_list.push_back("DIRECTINPUT_VERSION=0x0800"); // generate workspace. gen_workspace("ClanLib", "Sources", workspace); for (iter = workspace.projects.begin(); iter != workspace.projects.end(); iter++) gen_vc_project(*iter, workspace); } void gen_vc_project(const Project &project, const Workspace &workspace) { std::list options_list, defines_list, targets, inc_dir, lib_dir; std::string filename = "Sources/" + project.libname + ".cbp"; std::cout << " Generating project " << filename << "... "; std::ofstream project_file(filename.c_str()); gen_project_head(project_file); inc_dir.push_back("."); inc_dir.push_back(workspace.input_include_dir); lib_dir.push_back(workspace.input_lib_dir); // project title. project_file << "\t\t