Skip to content

Commit 8453a67

Browse files
committed
Added CPack config for deb and rpm, Linux build fixes and gmp Cmake find fix.
1 parent 2f8817b commit 8453a67

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

CMake/Modules/FindGMP.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ set(GMP_FIND_QUIETLY TRUE)
88
endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
99

1010
find_path(GMP_INCLUDE_DIR NAMES gmp.h PATHS ${CMAKE_SOURCE_DIR}/depends/include)
11-
find_library(GMP_LIBRARIES NAMES gmp libgmp PATHS ${CMAKE_SOURCE_DIR}/depends/lib )
11+
find_library(GMP_LIBRARIES NAMES gmp libgmp libgmp.so.10 PATHS ${CMAKE_SOURCE_DIR}/depends/lib )
1212

1313
MESSAGE(STATUS "GMP libs: " ${GMP_LIBRARIES} " " ${GMPXX_LIBRARIES} )
1414
include(FindPackageHandleStandardArgs)
1515
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES)
16-
mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES)
16+
mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES)

CMakeLists.txt

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,36 @@ if (WIN32)
6868
target_link_libraries(${PROJECT_NAME} Version.lib)
6969
endif()
7070

71+
SET(VERSION_MAJOR "1")
72+
SET(VERSION_MINOR "3")
73+
SET(VERSION_PATCH "2")
74+
7175
install(TARGETS bncsutil RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
72-
install(FILES src/bncsutil/bncsutil.h DESTINATION include)
76+
install(FILES src/bncsutil/bncsutil.h DESTINATION include/bncsutil)
77+
78+
#CPack configurtion
79+
SET(CPACK_GENERATOR "DEB" "RPM")
80+
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
81+
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Battle.Net Chat Service Utility")
82+
SET(CPACK_PACKAGE_VENDOR "bncsutil")
83+
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
84+
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
85+
SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
86+
SET(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
87+
SET(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
88+
89+
#DEB configuration
90+
SET(CPACK_DEBIAN_PACKAGE_SECTION "libs")
91+
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/BNETDocs/bncsutil")
92+
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "imbacen@gmail.com")
93+
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
94+
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libgmp10")
95+
96+
#RPM configuration
97+
SET(CPACK_RPM_PACKAGE_RELEASE 1)
98+
SET(CPACK_RPM_PACKAGE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
99+
SET(CPACK_RPM_PACKAGE_GROUP "${PROJECT_NAME}")
100+
SET(CPACK_RPM_PACKAGE_URL "https://github.com/BNETDocs/bncsutil")
101+
SET(CPACK_RPM_PACKAGE_REQUIRES "gmp")
102+
103+
INCLUDE(CPack)

src/bncsutil/debug.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
#include <bncsutil/debug.h>
1010
#include <string.h>
1111
#include <stdlib.h>
12+
#include <stdio.h>
1213
#include <ctype.h>
14+
#include <errno.h>
1315
#include <stdarg.h>
1416
#include "mutil.h"
1517

0 commit comments

Comments
 (0)