Skip to content

CMake support#42

Open
scratch-er wants to merge 2 commits intoNJU-ProjectN:masterfrom
scratch-er:cmake
Open

CMake support#42
scratch-er wants to merge 2 commits intoNJU-ProjectN:masterfrom
scratch-er:cmake

Conversation

@scratch-er
Copy link

In this pull request, I ported NVBorad to the CMake build system. This enables the nvboard static library and simulations based on NVBoard to be configured and built with CMake. I added two CMakeLists.txt files. One is under the NVBoard project directory, this builds the static library and is intended to be used by add_subdirectory. Another is under example, this is an example and a starting point for a NVBoard user to write his/her own CMakeLists.txt to build a simulation based on NVBoard, The README is also updated to add the instructions of using CMake.

I think CMake can be a better choice than Makefile because it has better IDE/toolchain support, and it also has better cross-platform compatibility. For experienced users, CMakeLists.txt also usually has better readability than Makefile.

Currently, I only tested the CMakeLists.txt files under Linux.

@scratch-er
Copy link
Author

I have noted some other PRs and discussions about CMake. You can close this PR with no explanation, but here's my opinion:

  • When you are writing a Makefile, you are DESIGNING the PROCEDURE of building. When you are writing a CMakeLists.txt, you DECLARE the STRUCTURE of building. They are two different ways of thinking about building.
  • CMake is way more abstract than Makefiles. And digital designing learners don not need to spend too much of their effort on understanding the build system. If you want the users of NVBoard to get started more quickly, use CMake, since CMakeLists.txt is easier to read and hack. If you want NVBoard users to learn how a program is compiled and linked, use Makefile, since CMake hides too many things and details.
  • CMake has better IDE/toolchain support. This REALLY improves your coding efficiency a lot. For example, you can easily have your code checked, linted, or set up auto completion.

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.

1 participant