Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: create and install pkg-config files #2224

Merged
merged 2 commits into from
Jun 12, 2018

Conversation

yegorich
Copy link

Automatically create and install *.pc files for selected components.

PocoFoundation.pc
PocoNet.pc
PocoUtil.pc
etc.

@yegorich
Copy link
Author

yegorich commented Mar 15, 2018

This is just an RFC to agree on *.pc file names, what should go into Requires field etc.

Fixes #2037

@zosrothko
Copy link
Member

That's ok for me. The only point is that on Windows, cmake should install the Poco binaries (lib, dll, pdb & includes) at the same place as the MSI installer.

@aleks-f
Copy link
Member

aleks-f commented Mar 16, 2018

@zosrothko is MSI documented somewhere?

@zosrothko
Copy link
Member

@aleks-f No, that's missing. the directory structure has 2 majors subdivisions: the VS version and the Poco version like for the x86 architecture

C:\Program Files (x86)
          | Poco
                   | VS2017
                            | 1.8.1
                                   | bin
                                   | doc
                                   | inc
                                   | lib

and for the x64 architecture

C:\Program Files
          | Poco
                   | VS2017
                            | 1.8.1
                                   | bin
                                   | doc
                                   | inc
                                   | lib

This could be changed if needed

@yegorich
Copy link
Author

So far I have created following *.pc.in files:

PocoCppUnit.pc.in
PocoCrypto.pc.in
PocoEncodings.pc.in
PocoFoundation.pc.in
PocoJSON.pc.in
PocoMongoDB.pc.in
PocoNet.pc.in
PocoNetSSL.pc.in
PocoPDF.pc.in
PocoRedis.pc.in
PocoSevenZip.pc.in
PocoSQL.pc.in
PocoUtil.pc.in
PocoXML.pc.in
PocoZip.pc.in

Following components are missing:

SQLite, ODBC and Co
CppParser
PocoDoc
PageCompiler
File2Page

so basically all components should have own *.pc.in file? Or some of them don't make sense?

What about NetSSL? Is it sufficient to have PocoNetSSL or should I also add PocoNetSSL_Win (I'm working with Linux only)?

As for Database libs, they won't be handled in the main CMakeLists.txt. Should I place related commands in their own CMakeLists.txt files?

Copy link
Contributor

@Bjoe Bjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions...

@Bjoe
Copy link
Contributor

Bjoe commented Mar 21, 2018

@yegorich You created following *.pc.in files ... but I see only two files on the pull request :-)

@yegorich
Copy link
Author

yegorich commented Mar 21, 2018

@Bjoe I haven't pushed v2, so you don't see the new *.pc.in files. I just wanted to get the answers to my questions prior to pushing v2.

@Bjoe
Copy link
Contributor

Bjoe commented Mar 21, 2018

I just wanted to get the answers to my questions

@yegorich ok.
For PocoNetSSL_Win ... I don't know if this make sense. I think on windows pkg-config is not really used there or?

As for Database libs, they won't be handled in the main CMakeLists.txt. Should I place related commands in their own CMakeLists.txt files?

Hm sorry I didn't get you...

@zosrothko
Copy link
Member

zosrothko commented Mar 21, 2018

@Bjoe I think on windows pkg-config is not really used ==>correct, but it could be used for the Cygwin platform which is a subsystem running on top of Windows

@yegorich
Copy link
Author

yegorich commented Mar 21, 2018

@zosrothko as for Windows, should I install *.pc files to the same directory as cmake files? I.e. pkgconfig?

if (WIN32)
  set(PocoConfigPackageLocation "cmake")
else()
  set(PocoConfigPackageLocation "lib/cmake/${PROJECT_NAME}")
endif()

configure_file(cmake/${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" @ONLY)
install(
    FILES
        ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake
        ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake
    DESTINATION
        "${PocoConfigPackageLocation}"
    COMPONENT
        Devel
)

@Bjoe
Copy link
Contributor

Bjoe commented Mar 25, 2018

@yegorich Cygwin is like a "Linux shell environment in Windows" I think, install the *.pc like under Linux/Unix...

@yegorich
Copy link
Author

I've pushed v2. Now with SQLite, MySQL and PostgreSQL *.pc files.

yegorich and others added 2 commits June 10, 2018 02:08
Automatically create and install *.pc files for selected components.

PocoFoundation.pc
PocoNet.pc
PocoUtil.pc
etc.
@Bjoe
Copy link
Contributor

Bjoe commented Jun 10, 2018

I rebased your branch to the develop HEAD from friday and fixed the merge conflicts. When all is fine I will merge your branch in the next days. Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants