Cmake windows

From wikinotes

NOTE:

On windows, files are installed to "C:\Program Files (x86)\<cmake projectname>\" (which is created automatically)

Nmake

# Start > Powershell
#    RClick > Run as Administrator
 
cd $your_project/build
 
cmd.exe                        # open cmd.exe within your powershell (reqd for vcvarsall.bat)
vcvarsall.bat x64              # set environment variables for compiling for x64 windows
 
cmake -G "NMake Makefiles" ..  # generate makefile
nmake                          # compile project
nmake install                  # install compiled project
 
 
exit                           # return to powershell

MinGW

MinGW is GCC for windows. Using mingw you can cross compile your project from any of the following to any of the following: windows, linux, osx.

# Start > Powershell
#    RClick > Run as Administrator
 
cd $your_project/build
 
cmake -G 'MinGW Makefile' ..  # generate makefile (of type mingw)
mingw32-make                  # compile project
mingw32-make install          # install compiled project

Clang/LLVM

WARNING:

Unfinished, producing errors

CMakeLists.txt

cmake_minimum_required(VERSION 3.4.3)
 
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

http://releases.llvm.org/3.8.0/docs/CMake.html

Visual Studio (CLI)

# Start > Powershell
#    RClick > Run as Administrator
 
cd $your_project/build
 
cmd.exe                     # open cmd.exe within your powershell (reqd for vcvarsall.bat)
vcvarsall.bat x64           # set environment variables for compiling for x64 windows
 
cmake ..                    # generate makefile
MSBuild BUILD_ALL.vcxproj   # compile project
MSBuild INSTALL.vcxproj     # install project
 
exit                        # return to powershell

Visual Studio (GUI)

msys2

eclipse