mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] find_package() and Shared Builds in CMake


From: Nathan Osman
Subject: [Mingw-cross-env-list] find_package() and Shared Builds in CMake
Date: Fri, 17 Jul 2015 17:25:47 -0700

I'm putting together an .mk file for a Qt library that uses CMake. I was able to fill in most of the $(PKG)_* variables without any issues. In particular, the library's only dependencies are gcc and qtbase.

However, I ran into some issues with $(PKG)_BUILD. The library uses "find_package(Qt5Network)" which causes the following error message:

Could not find a package configuration file provided by "Qt5Network"...

I was able to work around this by using the following line to invoke CMake:

cmake .. \
        -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
        -DCMAKE_PREFIX_PATH='$(PREFIX)/$(TARGET)/qt5/lib/cmake'

Is this the correct way of solving the issue?

The second issue deals with building a shared version of the library. By default, the CMake script builds a shared library but it can be configured to build a static library by using "-DBUILD_STATIC=ON". Should this be enabled in the $(PKG)_BUILD variable? How would I disable this for a shared library?

- Nathan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]