leuction
leuction

Reputation: 585

How to use cmake on the machine which cmake is not installed

I am using the cmake to build my project. However, I need to build this project on a machine that I do not have the permission to install any software on it. I thought I can use the generated makefile but it has the dependencies on CMake,and says cmake:command not found.Is there any solution that force the generated makefile do not have any cmake related command such as check the system version? Thanks

Upvotes: 0

Views: 270

Answers (2)

user3629249
user3629249

Reputation: 16540

one easy solution is to use static libraries and the 'static' parameter in the command line.

Then you should be able to drop the executable on the target machine and run it.

Upvotes: 0

John Bollinger
John Bollinger

Reputation: 181179

Is there any solution that force the generated makefile do not have any cmake related command such as check the system version?

No. There is no incentive for cmake to provide such an option, because the whole point of the cmake system is that the cmake program examines the build machine and uses what it finds to generate a Makefile (if you're using that generator) appropriate to the machine. The generated Makefiles are tailored to the machine, and it is not assumed that they would be suitable for any other machine, so there is no reason to suppose that one would need to use one on a machine that does not have cmake. In fact, if you look at the generated Makefiles you'll find all sorts of dependencies on cmake.

Depending on the breadth of your target machine types, you might consider the Autotools instead. Some people dislike them, and they're not a good choice if you want to support Microsoft's toolchain on Windows, but they do have the advantage that an Autotools-based build system can be used to build software on machines that do not themselves have the Autotools installed.

Upvotes: 2

Related Questions