On 11/01/2016 17:48, Brad King wrote:

That is not representative of CMake in general.  If there is a better
way for FindJNI to get the information it needs then it would be great
to have needed changes contributed.

The Hadoop CMake infrastructure contains pretty much a complete rewrite of the JNI detection code for Linux, on other platforms it seems to be possible to get away with just tweaking things slightly before calling the standard CMake JNI module. The problem of course is all the cross-platform testing any wholesale rewrite would entail...

The Hadoop CMakeLists.txt files don't use a PROJECT() command. The CMake
docs say if you don't do so then an implicit PROJECT() is added that
selects the C & C++ languages, is that done before processing any other
commands in CMakeLists.txt?

Yes, the implicit project() call is inserted on line zero of the top-level
CMakeLists.txt file.  This feature is meant to help people get started
with hello-world projects and is not meant for use by mature projects.
The top-level CMakeLists.txt file of a "real" project should start with

  cmake_minimum_required(VERSION ...)
  project(MyProject)

Flags affecting the target architecture are typically expected to be
provided by the user calling CMake, not by project code, and so will
be set before languages are enabled by this project() command.

That's not the way CMake is used for building Hadoop, CMake is called by Ant and/or Maven, users don't call CMake directly. I suspect that's not too uncommon, when CMake is used to build just the native components of a larger platform-independent system.

--
Alan Burlison
--
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to