I have a Xcode project .xcodeproj and I would like to convert it to a Makefile. How can I do this? Thanks in advance. I'm using Xcode 5.0.2.
If you have a one-time conversion to do, this answer may not be worthwhile. However, if you have to support multiple platform, or have other considerations, consider using CMake.
In a nutshell, CMake is a "meta"-makefile system, and can generate Makefiles, XCode projects, Visual Studio projects, etc. If you really have the need, and can bear CMake's ... interesting ... syntax, it may work well for you.
Having said that, if you don't have special considerations like multiple platform support, CMake is probably more work than it's worth.
Related
I have a sizeable project that finally can be ported to the latest and greatest compiler version (11).
From your experience, is it a good idea to 'simply' open the project in the new compiler and let the compiler do its thing ?
Or do you recommend a different approach ?
From your experience, is it a good idea to 'simply' open the project in the new compiler and let the compiler do its thing ?
Absolutely not. That rarely works as expected. Sure, it will upgrade the project file to the latest version, but that does not include updating component/library references, etc. You have to do all of that by hand.
Or do you recommend a different approach ?
Yes. The standard advice for many many years is to create a new project fresh, and then add your existing source code/files to it as needed.
Some weird stuff here. I'm trying to build a KMDF sample driver with VS2019 16.11.5 and WDK 10.0.19041.685 (also called version 2004 Dec 2020 update).
First, I got compilation error saying that I need to download Spectre-mitigated MSVC library.
Well, I try it, but got a new problem. The VS2019(16.11.5) installer does not show MSVC Spectre-mitigated MSVC library version for exact 16.11. Looks like the latest one it provides is 16.10 (🙁).
Download the 16.10 one and resume trying, still compilation error.
I peek into my D:\VSIDE\VS2019\VC\Tools\MSVC folder, and see two versions of MSVC libs listed, 14.29.30133 and 14.29.30037 . The later is the one with spectre libs(so it's 600MB+ larger).
However, the KMDF build tool insists to find MSVC libs in the newer 14.29.30133 folder, so Spectre-mitigated libs still CANNOT be found.
I know I can manually copy the required files from 14.29.30037 to 14.29.30133 to make things go on. BUT is it the decent way to do so, or is it a Microsoft toolset bug?
I'd like to ask how other kernel driver developers solve this issue. Thank you.
Well, several days later, I find out two workarounds for this issue.
First, as Hans Passant stated, disable the Spectre lib in .vcxproj. This can be configured from UI.
Second, explicitly select a MSVC library version for current project. This can also be configured in project settings UI.
==== 2022.02.11 UPDATE ====
Finally got it,the Spectre-lib with version number 14.29.30133 is called "(Latest)", so it is listed above the oldest version, and this defeats the novice. Use this and problem solved.
Sure, it is stupid enough to mark it as merely "(Lastest)". He should have named it MSVC v142 - VS2019 C++ x64/x86 Spectre-mitigated libs (v14.29-16.11)(Latest)" .
So I really cant understand how this work but late me explain. First, just in case you need it, I am running Ubuntu 12.04 64-bit on a laptop.
As a building tool am using CMake. I want to load in to my project OpenCV, MRPT (http://www.mrpt.org/) and libfreenect. All of them have a "source code". What I don't understand is when they say "build from source". How to I make a project with all of them?
Do I need to build each one individually and with some way but then in my project OR do I down load the source code and build them all together at ones? As you can see I'm really confused what I have to do... do I run the CMakeList.txt from each source code and the run one CMakeList.txt that has all the other CMakeList.txt?
In fewer world, if I want to build from source, two or more libraries, how do I do that?
I would like a general answer (how this "build from source" works) and an answer specifically on the the ones I mentioned (CMake, OpenCV, MRPT, libfreenect). I hope I made clear what I don't really understand.
It depends of the 'master' project. In general in the c/c++ universe your project must know how to invoke the build process of each subproject/library OR your project needs to know how to include&link the results after building each external project yourself.
You can also mix the two approaches if needed but I think it cleaner to try to use one if possible.
In the first case if all the subprojects offer cmake building files (CMakeLists.txt) you may try to add_subdirectory() each and see if there are any conflicts. For example google test can be easily included this way and it gives your project some global variables that easy linking later.
Alternatively or if the above approach gives problems or the sub project doesn't provide CMakeLists.txt you can use ExternalProject_add(). It takes more work and you have to handle includes/linking configurations with your project manually but it makes the subproject more independent. For example if there are conflicting targets with your project or the subproject doesn't provide CMakeLists.txt.
The last approach involves building and installing the sub projects separately, using configuration variables in your project to point the includes/libraries paths of the sub project. Check CMake:How To Find Libraries for details.
I'm not sure if this is the right place for asking these kind of question but I have no better place in mind.
After LOTS of coding in OpenCV, I'm trying to migrate to new C++ interface of openCV which has been introduced in OpenCV 2.0. but I keep getting strange errors.
For example:
trying to use pre-built dlls and libs, I got exceptions in "cv::warpAffine" and "findContours" cv::function at runtime. I compiled the openCV, used my own build of libs and dlls and everything got fixed!
the same problem happened in linux.
linking the "Debug" built dlls with "Release" built of program cause some unexpected runtime errors, and vice versa.
and some other errors.
can anyone helping me with what I'm doing wrong? (please keep in mind that I coded alot with older version of openCV).
When I migrated to C++ interface I couldnt make openCV work until I compiled the source by myself. Probably DLL's and Libs that are installed with opencv are good only to a specific machine.
Another thing. Try to do the following if you use Visual Studio
go to Project Properties->Click the C/C++ folder->Code Generation->Runtime Library and change it to /MDd in Debug configuration and /MD in release
It solves a problem with esceptions related to STL
Some of the functions ave moved out to new libs (especially some of the stereo functions are in calib3d) and the header file structure is completely changed in 2.2
There are some guides to the configuration eg for visual studio
Is there a good, open-source, documented CMake module for gettext support?
I mean:
Extracting messages from sources
Merging messages to existing translations
Compilation of mo-files
Installation of mo-files.
Because plain macros that CMake provides are quite... useless for real l10n support.
Anybody?
Edit: I created my own cmake rules for my own project but I don't think that
it is long term solution especially when you have multiple projects.
So it would be really helpful if someone directed me to such module.
I needed to write a gettext module for another project. So I made it user friendly and uploaded it to git hub.
https://github.com/jarro2783/CMake-Gettext
Wesnoth has their own solution.
See the code:
svn.gna.org/viewcvs/wesnoth/trunk/po/CMakeLists.txt?rev=42032&view=markup
And for reference:
svn.gna.org/viewcvs/wesnoth/trunk/CMakeLists.txt?rev=42920&view=markup
I’m not too sure this is really ”good” solution, but it works.
So late 2011 I started work on a CMake module:
https://github.com/Jookia/GettextTools
It fulfils everything you require.