Menu

Using_CMake_To_Create_Your_Project

Karl  Jones
Attachments
CMake1.jpg (13702 bytes)
CMake2.jpg (15127 bytes)
CMake4.png (180795 bytes)

What Is CMake?

CMake is a cross-platform, open-source build system. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.

CMake can be used to create the KDIS project files for many different IDE.

I have used CMake to create project files for the following IDE with no problems(Many more are supported):
  • Visual Studio 2003/2005/2008/2010/2012

  • KDevelop(Linux)

  • NetBeans(Windows & Linux)

  • XCode(Mac)

Where To Download CMake

[CMake](http://www.cmake.org/)

Using the GUI - Windows/Linux

**Note: The CMake GUI appearance may have changed since I wrote this guide however the steps are exactly the same.**




1\. Open CMake GUI.




2\. Drag the file CMakeLists.txt into the GUI window, note you **must** use the CMakeLists.txt in the root, if you use any others it will not work.

3\. Press configure, choose the compiler you want to build for and press ok.

4\. You should now see several options in the main screen highlighted red. They can be changed to customise the build.

CMake Options

BUILD_EXAMPLES

_If 'ON' then the examples will be included into the project/solution. Introduced in version 2-2-0_
_If 'ON' the examples will use a library version of KDIS, if 'OFF' KDIS source files will be included into all examples._

CMAKE_BACKWARD_COMPATIBILITY

_You can ignore this._

EXAMPLES_USE_STATIC_OR_SHARED_LIB

_If the examples are using a library version of KDIS, do you want STATIC(.lib) or SHARED(.dll)? Valid entries are '**STATIC'** or '**SHARED'**._

CMAKE_INSTALL_PREFIX

_You can ignore this._

EXECUTABLE_OUTPUT_PATH

_Where to build binaries, leave blank for default. _

LIBRARY_OUTPUT_PATH

_Where to build libraries, leave blank for default. NOTE: If you change this you will need to tell any projects that use the KDIS lib where to find it._

DIS_VERSION

_The version of DIS to use. 1278.1-1995(5), 1278.1a-1998(6) or 1278.1-20xx(7). This parameter will decide what files should be included in the example projects. Valid entries are '**5'**, '**6'** or '**7'**._

USE_SOLUTION_FOLDERS

_Generate solution folders to better organise projects, This is not supported on all IDE, its mainly a Visual Studio Pro(Not Express) feature._

Related

Wiki: Main_Page

MongoDB Logo MongoDB