Search code examples
makefilecmakeinstallationconfigurelog4cplus

How to specify ./configure's parameters '--includedir' and '--libdir' to cmake


Question about installing log4cplus.

log4cplus has two way to make & install.

  1. ./configure && make && make install

  2. cmake xxx && make && make install

When I use the 1st one, parameters --includedir=PATH and --libdir=PATH can be specified to configure, because I want to install them into different paths.

How can I specify the two equivalent parameters to cmake?

Thanks!


Solution

  • Since package log4cplus uses CMake module GNUInstallDirs, you may use variables CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR for adjust installation paths for libraries and headers correspondingly:

    cmake -DCMAKE_INSTALL_LIBDIR=<libdir-path> -DCMAKE_INSTALL_INCLUDEDIR=<includedir-path>
    

    For more info see that question.