Installing/Windows CMake

From Sumo
Jump to: navigation, search

Prerequisites

Method 1: CMake GUI

  • start cmake gui
  • select source path (e.g. D:\projects\sumo)
  • select build path (e.g. D:\projects\sumo\cmake-build)
    • can be identical to source path but it is advised to separate
    • Build dir will be created if necessary
  • Start configuration pressing "Configure" button
    • select compiler (default should do)
  • Create the Visual Studio solution pressing "Generate" button
  • Open D:\projects\sumo\cmake-build\SUMO.sln (from the explorer or by clicking on open project)
  • Build the configurations you want
    • Binaries appear in D:\projects\sumo\bin

Visual guide:

Method 2: CMake command line

  • go to source path (e.g. cd D:\projects\sumo)
  • create build path (e.g. mkdir cmake-build && cd cmake-build)
  • run cmake with the correct Visual Studio version (e.g. cmake .. -G "Visual Studio 12 2013 Win64")
    • for a list of possible generators run cmake --help
  • Open the solution D:\projects\sumo\cmake-build\SUMO.sln
    • or build from the command line using cmake --build . --config Release

Additional options and fine tuning

  • For a different target platform (e.g. 32bit) start cmake again, do not use Visual Studio to add a different platform
  • To enable Libsumo add SWIG dir and exe for building Python and Java bindings
    • Make sure Python and a JDK are installed
    • Python will only work with the release build (unless you compile a debug version of Python yourself)
  • To disable certain features delete all values referring to the feature (e.g. to disable GDAL remove GDAL_INCLUDE_DIR and GDAL_LIBRARY in the CMake GUI or in CMakeCache.txt) and run the generator again

Troubleshooting

  • Python cannot be found
    • Make sure that there isn't two different Python version installed
    • Python libraries can be specified manually (e.g. <PythonFolder>\libs\python<version>.lib)