Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • C CplusplusCourse - outdated
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Sebastien Ponce
  • CplusplusCourse - outdated
  • Merge requests
  • !4

Add CMake configuration files for the exercises, master branch (2020.10.09.)

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Attila Krasznahorkay requested to merge akraszna/cpluspluscourse:AddCMakeConfig-master-20201009 into master Oct 09, 2020
  • Overview 4
  • Commits 3
  • Changes 22

After some pondering I thought it could be beneficial to the example code if it could be compiled natively on as many platforms as possible. To do this, I opted to add CMakeLists.txt files to all of the example projects.

This should have a positive effect on not just the macOS and Windows builds, but even the Linux ones. Since for instance for the Python example the CMake configuration allows for a lot more robust build. (Not having to hardcode where Python is supposed to come from.)

The one controversial part of this is how I opted to implement the examples that build shared libraries, and can technically run on Windows. (The Python example I didn't even bother with...) I didn't want to fall back to static libraries with the build, so I had to update the C++ code to explicitly export the symbols of the shared library. This way the code can be built into DLLs on Windows successfully. However this also means that the existing Makefile-s of those projects don't work anymore. 😦 (For most projects the CMakeLists.txt file can work in addition to the existing Makefile.)

And just to show some pretty screenshots. 😛

Screen_Shot_2020-10-09_at_11.50.57_AM

Screenshot_2020-10-09_095326

Pinging @sponce and @graemes.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: AddCMakeConfig-master-20201009