[CMake] Beginning to compiling CMake file

Domen Vrankar domen.vrankar at gmail.com
Wed Aug 1 01:28:42 EDT 2018


On Wed, Aug 1, 2018, 03:46 CrestChristopher <crestchristopher at gmail.com>
wrote:

> Hi, I'm using CMake for Windows as I was informed that I couldn't use
> `make` as the CMakeLists.txt file was only for CMake.
>

CMake is a meta build system which means that on for example Linux it
henerates make fliles so CMakeLists.txt should be run with cmake to
generate those make files and then you run make in the build directory.

On Windows you usually use visual studio so cmake generates build and
project files for it there.

Not use make and use cmake instead in this case means that you should use
cmake to generate build files with cmake and not change generated build
files by hand. It doesn't mean that after running cmake you shouldn't run
make on those generated files if they were generated for make.

Within CMake for Windows I select the location of the source code which
> is the cloned repository which include the CMakeLists.txt file that I
> want to compile, followed by I select a folder where to build the
> binaries; I'm then prompt for a generator for the project. Up to this
> point am I doing this correctly ?
>

Michael already answered for you how to build it from command line on all
platforms (on Linux you can also use 'make' directly instead of running
'cmake - build'). If you selected to generate files for Visual Studio cmake
also generated vs project file so you can open it in ide and run build
there instead.

Hope this clarifies things a bit more.

Regards,
Domen

On 7/31/2018 12:56 PM, Michael Ellery wrote:
> > mkdir mybuild && cd mybuild
> > cmake -DCMAKE_BUILD_TYPE=Release ..
> > cmake —build .
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180801/701485b6/attachment.html>


More information about the CMake mailing list