File: INSTALL_CMake.txt

package info (click to toggle)
jhdf 2.11.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 40,088 kB
  • sloc: java: 100,416; ansic: 24,920; sh: 2,256; makefile: 957; cpp: 48
file content (754 lines) | stat: -rw-r--r-- 35,820 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
************************************************************************
* Build and Install HDFView and HDF-JAVA Library with CMake                      *
************************************************************************

                     Table of Contents
                     
Section I:    Preconditions
Section II:   Quick Step Building HDF-JAVA Libraries with CMake Script Mode 
Section III:  Quick Step Building HDF-JAVA Libraries with CMake Command Mode
Section IV:   Further considerations                                                           
Section V:    Options for building HDF-JAVA Libraries with CMake command line
Section VI:   CMake option defaults for HDF-JAVA
Section VII:  User Defined Options for HDF-JAVA Libraries with CMake
Section VIII: Options for platform configuration files

************************************************************************


========================================================================
I. Preconditions
========================================================================
Obtaining HDF-JAVA source code 
   1. Create a directory for your development; for example, "myhdfstuff".

   2. Obtain compressed (*.tar or *.zip) HDF-JAVA source from
        http://www.hdfgroup.org/ftp/hdf-java/current/src/
      and put it in "myhdfstuff".
      Do not uncompress.

CMake version
   1. We suggest you obtain the latest CMake from the Kitware web site. 
      The HDF-JAVA 2."X.Y" product requires a minimum CMake version 2.8.12,
      where "X.Y" is the current HDF-JAVA release version.                     


========================================================================
II. Quick Step Building HDF-JAVA Libraries with CMake Script Mode
========================================================================
This short set of instructions is written for users who want to quickly 
build the HDF-JAVA Library and HDFView from the HDF-JAVA source code package 
using the CMake tools. This procedure will use the default settings in the 
config/cmake/cacheinit.cmake file. HDF Group recommends using the ctest script 
mode to build HDF-JAVA.

The following files referenced below are available at the HDF web site:
    http://www.hdfgroup.org/products/java/release/downloadsrc.html

CMake build script:
    CTestScript.cmake

External compression szip and zlib libraries:
    SZip.tar.gz
    ZLib.tar.gz
    JPEG8b.tar.gz
    HDF4.tar.gz
    HDF5.tar.gz
    
Platform configuration files:
    HDFJAVAWindows64CMake.cmake
    HDFJAVAWindows32CMake.cmake
    HDFJAVALinuxCMake.cmake
    HDFJAVAMacCMake.cmake
    
To build HDF-JAVA with all the external libraries you will need to:

   1. Change to the development directory "myhdfstuff".
    
   2. Download the *.tar.gz files to "myhdfstuff".
      Do not uncompress the files.
       
   3. Download the CTestScript.cmake file to "myhdfstuff".
      CTestScript.cmake file should not be modified.    
       
   4. Download a platform configuration file to "myhdfstuff".
      Do not modify the file unless you want to change default build 
      environment.

   5. From the "myhdfstuff" directory execute the CTest Script with the 
      following options:

         ctest -S <configuration file> -C Release -VV -O hdfjava.log

      The command above will configure, build, test, and create an install 
      package in the myhdfstuff/hdf-java/build folder.

      The -S option uses the script version of ctest.
        
      The value for the -C option (as shown above, "-C Release") must 
      match the setting for CTEST_BUILD_CONFIGURATION in the platform 
      configuration file.
        
      The -VV option is for verbose; use -V for less verbose.
        
      The "-O hdfjava.log" option saves the output to a log file hdfjava.log.

   6. To install, "X.Y" is the current release version
 
      On Windows, execute:
                HDFView-2."X.Y"-win32.exe or HDFView-2."X.Y"-win64.exe
      By default this program will install HDFView and the hdf-java library 
      into the "C:\Program Files" directory and will create the following 
      directory structure:
         HDF_Group
         --HDFView
         ----2."X.Y"
         ------bin
         ------cmake
         ------javadocs
         ------lib
         ------samples

      On Linux, change to the install destination directory 
      (create it if doesn't exist) and execute:
                <path-to>/myhdfstuff/hdf-java/build/HDFView-2."X.Y"-Linux.sh
      After accepting the license, the script will prompt:
        By default the HDF-JAVA will be installed in:
        "<current directory>/HDFView-2."X.Y"-Linux"
        Do you want to include the subdirectory HDFView-2."X.Y"-Linux?
        Saying no will install in: "<current directory>" [Yn]: 
      Note that the script will create the following directory structure
      relative to the install point:
         HDF_Group
         --HDFView
         ----2."X.Y"
         ------bin
         ------javadocs
         ------lib
         ------samples
         ------share
      By default the installation will create the folders in the 
      <install destination directory>/HDF_Group/HDFView/2."X.Y" location.
                
      On Mac you will find HDFView-2."X.Y"-Darwin.dmg in the build folder. Click
      on the dmg file to proceed with installation. After accepting the license,
      there will be an application packaged named: 
                HDFView
      By default this will install HDFView and the hdf-java library 
      into the "/Applications/HDFView.app/Contents/" directory and will create 
      the following directory structure:
         Java
         MacOS
         Resources
         --lib
         --share
         ----cmake
         ----javadocs
         SharedSupport
         ----samples


========================================================================
III. Quick Step Building HDFView and HDF-JAVA Static Libraries with CMake
========================================================================
Notes: This short set of instructions is written for users who want to 
       quickly build the just HDFView and the HDF-JAVA static library from 
       the HDF-JAVA source code package using the CMake command line tools.
       
   Go through these steps:

      1. Change to the development directory "myhdfstuff".

      2. Uncompress the HDF-JAVA source file
      
      3. Create a folder "build" in the "myhdfstuff" directory.
      
      4. Change into the "build" folder. 
      
      5. Configure HDFView, the library and tests with one of the following commands:

         On Windows 32 bit
           cmake -G "Visual Studio 11" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON ..\hdf-java-2."X.Y"

         On Windows 64 bit
           cmake -G "Visual Studio 11 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON ..\hdf-java-2."X.Y"
      
         On Linux and Mac
           cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON ../hdf-java-2."X.Y"

         where "X" is the current release version.
         
      6. Build HDFView, the library and tests with this command:
           cmake --build . --config Release
      
      7. Test HDFView and the library with this command:
           ctest . -C Release
      
      8. Create an install image with this command:
           cpack -C Release CPackConfig.cmake
      
      9. To install, "X.Y" is the current release version
 
         On Windows, execute:
                HDFView-2."X.Y"-win32.exe or HDFView-2."X.Y"-win64.exe
         By default this program will install HDFView and the hdf-java library 
         into the "C:\Program Files" directory and will create the following 
         directory structure:
            HDF_Group
            --HDFView
            ----2."X.Y"
            ------bin
            ------cmake
            ------javadocs
            ------lib
            ------samples

         On Linux, change to the install destination directory 
         (create it if doesn't exist) and execute:
                <path-to>/myhdfstuff/hdf-java/build/HDFView-2."X.Y"-Linux.sh
         After accepting the license, the script will prompt:
           By default the HDF-JAVA will be installed in:
           "<current directory>/HDFView-2."X.Y"-Linux"
           Do you want to include the subdirectory HDFView-2."X.Y"-Linux?
           Saying no will install in: "<current directory>" [Yn]: 
         Note that the script will create the following directory structure
         relative to the install point:
            HDF_Group
            --HDFView
            ----2."X.Y"
            ------bin
            ------javadocs
            ------lib
            ------samples
            ------share
         By default the installation will create the folders in the 
         <install destination directory>/HDF_Group/HDFView/2."X.Y" location.
                
         On Mac you will find HDFView-2."X.Y"-Darwin.dmg in the build folder. Click
         on the dmg file to proceed with installation. After accepting the license,
         there will be an application packaged named: 
                HDFView
         By default this will install HDFView and the hdf-java library 
         into the "/Applications/HDFView.app/Contents/" directory and will create 
         the following directory structure:
            Java
            MacOS
            Resources
            --lib
            --share
            ----cmake
            ----javadocs
            SharedSupport
            ----samples


========================================================================
IV. Further considerations                                                           
========================================================================

   1. We suggest you obtain the latest CMake for windows from the Kitware
      web site. The HDF-JAVA 2.x product requires a minimum CMake version
      of 2.8.12.
                                                                         
   2. HDF-JAVA requires Zlib, Szip, Jpeg, hdf4, hdf5:
      A. Download the binary packages and install them in a central location. 
         For example on Windows, create a folder extlibs and install the 
         packages there. Add the following CMake options:
            -DZLIB_LIBRARY:FILEPATH=${some_location}/lib/zlib.lib
            -DZLIB_INCLUDE_DIR:PATH=${some_location}/include
            -DSZIP_LIBRARY:FILEPATH=${some_location}/lib/szlib.lib
            -DSZIP_INCLUDE_DIR:PATH=${some_location}/include
            -DJPEG_LIBRARY:FILEPATH=${some_location}/lib/jpeg.lib
            -DJPEG_INCLUDE_DIR:PATH=${some_location}/include
            -DHDF4_LIBRARY:FILEPATH=${some_location}/lib/hdf.lib;some_location/lib/mfhdf.lib
            -DHDF4_INCLUDE_DIR:PATH=${some_location}/include
            -DHDF5_LIBRARY:FILEPATH=${some_location}/lib/hdf5.lib
            -DHDF5_INCLUDE_DIR:PATH=${some_location}/include
         where "${some_location}" is the full path to the extlibs folder. 

      B. Use source packages from an SVN server by adding the following CMake 
         options:
         
            HDF_ALLOW_EXTERNAL_SUPPORT:STRING="SVN"
            HDF4_SVN_URL:STRING="http://${some_location}/hdf4/trunk"
            HDF5_SVN_URL:STRING="http://${some_location}/hdf5/trunk"
            JPEG_SVN_URL:STRING="http://${some_location}/jpeg/trunk"
            ZLIB_SVN_URL:STRING="http://${some_location}/zlib/trunk"
            SZIP_SVN_URL:STRING="http://${some_location}/szip/trunk"
         where "${some_location}" is the URL to the SVN repository. Also set
         CMAKE_BUILD_TYPE to the configuration type.
         
      C. Use source packages from a compressed file by adding the following 
         CMake options:
            HDF_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ"
            HDF4_TGZ_NAME:STRING="hdf4_src.ext"
            HDF5_TGZ_NAME:STRING="hdf5_src.ext"
            JPEG_TGZ_NAME:STRING="jpeg_src.ext"
            ZLIB_TGZ_NAME:STRING="zlib_src.ext"
            SZIP_TGZ_NAME:STRING="szip_src.ext"
            TGZPATH:STRING="${some_location}"
         where "${some_location}" is the URL or full path to the compressed 
         file and ext is the type of compression file. Also set CMAKE_BUILD_TYPE
         to the configuration type during configuration
                                    
   3. If you are building on Apple Darwin platforms, you should add the 
      following options:
          Compiler choice - use xcode by setting the ENV variables of CC and CXX
          Shared fortran is not supported, build static:
            BUILD_SHARED_LIBS:BOOL=OFF
          Additional options:
            CMAKE_ANSI_CFLAGS:STRING=-fPIC
            CTEST_USE_LAUNCHERS:BOOL=ON
            CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF         
   
   4. Windows developers should install NSIS to create an install image with CPack.
      Visual Studio Express users will not be able to package HDF-JAVA into
      an install image executable.
   
   5. Developers can copy the config/cmake/cacheinit.cmake file and alter the
      the settings for the developers' environment. Then the only options needed
      on the command line are those options that are different. Example using HDF
      default cache file:
           cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 11" \
               -DHDF_ENABLE_SZIP_SUPPORT:BOOL=OFF \
               -DCMAKE_BUILD_TYPE:STRING=Release ..

Notes: CMake and HDF-JAVA

   1. Using CMake for building and using HDF-JAVA is under active development. 
      While we have attempted to provide error-free files, please 
      understand that development with CMake has not been extensively 
      tested outside of HDF. The CMake specific files may change
      before the next release.
            
   2. CMake support for HDF-JAVA development should be usable on any 
      system where CMake is supported. Please send us any comments on 
      how CMake support can be improved on any system. Visit the 
      KitWare site for more information about CMake.
            
   3. Build and test results can be submitted to our CDash server at:
                 cdash.hdfgroup.uiuc.edu. 
      Please read the HDF and CDash document at:
                 www.hdfgroup.org/CDash/HowToSubmit. 
            
   4. See the appendix at the bottom of this file for examples of using
      a ctest script for building and testing. Using a ctest script is
      preferred because of its flexibility.
            
Notes: CMake in General

   1. More information about using CMake can be found at the KitWare site at 
         www.cmake.org.
         
   2. CMake uses the command line; however, the visual CMake tool is 
      available for the configuration step. The steps are similar for
      all the operating systems supported by CMake.


========================================================================
V. Options for Building HDFView and HDF-JAVA Libraries with the CMake Command Line
========================================================================

To build HDFView and the HDF-JAVA Libraries with CMake, go through these five steps:

   1. Run CMake
   2. Configure the cache settings
   3. Build HDF-JAVA
   4. Test HDF-JAVA
   5. Package HDF-JAVA (create install image)

These five steps are described in detail below.

========================================================================

   1. Run CMake

      The visual CMake executable is named "cmake-gui.exe" on Windows and should be
      available in your Start menu. For Linux, UNIX, and Mac users the
      executable is named "cmake-gui" and can be found where CMake was 
      installed. 
      
      Specify the source and build directories. 
      
      ***** Make the build and source directories different. ******
      
      For example on Windows, if the source is at c:\MyHDFstuff\hdf-java, 
      then use c:\MyHDFstuff\hdf-java\build or c:\MyHDFstuff\build\hdf-java as the 
      build directory.
      
      RECOMMENDED:
        Users can perform the configuration step without using the visual 
        cmake-gui program. We use the file cacheinit.cmake in the 
        config/cmake source folder for our testing. This file enables all of the 
        basic options and we turn specific options on or off for testing 
        using the following command line within the build directory:
        
        cmake -C <sourcepath>/config/cmake/cacheinit.cmake -G "<generator>"  [-D<options>]  <sourcepath>
        
        Where <generator> is:    
            * MinGW Makefiles
            * NMake Makefiles
            * Unix Makefiles
            * Visual Studio 12
            * Visual Studio 12 Win64
            * Visual Studio 11
            * Visual Studio 11 Win64
            * Visual Studio 10
            * Visual Studio 10 Win64

        <options> is:
            * HDF4_INCLUDE_DIR:PATH=<path to hdf4 includes directory>
            * HDF4_LIBRARY:FILEPATH=<path to hdf4/library file>
            * HDF5_INCLUDE_DIR:PATH=<path to hdf5 includes directory>
            * HDF5_LIBRARY:FILEPATH=<path to hdf5/library file>
            * SZIP_INCLUDE_DIR:PATH=<path to szip includes directory>
            * SZIP_LIBRARY:FILEPATH=<path to szip/library file>
            * ZLIB_INCLUDE_DIR:PATH=<path to zlib includes directory>
            * ZLIB_LIBRARY:FILEPATH=<path to zlib/library file>
            * JPEG_INCLUDE_DIR:PATH=<path to jpeg includes directory>
            * JPEG_LIBRARY:FILEPATH=<path to jpeg/library file>
            * <HDFJAVAOPTION>:BOOL=[ON | OFF]

        <cacheinit.cmake> is:
                # This is the CMakeCache file used by HDF Group for daily tests.
                ########################
                # EXTERNAL cache entries
                ########################
                set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
                set (USE_SHARED_LIBS OFF CACHE BOOL "Use Shared Libraries" FORCE)
                set (BUILD_TESTING ON CACHE BOOL "Build HDFJAVA Unit Testing" FORCE)
                set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
                set (HDF_BUILD_EXAMPLES ON CACHE BOOL "Build HDFJAVA Library Examples" FORCE)
                set (HDF_ENABLE_JPEG_LIB_SUPPORT ON CACHE BOOL "Use Jpeg library" FORCE)
                set (HDF_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
                set (HDF_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
                set (HDF_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
                set (HDF_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
                set (HDF_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
                set (HDF_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
                set (HDF_SKIP_GUI_TESTS OFF CACHE BOOL "Skip testing of GUI" FORCE)
                set (HDF_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
                set (HDF_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE)
                set_property (CACHE HDF_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ)
                set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
                set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
                set (JPEG_TGZ_NAME "JPEG8b.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE)
                set (HDF4_TGZ_NAME "HDF4.tar.gz" CACHE STRING "Use HDF4 from compressed file" FORCE)
                set (HDF5_TGZ_NAME "HDF5.tar.gz" CACHE STRING "Use HDF5 from compressed file" FORCE)
                set (HDF4_PACKAGE_NAME "hdf4" CACHE STRING "Name of HDF4 package" FORCE)
                set (HDF5_PACKAGE_NAME "hdf5" CACHE STRING "Name of HDF5 package" FORCE)
                set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
                set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
                set (JPEG_PACKAGE_NAME "jpeg" CACHE STRING "Name of JPEG package" FORCE)

   2. Configure the cache settings

      2.1  Visual CMake users, click the Configure button. If this is the first time you are 
           running cmake-gui in this directory, you will be prompted for the 
           generator you wish to use (for example on Windows, Visual Studio 11). 
           CMake will read in the CMakeLists.txt files from the source directory and 
           display options for the HDF-JAVA project. After the first configure you 
           can adjust the cache settings and/or specify the locations of other programs.
      
           Any conflicts or new values will be highlighted by the configure
           process in red. Once you are happy with all the settings and there are no 
           more values in red, click the Generate button to produce the appropriate 
           build files. 
      
           On Windows, if you are using a Visual Studio generator, the solution and 
           project files will be created in the build folder.
      
           On linux, if you are using the Unix Makefiles generator, the Makefiles will
           be created in the build folder.

      2.2  Preferred command line example on Windows in c:\MyHDFstuff\hdf-java\build directory:
      
               cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 11" \
               -DHDF_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF_BUILD_EXAMPLES:BOOL=OFF \
               -DCMAKE_BUILD_TYPE:STRING=Release ..

      2.3  On Windows, if you are using a Visual Studio Express version you must 
           be sure that the following two options are correctly set/unset:
           
           HDF_NO_PACKAGES:BOOL=ON
           HDF_USE_FOLDERS:BOOL=OFF
           
   3. Build HDF-JAVA
   
      On Windows, you can build HDF-JAVA using either the Visual Studio Environment 
      or the command line. The command line can be used on all platforms;
      Windows, linux, Unix, and Mac.

      To build from the command line, navigate to your build directory and
      execute the following:
          
              cmake --build . --config {Debug | Release}     
              
      NOTE: "--config {Debug | Release}" may be optional on your platform. We
            recommend choosing either Debug or Release on Windows.                                                                                      
             
      3.1  If you wish to use the Visual Studio environment, open the solution 
           file in your build directory. Be sure to select either Debug or 
           Release and build the solution.
             
      3.2.1  The external libraries (zlib, Szip, jpeg, hdf4 and hdf5) can be 
           configured to allow building the libraries by downloading from 
           an SVN repository. The option is 'HDF_ALLOW_EXTERNAL_SUPPORT'; 
           by adding the following configuration option:
               -DHDF_ALLOW_EXTERNAL_SUPPORT:STRING="SVN"
               
           The options to control the SVN URL (config/cmake/cacheinit.cmake file) are:
               HDF4_SVN_URL:STRING="http://${some_location}/hdf4/trunk"
               HDF5_SVN_URL:STRING="http://${some_location}/hdf5/trunk"
               JPEG_SVN_URL:STRING="http://${some_location}/jpeg/trunk"
               ZLIB_SVN_URL:STRING="http://${some_location}/zlib/trunk"
               SZIP_SVN_URL:STRING="http://${some_location}/szip/trunk"
           ${some_location} should be changed to your svn location. Also define CMAKE_BUILD_TYPE
           to be the configuration type.
           
      3.2.2  Or the external libraries (zlib, szip, jpeg, hdf4 and hdf5) can 
           be configured to allow building the libraries by using a compressed 
           file. The option is 'HDF_ALLOW_EXTERNAL_SUPPORT' and is enabled by 
           adding the following configuration option:
               -DHDF_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ"
               
           The options to control the SVN URL (config/cmake/cacheinit.cmake 
           file) are:
               HDF4_TGZ_NAME:STRING="hdf4_src.ext"
               HDF5_TGZ_NAME:STRING="hdf5_src.ext"
               JPEG_TGZ_NAME:STRING="jpeg_src.ext"
               ZLIB_TGZ_NAME:STRING="zlib_src.ext"
               SZIP_TGZ_NAME:STRING="szip_src.ext"
               TGZPATH:STRING="some_location"
           where "some_location/xxxx_src.ext" is the URL or full path to 
           the compressed file and where ext is the type of the compression 
           file such as .bz2, .tar, .tar.gz, .tgz, or .zip. Also define
           CMAKE_BUILD_TYPE to be the configuration type.

   4. Test HJAVA

      To test the build, navigate to your build directory and execute:
      
              ctest . -C {Debug | Release}
              
      NOTE: "-C {Debug | Release}" may be optional on your platform. We
            recommend choosing either Debug or Release to match the build
            step on Windows.                                                                                      

   5. Packaging HDF-JAVA (create an install image)
   
      To package the build into a simple installer using the NullSoft 
      installer NSIS on Windows, or into compressed files (.tar.gz, .sh, 
      .zip), use the CPack tool.

      To package the build, navigate to your build directory and execute;
      
              cpack -C {Debug | Release} CPackConfig.cmake
      
      NOTE: See note 8 of this document for NSIS information.
            Also, if you are using a Visual Studio Express version or do not 
            want to enable the packaging components, set HDF_NO_PACKAGES 
            to ON (on the command line add -DHDF_NO_PACKAGES:BOOL=ON)
           
   6. The files that support building HDF-JAVA with CMake are all the files 
      in the config/cmake folder, the CMakeLists.txt files in each source 
      folder, and CTestConfig.cmake. CTestConfig.cmake is specific to the 
      internal testing performed by The HDF Group. It should be altered for 
      the user's installation and needs. The cacheinit.cmake file settings are 
      used by The HDF Group for daily testing. It should be altered/ignored for 
      the user's installation and needs.

   7. More information about using CMake can be found at the KitWare site,
        www.cmake.org.
      
   8. Nullsoft Scriptable Install System
      The Nullsoft Scriptable Install System (NSIS) is an open source installation 
      system. It was created by the WinAmp authors to distribute that application, 
      but it is now a general-purpose system which anyone might use. NSIS installers 
      recognize /S for silent installation and /D=dir to specify the 
      "output directory", which is where the program will be installed. These 
      options are case-sensitive, so be sure to type them in upper case. 



========================================================================
VI. CMake Option Defaults for HDF-JAVA
========================================================================

In the options listed below, there are three columns of information: 
Option Name, Option Description, and Option Default. 
The config/cmake/cacheinit.cmake file overrides the following values.

---------------- General Build Options ---------------------
BUILD_SHARED_LIBS       "Build Shared Libraries"        OFF
BUILD_TESTING           "Build HDF-JAVA Unit Testing"   OFF

---------------- HDF-JAVA Build Options ---------------------
HDF_BUILD_EXAMPLES      "Build HDF-JAVA Library Examples"                      OFF
HDFJAVA_PACK_EXAMPLES   "Package the HDFJAVA Library Examples Compressed File" OFF

---------------- HDF-JAVA Apple Build Options ---------------------
HDF_BUILD_WITH_INSTALL_NAME        "Build with library install_name set to the installation path" OFF
HDFJAVA_PACK_MACOSX_BUNDLE         "Create a Mac OSX Application Bundle"                          OFF
      
---------------- HDF-JAVA Native Options ---------------------
HDF_DISABLE_COMPILER_WARNINGS      "Disable compiler warnings"                                    OFF

---------------- HDF-JAVA Advanced Options ---------------------
HDF_NO_PACKAGES                "Do not include CPack Packaging"                           OFF
HDF_PACKAGE_EXTLIBS            "CPACK - include external libraries"                       OFF
HDF_USE_FOLDERS                "Enable folder grouping of projects in IDEs."              OFF
HDF_ENABLE_COVERAGE            "Enable code coverage for Libraries and Programs"          OFF
HDFJAVA_PACK_SAMPLES           "Package the HDFJAVA File Samples"                         OFF
HDFJAVA_PACK_JRE               "Package a JRE installer file"                             OFF

---------------- External Library Options ---------------------
HDF_ALLOW_EXTERNAL_SUPPORT      "Allow External Library Building"                         "NO"
HDF4_USE_EXTERNAL               "Use External Library Building for HDF4"                  0
HDF5_USE_EXTERNAL               "Use External Library Building for HDF5"                  0



========================================================================
VII. User Defined Options for HDF-JAVA Libraries with CMake
========================================================================

Support for User Defined macros and options has been added. The file
UserMacros.cmake has an example of the technique. In the folder,
config/cmake/UserMacros, is an implementation for Windows Visual Studio
users for linking libraries to the static CRT - Windows_MT.cmake. 

Copy the contents of the file, both macro and option, into the 
UserMacros.cmake file. Then enable the option to the CMake configuration,
build and test process.

========================================================================
VIII. Options for Platform Configuration Files
========================================================================

Below is the HDFJAVALinuxCmake.cmake ctest script with extra comments.
The example is for a linux machine, but the same scripts can be used on 
a Windows machine by adjusting the CTEST_CMAKE_GENERATOR option in the
platform configuration script.


############################################################################
# Product specific script, HDFJAVALinuxCmake.cmake, that uses the 
# CTestScript.cmake file. Usage:
# "ctest -S HDFJAVALinuxCmake.cmake -C Release -O hdfjavastatic.log"
############################################################################
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)

# this is the location of the source hardcoded to hdf-java
set(CTEST_SOURCE_NAME hdf-java)
# this is the location of the source with ctest parameter hdf5src
# "ctest -S HDFJAVALinuxCmake.cmake -C Release -O hdfjavastatic.log"
set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG})

# this is the location of the build directory
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)

# this is the directory the script is executed from
set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")

# this is the full path of the source directory
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")

# this is the  full path of the build directory
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")


###################################################################
### Following Line is one of [Release, RelWithDebInfo, Debug] #####
set(CTEST_BUILD_CONFIGURATION "Release")
###################################################################

###################################################################
#########       Following describes compiler           ############
# this is for linux
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
# this is for windows 32 bit
#set(CTEST_CMAKE_GENERATOR "Visual Studio 11")
# this is for windows 64 bit
#set(CTEST_CMAKE_GENERATOR "Visual Studio 11 Win64")
# Visual Studio 2013 is 12, Visual Studio 2012 is 11,  Visual Studio 2010 is 10
###################################################################

###################################################################
#########       Following is for submission to CDash   ############
###################################################################
set(MODEL "Experimental")
#########       Following describes computer           ############
##  Set the following to unique id your computer  ##
set(CTEST_SITE "LINUX.XXXX")
##    following is optional to describe build     ##
set(SITE_BUILDNAME_SUFFIX "STATIC")

#########   Following controls CDash submission          ##########
#set(LOCAL_SUBMIT "TRUE")
#########   Following controls test process              ##########
#set(LOCAL_SKIP_TEST "TRUE")
#set(LOCAL_MEMCHECK_TEST "TRUE")
#set(LOCAL_COVERAGE_TEST "TRUE")
#########   Following controls cpack command             ##########
#set(LOCAL_NO_PACKAGE "TRUE")
#########   Following controls source update             ##########
#set(LOCAL_UPDATE "TRUE")
#########   Following controls source repository         ##########
# current HDF Group svn url
#set(hdfgroup_url "hdfgroup.uiuc.edu")
#set(REPOSITORY_URL "http://svn.${hdfgroup_url}/hdf-java/branches/hdf-java-2.11")
#comment to use a uncompressed source folder
set(CTEST_USE_TAR_SOURCE "hdf-java-2.11")
###################################################################

###################################################################
####  Change default configuration of options in config/cmake/cacheinit.cmake file ###
####  format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ")

### uncomment/comment and change the following lines for configuration options

### comment the following line to build shared libraries
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")

####      ext libraries       ####
### ext libs from tgz
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}")
### ext libs from svn
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ALLOW_EXTERNAL_SUPPORT:STRING=SVN")
### ext libs on system
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=${some_location}/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=${some_location}/include")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=${some_location}/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=${some_location}/include")

### Create install package with external libraries (szip, zlib)
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_PACKAGE_EXTLIBS:BOOL=ON")

### disable test program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF")

### disable packaging
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_NO_PACKAGES:BOOL=ON")

### disable building examples
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_EXAMPLES:BOOL=OFF")

### disable building tests
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF")

### GUI test control, comment the following line to run the GUT tests
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_SKIP_GUI_TESTS:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_SKIP_GUI_TESTS:BOOL=OFF")

### change install prefix
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=install")
###################################################################

include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)


========================================================================
For further assistance, send email to help@hdfgroup.org
========================================================================