[CMake] Makefiles without reference to CMake?
Michael Wild
themiwi at gmail.com
Wed Jul 6 11:40:59 EDT 2011
No, I don't think so. But then: *WHY*??? Would you also bundle GNU Make?
It just doesn't make sense. Declare CMake to be a build dependency, and
that's it. If people want to build your stuff, they have to install
CMake. It's really just
wget http://www.cmake.org/files/v2.8/cmake-2.8.4-Linux-i386.tar.gz
tar xzf cmake-2.8.4-Linux-i386.tar.gz
Simple as that.
Moving build trees from one computer to another is outright dangerous.
If you put it in a different path, it will fail from the start,
otherwise it can result in strange errors because there might be subtle
differences (such as different versions of service packs, different
names/versions/installation location of libraries, absence of
dependencies etc) between the machines, but CMake doesn't recheck, so
your build goes kaboom.
Really, don't waste your time with that.
Michael
On 07/06/2011 05:31 PM, Bello, Musodiq O (GE Healthcare) wrote:
> Thanks, Michael. But is there a way to make the references to CMake a
> relative path rather than an absolute path? This will allow us to bundle
> CMake with the source tree.
>
>
>
> Thanks.
>
> Musodiq
>
>
>
> *From:*Michael Wild [mailto:themiwi at gmail.com]
> *Sent:* Saturday, July 02, 2011 1:19 AM
> *To:* Bello, Musodiq O (GE Healthcare)
> *Cc:* <cmake at cmake.org>
> *Subject:* Re: [CMake] Makefiles without reference to CMake?
>
>
>
> This has been discussed a gazillion times, and the answer will always be
> the same: no. It's impossible. A build tree always depends on CMake, and
> is not relocatable. Live with it.
>
>
>
> If your users don't want to use CMake, provide them with a convenience
> script that does the hard work for them.
>
>
>
> HTH
>
>
>
> Michael
>
>
>
>
> On 01.07.2011, at 23:43, "Bello, Musodiq O (GE Healthcare)"
> <bello at ge.com <mailto:bello at ge.com>> wrote:
>
> Hello,
>
>
>
> I used cmake to build a project and it runs fine on my Linux box as
> part of a bigger app. But I need to be able to check in the
> Makefiles along with my code, so that other users don't need to
> perform the cmake configuration all over. The problem is that the
> Makefiles generated by cmake have references to the cmake
> executable. The Makefiles include lines such as
>
> CMakeFiles/Makefile2: $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR)
> -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
>
> libmed/Makefile: cd .. && $(CMAKE_COMMAND) -E
> cmake_progress_start /musodiq/med/medbuild/arch/linux64/CMakeFiles
> /musodiq/medbuild/arch/linux64/libmed/CMakeFiles/progress.marks
>
> libmed/Makefile: cd .. && $(CMAKE_COMMAND)
> -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system
> CMakeFiles/Makefile.cmake 0
>
> where CMAKE_COMMAND is hardcoded as my local installation of cmake.
> This makes it difficult to simply use the Makefiles on another
> computer directly from a cvs/svn checkout.
>
> What can I do to avoid any dependence on cmake once the Makefiles
> are generated? How can I skip execution of lines such as the above
> during a gmake build? If there's no way to avoid dependence on
> cmake, how can I specify the path to cmake to be relative so that I
> can put cmake as part of the project to be checked out?
>
> Thanks for your help.
>
> Musodiq
>
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
More information about the CMake
mailing list