Skip to content
/ xplatform-cpp Public template

Cross-platform C/C++ project template for Windows, macOS, and Linux development using CMake.

Notifications You must be signed in to change notification settings

InfinSys/xplatform-cpp

Repository files navigation

Cross-Platform C/C++ Template


:: API Style

The API style project directory is designed for writing libraries intended to be consumed by other developers. Unlike end-user applications, a library's project structure is part of its public interface and consequently the user experience. Downstream projects interact not only with its binaries and headers but also with its build system and dependency layout. The goal this template has in mind is providing new projects with a conforming starting point that is easy to consume, extend, and maintain; whether linking it via CMake, embedding it directly, or publishing it as a package.

In contrast, End-User style projects typically focus on producing standalone executables or tools where internal organization is flexible and developer-facing ergonomics are less critical. You can find this template on the End-User Style branch.


License

There are no legal restrictions imposed on the use of this repository by the author. You may use the materials without attribution.

This is an explicit written notice from the author of this repository to all recipients of its contents : This template is free to use for any purpose with no restrictions. An MIT license is attached to this repository as indication of this fact and as standard procedure. The author does not require you to retain a license or copyright notice for this template in your derivative work. This template is free software.


Project Template Setup

Clone this repository using the CLI:

git clone https://github.com/InfinSys/xplatform-cpp.git -b api-style [destination path]

OR

📂download the source ZIP file and extract it to a preferred location.


Next Steps:

Once you obtain the template you can proceed with your modifications. There are conveniently placed TODO: markers within the project files that point out some critical personalization points if you are unsure where to start.

You are encouraged to modify this template as much as you desire, make it yours!

(More details on project structure below)


When you are ready to build the project, or if you'd like to verify the template works straight out of the box, you can instruct CMake to create the necessary build system files for your generator with the following:

🔧 Run the CMake configuration:

(in the root directory of the template)

Windows (x64):

cmake --preset win32-x64-debug

Linux (x64):

cmake --preset linux-x64-debug

macOS (x64):

cmake --preset macos-x64-debug

Note

⚠️ HEADS-UP!

Once you instruct CMake to configure the project this README will be overwritten by the generated version!

You can modify the README by changing the template README.md.in file.

(More details on template files below)



( ...This README is still in progress... )