Code Monkey home page Code Monkey logo

Comments (7)

akien-mga avatar akien-mga commented on June 11, 2024

+1

from fuzzylite.

jcrada avatar jcrada commented on June 11, 2024

Any suggestions on how can I create a .pc file?

from fuzzylite.

akien-mga avatar akien-mga commented on June 11, 2024

See http://people.freedesktop.org/~dbn/pkg-config-guide.html
A minimal working example could look like that:

prefix=/usr/local
exec_prefix=${prefix}
includedir=${exec_prefix}/include
libdir=${exec_prefix}/lib

Name: fuzzylite
Description: A fuzzy logic control library in C++
Version: 5.0
Libs: -L${libdir} -lfuzzylite
Cflags: -I${includedir}/fl

Typically the prefix, includedir and libdir have to be set dynamically to respect the paths chosen by the user.
You can do that with cmake, using a pre-formatted fuzzylite.pc.in file that you can configure during the cmake call to create a fuzzylite.pc file based on e.g. CMAKE_INSTALL_PREFIX, CMAKE_INSTALL_LIBDIR, etc.

from fuzzylite.

akien-mga avatar akien-mga commented on June 11, 2024

Thanks! :-)

Could you also replace ${exec_prefix}/lib by @CMAKE_INSTALL_LIBDIR@ ?
Here on Mageia (and on most RPM-based distros) the 64bit libraries are placed in /usr/lib64

from fuzzylite.

josch avatar josch commented on June 11, 2024

Same in Debian. Nothing is ever installed into /usr/local/. Instead, libraries are installed into multiarch paths like in case of fuzzylite /usr/lib/x86_64-linux-gnu/libfuzzylite.so.5.0 for the shared library and /usr/include/fl/fuzzylite.h for the development headers. Since the shared library is in a different path depending on the architecture the package is built for, this has to be made dynamic depending on @CMAKE_INSTALL_LIBDIR@.

from fuzzylite.

jcrada avatar jcrada commented on June 11, 2024

Done. Thank you for your help!

from fuzzylite.

josch avatar josch commented on June 11, 2024

Could you also make the instllation path of fuzzylite.pc configurable? In Debian, the libdir will have an architecture specific value, so fuzzylite.pc differs between architectures and thus has to be installed in an architecture specifc path. The following fixes this:

--- a/fuzzylite/CMakeLists.txt
+++ b/fuzzylite/CMakeLists.txt
@@ -183,7 +183,7 @@ install(DIRECTORY fl/ DESTINATION includ

 #pkg-config
 configure_file(${CMAKE_SOURCE_DIR}/fuzzylite.pc.in ${CMAKE_BINARY_DIR}/fuzzylite.pc @ONLY)
-install(FILES ${CMAKE_BINARY_DIR}/fuzzylite.pc DESTINATION lib/pkgconfig)
+install(FILES ${CMAKE_BINARY_DIR}/fuzzylite.pc DESTINATION ${FL_INSTALL_LIBDIR}/pkgconfig)

 message("=====================================")
 message("fuzzylite v.${FL_VERSION}b${FL_DATE}\n")

Thanks!

from fuzzylite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.