Skip to content

Commit

Permalink
cmake: Specify cmake version + Fix finding Python development module
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Feb 21, 2024
1 parent 6751a17 commit ee33529
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Copyright (c) 2016-2024, Olivier Martin <[email protected]>
#

cmake_minimum_required(VERSION 3.4)
cmake_minimum_required(VERSION 3.25.1)

# Add Cross-Compilation support when the environment variables
# CROSS_COMPILE and SYSROOT are defined
Expand Down
10 changes: 5 additions & 5 deletions bluez/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,14 +19,14 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

message("Build gattlib for Bluez v${BLUEZ_VERSION_MAJOR}.${BLUEZ_VERSION_MINOR}")

set(bluez4_DIR bluez4)
set(bluez5_DIR bluez5)
set(bluez5_DIR bluez5)

# Bluez specific files
set(bluez4_SRCS ${bluez4_DIR}/attrib/att.c
Expand Down Expand Up @@ -109,12 +109,12 @@ include(GNUInstallDirs)
if(GATTLIB_SHARED_LIB)
add_library(gattlib SHARED ${gattlib_SRCS})
target_link_libraries(gattlib ${gattlib_LIBS})

install(TARGETS gattlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
add_library(gattlib ${gattlib_SRCS})
target_include_directories(gattlib INTERFACE ../include)
target_link_libraries(gattlib ${gattlib_LIBS})

install(TARGETS gattlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
14 changes: 8 additions & 6 deletions dbus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Copyright (c) 2016-2024, Olivier Martin <[email protected]>
#

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down Expand Up @@ -102,12 +102,14 @@ if(GATTLIB_PYTHON_INTERFACE)
else()
set(Python_USE_STATIC_LIBS TRUE)
endif()
find_package(Python COMPONENTS Interpreter Development)
if (Python_Development_FOUND)
include_directories(${Python_INCLUDE_DIRS})
list(APPEND gattlib_LIBS ${Python_LIBRARIES})
find_package(Python COMPONENTS Development.Module)
if (Python_Development.Module_FOUND)
include_directories(${Python_INCLUDE_DIRS})
list(APPEND gattlib_LIBS ${Python_LIBRARIES})

add_definitions(-DWITH_PYTHON -DPYTHON_VERSION_MAJOR=${Python_VERSION_MAJOR} -DPYTHON_VERSION_MINOR=${Python_VERSION_MINOR})
add_definitions(-DWITH_PYTHON -DPYTHON_VERSION_MAJOR=${Python_VERSION_MAJOR} -DPYTHON_VERSION_MINOR=${Python_VERSION_MINOR})
else()
message(FATAL_ERROR "Could not find Python developer package")
endif()
endif()

Expand Down
4 changes: 2 additions & 2 deletions examples/advertisement_data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions examples/discover/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions examples/find_eddystone/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions examples/gatttool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions examples/nordic_uart/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions examples/notification/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions examples/read_write/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions examples/read_write_memory/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GattLib - GATT Library
#
# Copyright (C) 2016-2021 Olivier Martin <[email protected]>
# Copyright (C) 2016-2024 Olivier Martin <[email protected]>
#
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.25.1)

find_package(PkgConfig REQUIRED)

Expand Down

0 comments on commit ee33529

Please sign in to comment.