Skip to content

Commit

Permalink
Fix nng-config.cmake setting missing NNG_PKGS, version info
Browse files Browse the repository at this point in the history
The generated nng-config.cmake file wasn't including
dependencies (like Threads) causing the demos to not build properly on
systems relying on pthreads. Version info was also not being
populated, but it seems that's been the case for at least the last release.
  • Loading branch information
voutilad committed Jan 4, 2021
1 parent b09392a commit 911cbbc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmake/nng-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

@PACKAGE_INIT@

set(NNG_VERSION_MAJOR "@NNG_VERSION_MAJOR@")
set(NNG_VERSION_MINOR "@NNG_VERSION_MINOR@")
set(NNG_VERSION_PATCH "@NNG_VERSION_PATCH@")
set(NNG_VERSION_MAJOR "@NNG_MAJOR_VERSION@")
set(NNG_VERSION_MINOR "@NNG_MINOR_VERSION@")
set(NNG_VERSION_PATCH "@NNG_PATCH_VERSION@")

set_and_check(NNG_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIRS@")

Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ write_basic_package_version_file("${version_config}"
VERSION ${NNG_PACKAGE_VERSION}
COMPATIBILITY SameMajorVersion
)
get_property(NNG_PKGS GLOBAL PROPERTY NNG_PKGS)
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake.in "${project_config}"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
PATH_VARS INCLUDE_INSTALL_DIRS)
Expand Down
3 changes: 2 additions & 1 deletion src/platform/posix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if (NNG_PLATFORM_POSIX)

find_package(Threads REQUIRED)
nng_link_libraries(Threads::Threads)
set_property(GLOBAL APPEND PROPERTY NNG_PKGS Threads)

# Unconditionally declare the following feature test macros. These are
# needed for some platforms (glibc and SunOS/illumos) and are harmless
Expand Down Expand Up @@ -105,4 +106,4 @@ if (NNG_PLATFORM_POSIX)
else ()
nng_sources(posix_rand_urandom.c)
endif ()
endif ()
endif ()
1 change: 1 addition & 0 deletions src/sp/transport/zerotier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ if (NNG_TRANSPORT_ZEROTIER)
************************************************************")

find_package(zerotiercore REQUIRED)
set_property(GLOBAL APPEND PROPERTY NNG_PKGS zerotiercore)

nng_link_libraries(zerotiercore::zerotiercore)
nng_defines(NNG_TRANSPORT_ZEROTIER)
Expand Down

0 comments on commit 911cbbc

Please sign in to comment.