-
Notifications
You must be signed in to change notification settings - Fork 29
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
Refactor CMake Build System #150
Comments
So as per our previous conversation, I installed the Cross Tools Command Prompt for VS2015, I guess I just never installed the C++ components for whatever reason. Anyways, I've noticed that when trying to run the included batch file for a quick build, this fails because on my system i have MinGW installed. If you remember, previously I had avoided this issue by first generating the VS solution file and manually removing So I pushed this little modification that avoids this issue here: ktonegawa@7be8448 I thought perhaps this could help sort of partially solve issues described in this ticket. What do you think? I would also like to address the issue with #149 but I don't really know how to do deal with that with Windows, as I am not sure where the |
Hey @ktonegawa, That's not a bad idea to try and avoid using MinGW by default. Ignoring predefined directories feels like a hack to me, but in the short-term I'm fine to include that until I come up with a better way to only use Visual Studio includes. Your commit ktonegawa/mayaMatchMoveSolver@7be8448 seems ok (I haven't tested it myself yet), however it needs to use the "develop" branch, which is primed for v0.4.x release. As bad as the current build system is, I don't want to change it completely right now and instead only "maintain" the current build system until v0.4.x is released. I am making all sorts of build-system breaking changes in that branch with the aim of making everything cleaner and simpler to build on all 3 OSs. I have just merged in the latest changes from #146 (to support MacOS) which includes a lot of CMake changes. Also, if you add this change, can you also add it for Maya 2016, 2017 and 2018? I noticed your current commit is only for Maya 2019.
To remove Qt as a build dependency (#149) I was planning to use the Maya devkit, which contains a pre-compiled Perhaps an easier, but tedious Qt-related issue is #156. The details can be found here. Unfortunately this will require changing every single Python Qt import statement to point to the new import path. David |
P.S.
mayaMatchMoveSolver/CMakeLists.txt Line 148 in e6b8b96
The Maya Devkit is added as a CMake option here:
... although after reading the CMake source code I am not sure how the Maya devkit actually makes it easier for the correct mayaMatchMoveSolver/icons/CMakeLists.txt Line 25 in e6b8b96
|
Hey @david-cattermole, well I'm glad I didn't make a PR yet. And yeah I think I can see what you mean by this feeling like a hack. Since there are many other compilers out there like MinGW, I would like to more just some how start the includes of this to just default to vanilla Visual Studio settings, but I couldn't figure out how to do that with CMake. Do you think I should consult with the Stackoverflow hivemind about this?
Regarding the "develop" branch, I thought I had made my new branch off of develop... Am I doing something wrong with my forked repo? What I did after running
Yup for sure, again I only modified the batchfile for 2019 as more of a proof of concept. With the
Then the next question is at least for Windows, where to implement a condition where if |
Hello @ktonegawa,
Actually, I didn't check very well, it looks like you are using Merging the latest changes should look like this (without $ git pull upstream/develop Or... $ git fetch
$ git merge upstream/develop
The current CMake file should work on all platforms, CMake is smart enough to add the
I think the best way to handle this is to find the
If Hopefully we can add some default relative paths from the |
Hello @ktonegawa,
I did a bunch of reading (Googling) about this. I think this is a special case for Windows, and since we know Maya expects a specific compiler and using MinGW will not work I think it's a good idea to use
Also, since we add this to the |
Hi @david-cattermole , just as a reference I put this together in an attempt to address the The adjustments to the 2016-2018 build batch files are still on my to do list... |
Ok, that's good to know, thanks. |
Thank you @david-cattermole! Responded to them for further clarification. |
Issue 150 For Windows OS - An attempt to address #150 on the Windows end. These changes attempts to address two things: 1) The issue of Visual Studio defaulting to source MinGW as its main C++ compiler 2) The issue of rcc not being found when coming to the part where it builds the UI/Documentation sections (I believe these are the relevant parts) Added a scripts/build_mmSolver_windows64_maya2016_extension2.bat so that users who may be using Maya 2016 Extenstion 2 (2016.5).
BTW, I have been using the ExternalProject module in CMake 3.0 to build projects. I think this will make most, if not all of the Python scripts I'm using to download and build external dependencies completely unneeded. For this benefit I think it makes absolute sense to use CMake 3.0. as a minimum supported CMake version. Here is an example setup I have been writing for OpenCompGraphMaya: |
Oh that's interesting. I guess Still though, I am not sure about making CMake 3.0 as a minimum supported version. Some studios which may be utilizing this plugin may have strict policies on installed versions of software (and to maintain their build systems like you mentioned to me before). Might be better to have an option to utilize either or for the time being... |
Yeah, we can clone a git repo, or download source code directly, then patch it if needed, and finally we can then launch the CMake build on it, in a different directory. It's got a lot of functionality.
CMake 2.8.12 was released October 8, 2013, I really hope we can move on from 2013, considering there is no binary compatibility issues (unlike changing compilers), and the VFX Reference Platform does not specify which version of CMake to use. I double checked the version and it seems ExternalProject is available in CMake 2.8.12 (but it's lacking some features compared to the newest version), so it might not be a big problem. 2.8.12 is the "first version" to contain "Modern CMake" features. I'll discuss with some people offline and see if CMake 2.8.12 is a sticking point for them, I really do want to use something newer for mmSolver v0.4.x. P.S. If you ever have a spare 3.5 hours, and you don't want to re-watch a few The Lord of the Rings movies, these talks are informative: |
Someone recently pointed out to me that OpenEXR requires at least CMake v3.10 to build, and prefers v0.3.12, so I think it's safe to say we should be able to use at least v3.10. |
The CMake build scripts have been improved a huge amount. I'm going to consider this issue finished. Any new issues or features needed will be addressed in a new issues. |
Problem
The current use of CMake as the build generator works, but is far from ideal.
We need to do a refactor of the CMake build system code.
Problems to be fixed:
The CMakeLists.txt files are not organised in a hierarchical way, with separation of concerns.
There is a lot of duplication of code, which should be condensed into re-useable macros/functions.
"Modern" CMake practices must be used, avoiding global changes to include directory paths and instead using "targets".
Software Versions
mmSolver version: Latest
Maya version: All
Operating System (OS): All (including Mac)
The text was updated successfully, but these errors were encountered: