Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Failure to build as a subdirectory #5

@william-swy

Description

@william-swy

Hi. One of my projects needed to use the ALGLIB library and it seems that their website did not have CMake support. This repo seems to do most of the work with downloading the tar and building it. Only issue is that when when this thing is built as a subdirectory, the script from the CMakeLists.txt fails to configure at

configure_package_config_file(${CMAKE_SOURCE_DIR}/cmake/ALGLIB-config.cmake.in
                              ${CMAKE_BINARY_DIR}/alglib-config.cmake
                              INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ALGLIB)

I'm quite sure the CMAKE_SOURCE_DIR should be CMAKE_CURRENT_SOURCE_DIR and likewise for the binary directory because otherwise it is using the value set by the parent project which messes up the configuration process (at least after making these changes the configuration spewed no errors).

Also when I was debugging the build script I did notice that on line 23 the comment output paths is misspelt as ouptut paths.

Another edit I have a feeling that the output paths should be this instead

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions