How to make a Qt library correctly for find_package
-
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.pdband also a bunch of other directories and files.
But now the command (if you add it to the assembly):
ninja -v installdoes not work.
Then I made a second library, NNPrabhupadaDB.
I want to register in the file CMakeLists.txt the commandfind_package( NNPrabhupada REQUIRED )But it doesn't work.
And the link ends in failure.
NNPrabhupada:
https://github.com/Navadvipa-Chandra-das/NNPrabhupadaNNPrabhupadaDB:
https://github.com/Navadvipa-Chandra-das/NNPrabhupadaDBIt 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.
-
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.pdband also a bunch of other directories and files.
But now the command (if you add it to the assembly):
ninja -v installdoes not work.
Then I made a second library, NNPrabhupadaDB.
I want to register in the file CMakeLists.txt the commandfind_package( NNPrabhupada REQUIRED )But it doesn't work.
And the link ends in failure.
NNPrabhupada:
https://github.com/Navadvipa-Chandra-das/NNPrabhupadaNNPrabhupadaDB:
https://github.com/Navadvipa-Chandra-das/NNPrabhupadaDBIt 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.
@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