Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure a basic CMake library #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

glebm
Copy link

@glebm glebm commented Oct 6, 2024

Provides 2 targets: Portduino::Portduino and Porduino::PortduinoMain

Can be used like so:

include(FetchContent)
FetchContent_Declare(Portduino
  GIT_REPOSITORY https://github.com/glebm/framework-portduino.git
  GIT_TAG ...
  EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(Portduino)

...

target_link_libraries(MyProject PRIVATE Portduino::Portduino)

Refs #33

@CLAassistant
Copy link

CLAassistant commented Oct 6, 2024

CLA assistant check
All committers have signed the CLA.

Provides 2 targets: `Portduino::Portduino` and `Porduino::PortduinoMain`

Can be used like so:

```cmake
include(FetchContent)
FetchContent_Declare(Portduino
  GIT_REPOSITORY https://github.com/glebm/framework-portduino.git
  GIT_TAG ...
  EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(Portduino)

...

target_link_libraries(MyProject PRIVATE Portduino::Portduino)

```
@mverch67
Copy link
Collaborator

The current CMakeLists.txt in master seems not maintained, it's broken. This updated CMakeLists.txt works nicely from CLI and within vscode:

[main] Building folder: /home/manuel/Documents/PlatformIO/Projects/framework-portduino/build 
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /home/manuel/Documents/PlatformIO/Projects/framework-portduino/build --config Debug --target all -j 18 --
[build] [ 16%] Building CXX object CMakeFiles/Portduino.dir/cores/arduino/api/String.cpp.o
[build] [ 16%] Building CXX object CMakeFiles/Portduino.dir/cores/arduino/api/Common.cpp.o
[build] [ 16%] Building CXX object CMakeFiles/Portduino.dir/cores/arduino/api/IPAddress.cpp.o
[build] [ 22%] Building CXX object CMakeFiles/Portduino.dir/cores/arduino/api/Print.cpp.o
[build] [ 27%] Building C object CMakeFiles/Portduino.dir/cores/portduino/dtostrf.c.o
[build] [ 38%] Building CXX object CMakeFiles/Portduino.dir/cores/arduino/api/Stream.cpp.o
[build] [ 38%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/itoa.cpp.o
[build] [ 66%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/linux/millis.cpp.o
[build] [ 66%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/simulated/SimCommon.cpp.o
[build] [ 66%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/simulated/SimHardwareSPI.cpp.o
[build] [ 66%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/simulated/SimHardwareI2C.cpp.o
[build] [ 66%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/Utility.cpp.o
[build] [ 72%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/linux/LinuxSerial.cpp.o
[build] [ 77%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/linux/LinuxHardwareI2C.cpp.o
[build] [ 83%] Building CXX object CMakeFiles/Portduino.dir/cores/portduino/linux/LinuxCommon.cpp.o
[build] [ 88%] Linking CXX static library libPortduino.a
[build] [ 88%] Built target Portduino
[build] [ 94%] Building CXX object CMakeFiles/PortduinoMain.dir/cores/portduino/main.cpp.o
[build] [100%] Linking CXX static library libPortduinoMain.a
[build] [100%] Built target PortduinoMain
[driver] Build completed: 00:00:01.691
[build] Build finished with exit code 0 

It's nice to have a quick way to check if all files are compile clean and the library can be build whenever a change is done.

HOWEVER:
The list of files seems incomplete in this makefile. Some files are missing (logging., FS/, linux/gpio/), some are commented out (PluggableUSB.). Would be good to sort the files alphabetically then they compile in the same order as platformio does it and it's easier to search for and add missing files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants