mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
fixed typos in CMake build documentation
This commit is contained in:
parent
e7fee3ee53
commit
0ce3d98dc4
@ -1866,8 +1866,8 @@ checking be used for all netCDF function calls.
|
||||
----------
|
||||
|
||||
|
||||
CMake {#cmake_faq}
|
||||
==============================================
|
||||
CMake-Related Frequently Asked Questions {#cmake_faq}
|
||||
========================================
|
||||
|
||||
Below are a list of commonly-asked questions regarding NetCDF and CMake.
|
||||
|
||||
|
@ -1,69 +0,0 @@
|
||||
CMake-Related Frequently-Asked-Questions (FAQ) {#cmake_faq}
|
||||
==============================================
|
||||
|
||||
Below are a list of commonly-asked questions regarding NetCDF and CMake.
|
||||
|
||||
## How can I see the options available to CMake? {#listoptions}
|
||||
|
||||
$ cmake [path to source tree] -L - This will show the basic options.
|
||||
$ cmake [path to source tree] -LA - This will show the basic and advanced options.
|
||||
|
||||
|
||||
## How do I specify how to build a shared or static library? {#sharedstatic}
|
||||
|
||||
This is controlled with the internal `cmake` option, `BUILD_SHARED_LIBS`.
|
||||
|
||||
$ cmake [Source Directory] -DBUILD_SHARED_LIBS=[ON/OFF]
|
||||
|
||||
|
||||
## Can I build both shared and static libraries at the same time with cmake? {#sharedstaticboth}
|
||||
|
||||
Not at this time; it is required to instead build first one version, and then the other, if you need both.
|
||||
|
||||
## What if I want to link against multiple libraries in a non-standard location? {#nonstdloc}
|
||||
|
||||
You can specify the path to search when looking for dependencies and header files using the `CMAKE_PREFIX_PATH` variable:
|
||||
|
||||
* Windows:
|
||||
|
||||
$ cmake [Source Directory] -DCMAKE_PREFIX_PATH=c:\shared\libs\
|
||||
|
||||
|
||||
* Linux/Unix/OSX:
|
||||
|
||||
$ cmake [Source Directory] -DCMAKE_PREFIX_PATH=/usr/custom_library_locations/
|
||||
|
||||
|
||||
## How can I specify linking against a particular library? {#partlib}
|
||||
|
||||
It depends on the library. To specify a custom `ZLib`, for example, you would do the following:
|
||||
|
||||
$ cmake [Source Directory] -DZLIB_LIBRARY=/path/to/my/zlib.lib
|
||||
|
||||
|
||||
`HDF5` is more complex, since it requires both the `hdf5` and `hdf5_hl` libraries. You would specify custom `HDF5` libraries as follows:
|
||||
|
||||
$ cmake [Source Directory] -DHDF5_LIB=/path/to/hdf5.lib \
|
||||
-DHDF5_HL_LIB=/path/to/hdf5_hl.lib \
|
||||
-DHDF5_INCLUDE_DIR=/path/to/hdf5/include
|
||||
|
||||
|
||||
Alternatively, you may specify:
|
||||
|
||||
$ cmake [Source Directory] \
|
||||
-DHDF5_LIBRARIES="/path/to/hdf5.lib;/path/to/hdf5_hl.lib" \
|
||||
-DHDF5_INCLUDE_DIR=/path/to/hdf5/include/
|
||||
|
||||
|
||||
## How can I specify a Parallel Build using HDF5 {#parallelhdf}
|
||||
|
||||
If cmake is having problems finding the parallel `HDF5` install, you can specify the location manually:
|
||||
|
||||
|
||||
$ cmake [Source Directory] -DENABLE_PARALLEL=ON \
|
||||
-DHDF5_LIB=/usr/lib64/openmpi/lib/libhdf5.so \
|
||||
-DHDF5_HL_LIB=/usr/lib64/openmpi/lib/libhdf5.hl.so \
|
||||
-DHDF5_INCLUDE_DIR=/usr/include/openmpi-x86_64 \
|
||||
|
||||
|
||||
You will, of course, need to use the location of the libraries specific to your development environment.
|
@ -407,13 +407,13 @@ The output of the configuration step is a project file based on the appropriate
|
||||
|
||||
| **Option** | **Autotools** | **CMake** |
|
||||
| :------- | :---- | :----- |
|
||||
Specify Install Location | --prefix=PREFIX | -D"CMAKE\_INSTALL\_PREFIX=PREFIX"
|
||||
Enable/Disable netCDF-4 | --enable-netcdf-4<br>--disable-netcdf-4 | -D"ENABLE\_NETCDF\_4=ON" <br> -D"ENABLE\_NETCDF\_4=OFF"
|
||||
Enable/Disable DAP | --enable-dap <br> --disable-dap | -D"ENABLE\_DAP=ON" <br> -D"ENABLE\_DAP=OFF"
|
||||
Enable/Disable Utilities | --enable-utilities <br> --disable-utilities | -D"BUILD\_UTILITIES=ON" <br> -D"BUILD\_UTILITIES=OFF"
|
||||
Specify shared/Static Libraries | --enable-shared <br> --enable-static | -D"BUILD\_SHARED\_LIBS=ON" <br> -D"BUILD\_SHARED\_LIBS=OFF"
|
||||
Enable/Disable Tests | --enable-testsets <br> --disable-testsets | -D"ENABLE\_TESTS=ON" <br> -D"ENABLE\_TESTS=OFF"
|
||||
Specify a custom library location | Use *CFLAGS* and *LDFLAGS* | -D"CMAKE\_PREFIX\_PATH=/usr/custom_libs/"
|
||||
Specify Install Location | --prefix=PREFIX | -D"CMAKE_INSTALL_PREFIX=PREFIX"
|
||||
Enable/Disable netCDF-4 | --enable-netcdf-4<br>--disable-netcdf-4 | -D"ENABLE_NETCDF_4=ON" <br> -D"ENABLE_NETCDF_4=OFF"
|
||||
Enable/Disable DAP | --enable-dap <br> --disable-dap | -D"ENABLE_DAP=ON" <br> -D"ENABLE_DAP=OFF"
|
||||
Enable/Disable Utilities | --enable-utilities <br> --disable-utilities | -D"BUILD_UTILITIES=ON" <br> -D"BUILD_UTILITIES=OFF"
|
||||
Specify shared/Static Libraries | --enable-shared <br> --enable-static | -D"BUILD_SHARED_LIBS=ON" <br> -D"BUILD_SHARED_LIBS=OFF"
|
||||
Enable/Disable Tests | --enable-testsets <br> --disable-testsets | -D"ENABLE_TESTS=ON" <br> -D"ENABLE_TESTS=OFF"
|
||||
Specify a custom library location | Use *CFLAGS* and *LDFLAGS* | -D"CMAKE_PREFIX_PATH=/usr/custom_libs/"
|
||||
|
||||
A full list of *basic* options can be found by invoking `cmake [Source Directory] -L`. To enable a list of *basic* and *advanced* options, one would invoke `cmake [Source Directory] -LA`.
|
||||
|
||||
@ -463,4 +463,5 @@ or
|
||||
|
||||
## See Also {#cmake_see_also}
|
||||
|
||||
For further information regarding netCDF and CMake, see \ref cmake_faq
|
||||
For further information regarding netCDF and CMake, see \ref cmake_faq.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user