[Nexus] CMake build for NAPI

Peterson, Peter F. petersonpf at ornl.gov
Fri Aug 14 18:51:16 BST 2015


HDF4 is default off in that commit (see https://github.com/nexusformat/code/blob/cmake_build/CMakeLists.txt#L53). However, if you enable it, a fatal error is generated when it isn't found. cmake caches everything it finds (and sometimes what it doesn't). If you want to develop your cmake configuration, you'll end up deleting your entire build area quite often. This is why in most cmake built software the process tends towards out of source builds:

$ mkdir build
$ cd build
$ cmake-gui ../
$ make
$ make test

When variable names change in your cmake configuration (like my changeset did), you're best off just deleting build and starting over. I'm more familiar with using cmake-gui, where the advanced checkbox will let you explicitly set where all of the libraries are.

If you want to set a bunch of variables in cmake, you are better off supplying a cache file

$ cmake ../ -C my_awesome_cache.cmake -G Ninja


________________________________________
From: NeXus <nexus-bounces at nexusformat.org> on behalf of Eugen Wintersberger <eugen.wintersberger at desy.de>
Sent: Friday, August 14, 2015 13:12
To: nexus at nexusformat.org
Subject: Re: [Nexus] CMake build for NAPI

Hi Mark,

On 08/14/2015 11:59 AM, Koennecke Mark (PSI) wrote:
> I then proceeded to try and build it with  HDF4. The build could not pick up HDF4. I have it in a
> non standard location and I tried to coerce cmake to locate it using two different paths:
> * by CFLAGS and LDFLAGS
> * by a CMAKE_LIBRARY_PATH in CMakeLists.txt
>
> Both failed such that I assume there is something wrong  with the HDF4 detection code.

The problem seems to be that Pete (Peterson) has HDF4 by default in his
last commit. In order to enable it you have to run cmake with

$cmake -DENABLE_HDF4=1 -DHDF4_INCLUDE_DIRS=<path to hdf4 headers> <path
to sources>

As far as I know, cmake does not read CFLAGS during configuration (need
to look this up).

>
> Another suggestion: the CMAKE_LIBRARY_PATH thing should be in the CMakeList.txt by
> default. Commented out and accompanied with a explanation: change this if your stuff
> lives elsewhere.

I rather prefer configuration via CMake variables. The problem with
changing the CMakeLists.txt file is that package maintainers would have
to create an explicit patch for this (at least for Debian).

regards
  Eugen

>
> Regards,
>
>      Mark
>
>
>> I am looking forward to your feedback.
>>
>> best regards
>> Eugen
>>
>> _______________________________________________
>> NeXus mailing list
>> NeXus at nexusformat.org
>> http://lists.nexusformat.org/mailman/listinfo/nexus
>
>
> _______________________________________________
> NeXus mailing list
> NeXus at nexusformat.org
> http://lists.nexusformat.org/mailman/listinfo/nexus
>



More information about the NeXus mailing list