Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to make a Qt library correctly for find_package
Qt 6.11 is out! See what's new in the release blog

How to make a Qt library correctly for find_package

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 661 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Navadvipa Chandra das
    wrote on last edited by
    #1

    Hello, All!

    I made the NNPrabhupada library in QtCreator. He created me CMakeLists.txt I edited it to suit my needs. When compiling, I successfully get in the directory:

    D:\CopperSpicePrg\NNPrabhupada\build\Desktop-Debug

    NNPrabhupada.dll
    NNPrabhupada.exp
    NNPrabhupada.ilk
    NNPrabhupada.lib
    NNPrabhupada.pdb

    and also a bunch of other directories and files.

    But now the command (if you add it to the assembly):

    ninja -v install
    

    does not work.

    Then I made a second library, NNPrabhupadaDB.
    I want to register in the file CMakeLists.txt the command

    find_package( NNPrabhupada REQUIRED )
    

    But it doesn't work.

    And the link ends in failure.

    NNPrabhupada:
    https://github.com/Navadvipa-Chandra-das/NNPrabhupada

    NNPrabhupadaDB:
    https://github.com/Navadvipa-Chandra-das/NNPrabhupadaDB

    It should be noted here that the source texts of these libraries are stored elsewhere, namely in my fork of CopperSpice.:

    https://github.com/Navadvipa-Chandra-das/copperspice

    In the files CMakeLists.txt I'm defining a special variable.

    set( CopperSpiceSrc_DIR ../../CopperSpice/Source/src )
    

    and there are no problems.

    Please help me make the correct files. CMakeLists.txt for the NNPrabhupada and NNPrabhupadaDB libraries

    With regards, Navadvipa Chandra das.

    Pl45m4P 1 Reply Last reply
    0
    • N Navadvipa Chandra das

      Hello, All!

      I made the NNPrabhupada library in QtCreator. He created me CMakeLists.txt I edited it to suit my needs. When compiling, I successfully get in the directory:

      D:\CopperSpicePrg\NNPrabhupada\build\Desktop-Debug

      NNPrabhupada.dll
      NNPrabhupada.exp
      NNPrabhupada.ilk
      NNPrabhupada.lib
      NNPrabhupada.pdb

      and also a bunch of other directories and files.

      But now the command (if you add it to the assembly):

      ninja -v install
      

      does not work.

      Then I made a second library, NNPrabhupadaDB.
      I want to register in the file CMakeLists.txt the command

      find_package( NNPrabhupada REQUIRED )
      

      But it doesn't work.

      And the link ends in failure.

      NNPrabhupada:
      https://github.com/Navadvipa-Chandra-das/NNPrabhupada

      NNPrabhupadaDB:
      https://github.com/Navadvipa-Chandra-das/NNPrabhupadaDB

      It should be noted here that the source texts of these libraries are stored elsewhere, namely in my fork of CopperSpice.:

      https://github.com/Navadvipa-Chandra-das/copperspice

      In the files CMakeLists.txt I'm defining a special variable.

      set( CopperSpiceSrc_DIR ../../CopperSpice/Source/src )
      

      and there are no problems.

      Please help me make the correct files. CMakeLists.txt for the NNPrabhupada and NNPrabhupadaDB libraries

      With regards, Navadvipa Chandra das.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @Navadvipa-Chandra-das said in How to make a Qt library correctly for find_package:

      I want to register in the file CMakeLists.txt the command

      find_package( NNPrabhupada REQUIRED )
      

      But it doesn't work.

      This is not a Qt question. It's solely CMake related.

      Either you make a sub-project / target, so you can use the "app" and the "library" both under the same CMake project
      or
      you need to create a CMake package from your library.

      In this regard, see the CMake documentation on how to configure packages


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved