OSGeo / libgeotiff

Official repository of the libgeotiff project
180 stars 69 forks source link

doc directory may be incorrectly installed in CMAKE_INSTALL_PREFIX #33

Closed KBentley57 closed 2 years ago

KBentley57 commented 4 years ago

In line 287-290 of the top level CMakeLists.txt, the install command for the documents directory is hard-coded to the relative path "doc".

# Install doc files
INSTALL(FILES
    AUTHORS ChangeLog COPYING INSTALL LICENSE README README_BIN README.WIN
    DESTINATION doc)
#    DESTINATION ${GEOTIFF_DATA_DIR}/doc)

If a user (like myself) is building libgeotiff by itself via the ExternalPackage_Add command, and only building libgeotiff, this has the effect of installing "doc" in the directory defined by CMAKE_INSTALL_PREFIX, instead of CMAKE_INSTALL_PREFIX/share. I believe this is caused byt the SOURCE_SUBDIR line being necessary to let CMake know where to look for the CMakeLists.txt file.

It looks like this was supported at one time, but now it's commented out. Was that a mistake/typo? In any case, it would seem like a good idea to have the installation directory modifiable by the user.

For reference: This is the command used for building libgeotiff.so from the tarball. (My md5 is different from the release due to the xz repackaging.)

ExternalProject_Add(geotiff
    URL  ${CMAKE_CURRENT_SOURCE_DIR}/libgeotiff-1.5.1.tar.xz
    URL_MD5 bfd2bd41c36c78fcbf0fbe2eddf34bb4
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libgeotiff
--->    SOURCE_SUBDIR libgeotiff
    INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
    CMAKE_ARGS -DCMAKE_PREFIX_PATH=<INSTALL_DIR>
        -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
        -DCMAKE_INSTALL_LIBDIR=<INSTALL_DIR>/lib                   
            -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}                
        -DBUILD_PROJ=TRUE
        -DPROJ_TESTS=OFF
        -DENABLE_LTO=ON
        -DWITH_JPEG=TRUE              
    LOG_CONFIGURE 1
    LOG_BUILD 1
    LOG_INSTALL 1
)
rouault commented 4 years ago

If you can provide a pull request, that'd be welcome

KBentley57 commented 4 years ago

Even,

I should have some free time a little later this week. I'll see what I can do.

Thanks,

Kyle

On 3/25/20, Even Rouault notifications@github.com wrote:

If you can provide a pull request, that'd be welcome

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/OSGeo/libgeotiff/issues/33#issuecomment-603981702