diff --git a/CMakeLists.txt b/CMakeLists.txt index ce62c5714..16d69cf18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,6 @@ cmake_policy(SET CMP0048 NEW) set_property(GLOBAL PROPERTY USE_FOLDERS ON) -project(lib3mf) - - include(GNUInstallDirs) # Define Version @@ -16,6 +13,10 @@ set(LIB3MF_VERSION_MINOR 1) # increase on every backward compatible chang set(LIB3MF_VERSION_MICRO 0) # increase on on every change that does not alter the API set(LIB3MF_VERSION_PRERELEASE "beta") # denotes pre-release information of a version of lib3mf +project(lib3mf + VERSION ${LIB3MF_VERSION_MAJOR}.${LIB3MF_VERSION_MINOR}.${LIB3MF_VERSION_MICRO} + DESCRIPTION "An implementation of the 3D Manufacturing Format file standard") + set(CMAKE_INSTALL_BINDIR bin CACHE PATH "directory for installing binary files") set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "directory for installing library files") set(CMAKE_INSTALL_INCLUDEDIR include/lib3mf CACHE PATH "directory for installing header files") @@ -190,6 +191,8 @@ else() target_compile_options(${PROJECT_NAME} PUBLIC "$<$:/O2;/sdl;/WX;/Oi;/Gy;/FC;/wd4996>") endif() +configure_file(lib3mf.pc.in lib3mf.pc @ONLY) +install(FILES ${CMAKE_BINARY_DIR}/lib3mf.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" diff --git a/lib3mf.pc.in b/lib3mf.pc.in new file mode 100644 index 000000000..bb8030abf --- /dev/null +++ b/lib3mf.pc.in @@ -0,0 +1,12 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +Name: @PROJECT_NAME@ +Description: @PROJECT_DESCRIPTION@ +Version: @PROJECT_VERSION@ + +Requires: +Libs: -L${libdir} -l3mf -lzip -lz +Cflags: -I${includedir}