Skip to content

Commit

Permalink
Include libenet.pc in installation
Browse files Browse the repository at this point in the history
- Add missing project version
- Fix missing shared library symlinks
  • Loading branch information
h3xx committed Dec 4, 2023
1 parent 853742e commit 6173e03
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.8.12...3.20)

project(enet)
# I.e. The ABI version
project(enet VERSION 7.0.5)
set(ENET_VERSION "1.3.17")

# The "configure" step.
include(CheckFunctionExists)
Expand Down Expand Up @@ -89,6 +91,10 @@ add_library(enet
${INCLUDE_FILES}
${SOURCE_FILES}
)
set_target_properties(enet PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION}
)

if (MINGW)
target_link_libraries(enet winmm ws2_32)
Expand All @@ -101,3 +107,13 @@ install(TARGETS enet

install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# Add variables for substitution in libenet.pc.in
set(PACKAGE_VERSION ${ENET_VERSION})
set(PACKAGE_NAME "lib${PROJECT_NAME}")
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
configure_file(libenet.pc.in libenet.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libenet.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

0 comments on commit 6173e03

Please sign in to comment.