[Nexus] CMake build for NAPI

Eugen Wintersberger eugen.wintersberger at desy.de
Fri Aug 14 19:32:42 BST 2015


Hi Pete

On 08/14/2015 07:51 PM, Peterson, Peter F. wrote:
> 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.

Yeah, one of the many nice things with cmake ;)

> 
> 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

That's a good advice, thanks. I think we have to consider two scenarios
1.) sophisticated users who are able to do the build by themselves
2.) package maintainers

I guess for the former ones the GUI approach is definitely more
comfortable while for the latter ones everything which can go into a
command line is good.

I will check with the GUI stuff.


regards
 Eugen

> 
> 
> ________________________________________
> 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
>>
> 
> _______________________________________________
> NeXus mailing list
> NeXus at nexusformat.org
> http://lists.nexusformat.org/mailman/listinfo/nexus
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.nexusformat.org/pipermail/nexus/attachments/20150814/d73eb56c/attachment-0001.sig>


More information about the NeXus mailing list