diff options
| -rw-r--r-- | CMakeLists.txt | 6 | ||||
| -rw-r--r-- | Makefile | 8 | ||||
| -rw-r--r-- | slweb.pc | 11 |
3 files changed, 24 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bbe1afc..4d7646f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,12 @@ target_include_directories(${PROJECT_NAME} PUBLIC include) target_link_libraries(${PROJECT_NAME} PUBLIC dynstr) install(TARGETS ${PROJECT_NAME}) install(DIRECTORY include/slweb TYPE INCLUDE) +file(READ ${CMAKE_CURRENT_LIST_DIR}/slweb.pc slweb_pc) +string(REPLACE /usr/local ${CMAKE_INSTALL_PREFIX} slweb_repl_pc ${slweb_pc}) +file(WRITE ${CMAKE_BINARY_DIR}/slweb.pc ${slweb_repl_pc}) +include(GNUInstallDirs) +install(FILES ${CMAKE_BINARY_DIR}/slweb.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) if(BUILD_EXAMPLES) add_subdirectory(examples) @@ -3,6 +3,7 @@ PROJECT = libslweb.a PREFIX = /usr/local DST = $(PREFIX)/lib +PC_DST = $(DST)/pkgconfig O = -Og CDEFS = -D_FILE_OFFSET_BITS=64 # Required for large file support on 32-bit. CFLAGS = $(O) $(CDEFS) -g -Iinclude -Idynstr/include -MD -MF $(@:.o=.d) @@ -16,7 +17,7 @@ OBJECTS = \ all: $(PROJECT) -install: all +install: all $(PC_DST)/slweb.pc mkdir -p $(PREFIX)/include cp -R include/slweb $(PREFIX)/include chmod 0644 $(PREFIX)/include/slweb/*.h @@ -36,4 +37,9 @@ examples: FORCE $(PROJECT): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) +$(PC_DST)/slweb.pc: slweb.pc + mkdir -p $(PC_DST) + sed -e 's,/usr/local,$(PREFIX),' $< > $@ + chmod 0644 $@ + -include $(DEPS) diff --git a/slweb.pc b/slweb.pc new file mode 100644 index 0000000..3d79911 --- /dev/null +++ b/slweb.pc @@ -0,0 +1,11 @@ +prefix=/usr/local +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${exec_prefix}/lib + +Name: slweb +Url: https://gitea.privatedns.org/xavi/slweb +Description: A simple and lightweight web framework +Version: 0.1.0 +Cflags: -I${includedir} +Libs: -L${libdir} -lslweb |
