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

CMake build system refactoring #205

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

CMake build system refactoring #205

wants to merge 1 commit into from

Conversation

Mc-Zen
Copy link

@Mc-Zen Mc-Zen commented Oct 20, 2022

Changes

  • Add some CMake options
    • Option for enabling IDE folders which sorts all projects into folders (default off to make it as it originally was). All libraries are put in a "C74_Libraries" folder, externals in a "Projects" folder and unit tests in a "Unit Tests" folder.
    • Option for building example projects (default on).
    • Option for surpressings automatic cmake regeneration (default on because this was set originally).
  • added c74_add_project.cmake file with command c74_add_project() to replace includes of the pre and post scripts. The library output directories are set here instead of in the max-pretarget.cmake which makes more sense because the path lies in the min-devkit folder, not in the max-sdk-base.
  • add min-api as subdirectory to bring all targets and functions into scope. min-api can still be a totally independant repository. The change here is that the option BUILD_DOCUMENTATION is available. Suggestion: we could add a if(PROJECT_IS_TOP_LEVEL) in the CMakeLists.txt file of min-api to only supply that option when min-api is built on its own.

- Add some CMake options
- add min-api as subdirectory
- add c74_add_project function that can be used to create a library target with the necessary configuration for a max external
@Mc-Zen
Copy link
Author

Mc-Zen commented Oct 24, 2022

I forgot to note:
Each projects CMakeLists.txt can now be replaced with something like

# Copyright 2018 The Min-DevKit Authors. All rights reserved.
# Use of this source code is governed by the MIT License found in the License.md file.

set(target min.beat.pattern)
c74_add_project(${target} SOURCES ${target}.cpp)
c74_add_auto_unit_test(${target})

I tried that out with all the default projects and they all work fine. Some have additional CMake code but this is no problem.

Of course I didn't want to push these changes until you said you'd want to migrate all projects to this new solution.

Best regards

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