diff --git a/.gitignore b/.gitignore index e6ad4ba..4ea6884 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ debian-template/wiringpi-*.deb gpio/gpio examples/speed examples/blink +build/ \ No newline at end of file diff --git a/build b/build.sh similarity index 100% rename from build rename to build.sh diff --git a/cmake/toolchain.cmake b/cmake/toolchain.cmake new file mode 100644 index 0000000..931f783 --- /dev/null +++ b/cmake/toolchain.cmake @@ -0,0 +1,9 @@ +set(CMAKE_AR /usr/bin/arm-linux-gnueabihf-ar) +set(CMAKE_ASM_COMPILER /usr/bin/arm-linux-gnueabihf-as) +set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc) +set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++) +set(CMAKE_LINKER /usr/bin/arm-linux-gnueabihf-ld) +set(CMAKE_OBJCOPY /usr/bin/arm-linux-gnueabihf-objcopy) +set(CMAKE_RANLIB /usr/bin/arm-linux-gnueabihf-ranlib) +set(CMAKE_SIZE /usr/bin/arm-linux-gnueabihf-size) +set(CMAKE_STRIP /usr/bin/arm-linux-gnueabihf-strip) \ No newline at end of file diff --git a/devLib/CMakeLists.txt b/devLib/CMakeLists.txt new file mode 100644 index 0000000..0f205e2 --- /dev/null +++ b/devLib/CMakeLists.txt @@ -0,0 +1,23 @@ +set(DEVLIB devLib) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library(${DEVLIB}Obj OBJECT + ds1302.c + maxdetect.c + piNes.c + gertboard.c + piFace.c + lcd128x64.c + lcd.c + scrollPhat.c + piGlow.c) + +add_library(${DEVLIB} STATIC $) +add_library(${DEVLIB}shared SHARED $) +set_target_properties(${DEVLIB}shared PROPERTIES OUTPUT_NAME ${DEVLIB}) + +install(TARGETS ${DEVLIB} ${DEVLIB}shared + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) \ No newline at end of file diff --git a/gpio/CMakeLists.txt b/gpio/CMakeLists.txt new file mode 100644 index 0000000..5130255 --- /dev/null +++ b/gpio/CMakeLists.txt @@ -0,0 +1,17 @@ +set(GPIO gpio) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library(${GPIO}Obj OBJECT + gpio.c + readall.c + OrangePi.c) + +add_library(${GPIO} STATIC $) +add_library(${GPIO}shared SHARED $) +set_target_properties(${GPIO}shared PROPERTIES OUTPUT_NAME ${GPIO}) + +install(TARGETS ${GPIO} ${GPIO}shared + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) \ No newline at end of file diff --git a/wiringPi/CMakeLists.txt b/wiringPi/CMakeLists.txt new file mode 100644 index 0000000..f37dda8 --- /dev/null +++ b/wiringPi/CMakeLists.txt @@ -0,0 +1,50 @@ +set(WIRINGPI wiringPi) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +add_library(${WIRINGPI}Obj OBJECT + wiringPi.c + wiringSerial.c + wiringShift.c + piHiPri.c + piThread.c + wiringPiSPI.c + wiringPiI2C.c + softPwm.c + softTone.c + mcp23008.c + mcp23016.c + mcp23017.c + mcp23s08.c + mcp23s17.c + sr595.c + pcf8574.c + pcf8591.c + mcp3002.c + mcp3004.c + mcp4802.c + mcp3422.c + max31855.c + max5322.c + ads1115.c + sn3218.c + bmp180.c + htu21d.c + ds18b20.c + rht03.c + drcSerial.c + drcNet.c + pseudoPins.c + wpiExtensions.c + w25q64.c + oled.c + OrangePi.c) + +add_library(${WIRINGPI} STATIC $) +add_library(${WIRINGPI}shared SHARED $) +set_target_properties(${WIRINGPI}shared PROPERTIES OUTPUT_NAME ${WIRINGPI}) + +install(TARGETS ${WIRINGPI} ${WIRINGPI}shared + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) \ No newline at end of file