Cmake Vs2017

  1. CMake workaround for VS2017. Posted by Yoni Davidson on 14 May 2018 07:41 AM. IncrediBuild doesn't yet support the new CMake feature in Visual Studio 2017, so below is a general command line workaround that will let you take advantage of the new feature.
  2. Execute the following commands from VS2017 x64 Native Tools Command Prompt: cd c:localsrczlibzlib-1.2.8 mkdir build cd build cmake.G'Visual Studio 15' -DCMAKEINSTALLPREFIX='c:localzlib-vs17' msbuild /P:Configuration=Release INSTALL.vcxproj Building libzip. Execute the following commands from VS2017 x64 Native Tools Command Prompt.

Dependencies¶

Bgfx uses GENie - Project generator tool to generate project files for various platform. Binaries for Linux, OSX, and Windows are included in bx repository. CMake workaround for VS2017. Created by Yoni Davidson. Last updated Jan 09, 2019 by Writer Tech. IncrediBuild doesn't yet support the new CMake feature in Visual Studio 2017, so below is a general command line workaround that will let you take advantage of the new feature. CMake workaround for VS2017. Article Details. IncrediBuild doesn't yet support the new CMake feature in Visual Studio 2017, so below is a general command line workaround that will let you take advantage of the new feature.

Getting Source¶

Cmake Vs2017

Quick Start¶

These are step for users who use Windows with Visual Studio.

Enter bgfx directory:

Generate Visual Studio 2017 project files:

Open bgfx solution in Visual Studio 2017:

Note

Cmake Vs2017 Generator

For more detailed prerequisites and build steps on other platforms see below.

Prerequisites¶

Android¶

Download AndroidNDK:

Set following enironment variables:

To deploy on Android you can use bgfx android activity:

Linux¶

Windows¶

Windows users download GnuWin32 utilities:

Build¶

bgfx uses GENie - Project generator toolto generate project files for various platform. Binaries for Linux, OSX, and Windows are included inbx repository.

General¶

After calling make, .build/projects/* directory will be generated.All intermediate files generated by compiler will be inside .builddirectory structure. Deleting .build directory at any time is safe.

Configuration is <platform>-<debug/release>[32/64]. For example:

Windows¶

Visual Studio 2017 command line:

Visual Studio 2017 IDE:

Xcode¶

Xcode command line:

Xcode IDE:

Due to inabilityto set working directory for an Xcode project from GENieconfiguration file, it has to be set manually for each example project:

  1. Open “Edit scheme…” dialog for a given project.

  2. Select “Run” settings.

  3. Check “Use custom working directory” and enter following path:${PROJECT_DIR}/../../../examples/runtime.

Linux¶

WinRT / UWP¶

Build the resulting solution and deploy to device.

Note

Shaders will need to be compiled with the appropriate target profile for your platform.

Amalgamated Build¶

For ease of integration to other build system bgfx library can be builtwith single .cpp file. It’s only necessary to buildsrc/amalgamated.cpp(for OSX/iOS usesrc/amalgamated.mminstead) inside different build system.

Tools¶

To build bgfx project files for tools, use --with-tools option:

Alternative build systems¶

CMake

fips is a highlevel build system wrapper written in Python for C/C++ projects.https://github.com/floooh/fips#fips

Conan packagehttps://github.com/firefalcom/bgfx-conan

Minimal example without bgfx’ example harness¶

This project demonstrates minimal amount of code needed to integrate bgfx with GLFW, but withoutany of existing bgfx example harness. It also demonstrates how to build bgfx with alternative buildsystem.

Generates Visual Studio 16 (VS 2019) project files.

Project Types¶

Only Visual C++ and C# projects may be generated. Other types ofprojects (JavaScript, Powershell, Python, etc.) are not supported.

Instance Selection¶

VS 2019 supports multiple installations on the same machine.The CMAKE_GENERATOR_INSTANCE variable may be set as acache entry containing the absolute path to a Visual Studio instance.If the value is not specified explicitly by the user or a toolchain file,CMake queries the Visual Studio Installer to locate VS instances, choosesone, and sets the variable as a cache entry to hold the value persistently.

When CMake first chooses an instance, if the VS160COMNTOOLS environmentvariable is set and points to the Common7/Tools directory withinone of the instances, that instance will be used. Otherwise, if morethan one instance is installed we do not define which one is chosenby default.

Platform Selection¶

The default target platform name (architecture) is that of the hostand is provided in the CMAKE_VS_PLATFORM_NAME_DEFAULT variable.

The CMAKE_GENERATOR_PLATFORM variable may be set, perhapsvia the cmake(1)-A option, to specify a target platformname (architecture). For example:

  • cmake-G'VisualStudio162019'-AWin32

  • cmake-G'VisualStudio162019'-Ax64

  • cmake-G'VisualStudio162019'-AARM

  • cmake-G'VisualStudio162019'-AARM64

Toolset Selection¶

The v142 toolset that comes with Visual Studio 16 2019 is selected bydefault. The CMAKE_GENERATOR_TOOLSET option may be set, perhapsvia the cmake(1)-T option, to specify another toolset.

Cmake Vs2017 Error

New in version 3.8: For each toolset that comes with this version of Visual Studio, there arevariants that are themselves compiled for 32-bit (x86) and64-bit (x64) hosts (independent of the architecture they target).By default this generator uses the 64-bit variant on x64 hosts andthe 32-bit variant otherwise.One may explicitly request use of either the 32-bit or 64-bit host toolsby adding either host=x86 or host=x64 to the toolset specification.See the CMAKE_GENERATOR_TOOLSET variable for details.

New in version 3.14: Added suport for host=x86 option.