Automatically built files are separated from the source tree.gitignore file in the source tree is usually set to ignore the entire build directory. Since these files can be automatically generated from the green source tree, there is no need to include them in git. The contents of these subfolders are generated automatically by cmake, make and the compiler, using the CMakeLists.txt files in the green source tree as instructions. ![]() Let's focus on the one on the right labeled cmake build. ![]() Separate from the green folders are the build directories. Each folder in this green subtree will usually have an accompanying CMakeLists.txt file which describes what files to compile and what executables to build. ui files, and all the files managed by git in this folder. It is the contents of your creative efforts. The green subdirectory above contains all source code you write. The purpose of those entries is to allow developers to configure the build process by setting define flags to a specific value, or specific paths.Having a separate build directory might be new to some, so here is a short explanation using the figure below for a project in the examples folder These entries can be changed but should be left default for now. I filled in "D:\related\src\wxWidgets\wxMSW-2.4.2\samples\minimal\cbuild". You can put it anywhere you want, even on a temp drive if you like. Else fill in at Where to build the binaries the same dir, but append e.g. If you rather have all junk inside your source dir, leave the next field empty. In my case it is "D:\related\src\wxWidgets\wxMSW-2.4.2\samples\minimal\". In the field Where is the sourcecode fill in the path to the minimal sample. CMakeSetup.exe is smart and will check for existence of the IDE you wish to build. Now, if you don't have this IDE, select one that you have. In the Build for field, select "Visual Studio 7. This means the script above will be parsed, and generated in that specific project. When starting CMakeSetup.exe, you can choose from a number of projects to generate. When we cannot continue, inform the user MESSAGE ( "wxWidgets not found!" ) ENDIF ( wxWidgets_FOUND ) Building the project files Then use INCLUDE($ ) ELSE ( wxWidgets_FOUND ) # For convenience. You may configure the FIND_PACKAGE line as per your needs. Then use FIND_PACKAGE(wxWidgets COMPONENTS core base REQUIRED). Use SET(wxWidgets_CONFIGURATION mswud) to find appropriate configuration. To change the default search path of the wxWidgets installation, use SET(wxWidgets_ROOT_DIR ). ![]() The CMake 2.6.4 installation comes with the file FindwxWidgets.cmake which is used by Cmake for finding any installed wxWidgets on the system. On windows the executable you need is CMake-GUI.exe or CMakeSetup.exe in older versions. I will refer to the Windows version here, but on Linux (use ccmake command for visual setup) it will look similar. First download the latest version from Cmake Homepage. No need to keep 5+ makefiles up to date anymore! Now you can see the power of CMake, because with only one file, you can satisfy a lot of developers. Linux(x86 and ia64) (generates Linux makefile, KDevelop, Code::Blocks and Eclipse)įor all those platforms, all most common projects IDE's can be generated, and at least Makefiles if no IDE is used.Windows (supports Visual Studio 6-10, Borland Makefiles, MinGW, MSYS, NMake, JOM (parallel NMake), Watcom WMake, Code::Blocks and Eclipse).There are downloadable binaries for the following platforms: I started to seriously use it when people started emailing me that the Makefiles I provided for WxTreeMultiCtrl didn't worked on HP-UX, and that the Visual Studio 6 project file was hopelessly out of date (sure enough as I only had VS7 installed back then -) CMake is a project/makefile generator that uses one (or multiple) input files, and can generate multiple types of project files depending on the OS it is executed from.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |