|
|
@@ -44,18 +44,12 @@ set(HEADERS |
|
|
|
) |
|
|
|
# Compiler flags |
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Winline -pipe -Wformat-security") |
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-soname,libwiringPi.so${WIRINGPI_SONAME_SUFFIX}") |
|
|
|
|
|
|
|
# Read version from version.h |
|
|
|
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../version.h" VERSION) |
|
|
|
string(REGEX REPLACE ".*VERSION \"([0-9]+.[0-9]+)\".*" "\\1" VERSION "${VERSION}") |
|
|
|
|
|
|
|
# Add the library target |
|
|
|
add_library(wiringPi SHARED ${SRC}) |
|
|
|
|
|
|
|
# Set the library version |
|
|
|
set(WIRINGPI_SONAME_SUFFIX "1") |
|
|
|
set_target_properties(wiringPi PROPERTIES VERSION ${VERSION} SOVERSION ${WIRINGPI_SONAME_SUFFIX}) |
|
|
|
set_target_properties(wiringPi PROPERTIES VERSION ${WIRINGPI_VERSION} SOVERSION ${WIRINGPI_SOVERSION}) |
|
|
|
target_include_directories(wiringPi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) |
|
|
|
|
|
|
|
# Add -lm to link with the math library |
|
|
|