Project

General

Profile

Bug #785

It should be possible to override the library paths and names of the external libraries when using CMake on Windows

Added by Marco Eichelberg 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Configuration
Target version:
-
Start date:
2017-07-25
Due date:
% Done:

0%

Module:
Operating System:
Compiler:

Description

Dan Hosseinzadeh writes:

Presently, there a number of assumptions in the CMake scripts regarding the filename convention of libraries and location of include directories for 3rd party packages. For instance, the /libxml /support specifies the following (see "3rdparty.cmake"):

    SET(LIBXML_LIBS debug ${LIBXML_LIBDIR}/libxml2_d.lib optimized ${LIBXML_LIBDIR}/libxml2_o.lib debug ${LIBXML_LIBDIR}/iconv_d.lib optimized
    ${LIBXML_LIBDIR}/iconv_o.lib)

    SET(LIBXML_INCDIR ${WITH_LIBXMLINC}/include)

These assumptions will not work in many cases and as such it would be more portable to rely on user provided variables like LIBXML_LIBRARIES and LIBXML_INCLUDE_DIRS. Something like this:

    SET(LIBXML_LIBS ${LIBXML_LIBRARIES})

    SET(LIBXML_INCDIR ${LIBXML_INCLUDE_DIRS})

This method is more flexible and the typical pattern used by CMake's FIND_PACKAGE methods. This applies to all of the 3rd party dependencies.

The hard-coded library names and paths are adjusted to the external libraries as compiled in the nightly build and offered for download.
However, it should be possible to override these defaults by user-specific values, without modifying the CMake build files, which is currently not the case.

Also available in: Atom PDF