Repository navigation
Conversation
|
Hi Joel, Yes, I would consider merging this. I've never used CMake, but there seem to be those who are quite fond of it and for whom this would be a nice addition. (This might be a good opportunity for me to give CMake a try and see if it's something I ought to be using regularly.) I don't see a way in which it "interferes" with existing code (i.e., it can be added with a high degree of confidence that nothing will get broken). Speaking from the aforementioned near-total knowledge of CMake: should this be extended to include X11, SDL1, and/or SDL2? (I'd assume DOS and OS2 would be out of the picture.) |
|
Hi Bill, Cool! The CMake implementation certainly could be extended for X11, SDL1, and SDL2. This current commit enables building DLL with proper exports, and addresses missing libs only for ARM. These are some additional example usage/generator scenarios: Packaging is next. Cheers |
|
Note: There are plans for removing the def files completely, see https://github.com/Bill-Gray/PDCurses/pull/48 (I just wait for Bill to leave a "go" for this, ideally with an issue to track this). @INRIX-joel-winarske I don't see why this shouldn't be extended to win32 and win32a - please share your thoughts. It would be nice to have the vc[x]proj files generated (ideally one sln containing one project for each of the [under Win32 working] projects: win32 win32a sdl2 [maybe sdl1]). @Bill-Gray I think adding CMake is fine as long as the working (and maybe later on the generated) Makefiles aren't removed from the repo - I really dislike to force anyone to install "another 'nearly standard' tool" just to be able to create the build. |
|
Currently you can build any configuration type, and it generates output for both win32 and win32a. So build like this: Or build/debug via the Visual Studio solution (pdcurses.sln) @GitMensch Changes are in to support win32/win32a in the same solution. |
|
My apologies to you both; I've just thrown a small spanner into the works, which (I hope) may actually make things a little easier. A while back, I tried out Simon's suggestion for eliminating the Now I'm back, and... I've just pushed the changes, which cause all exported functions in Simon, I agree that there's no reason to remove the existing Makefiles, and plenty of reason to leave them. As mentioned above, one nice thing about Joel's proposed change is that, from the viewpoint of those of us doing 'traditional' builds without CMake, not a single byte changes; we just have a few more files lying around that we totally ignore. |
|
@Bill-Gray Yes, it is fine (my PR https://github.com/Bill-Gray/PDCurses/pull/51 got nearly in). I did not tried the CMake patch but it looks good so far, it now likely just misses the remove of the def files. @jwinarske : after doing these changes, can you please upload the generated VS project files (VS2008 and VS2017) for review? As I understood this these would have all curses platforms as single projects, all providing each VS Plattforms (Win32,x64,ARM), with different VS configurations (Debug, MinSizeRel, Release, RelWithDebugInfo). |
|
@jwinarske - can you add an additional set of VS configurations that create static libraries? As PDCurses is under Public Domain nearly all programs under all licenses can be linked against a static version without any license issues (this is quite different for a lot of other licenses)... Thank you. |
|
@GitMensch Changes made. Regarding solution files, what is the desired location for the install prefix? If you don't run "target" install, it will be as is expected. Also where should I document? |
|
@jwinarske Looks good. I can't decide on the CMAKE_INSTALL_PREFIX but the default seems reasonable. |
|
VS 2012 Win64 dev prompt VS 2015 Win64 dev prompt |
|
@jwinarske Thank you for uploading the vs2015 files (I meant to just upload them in this discussion, not committing them but we can remove them later). Just had a quick look and the generated VS2015 files. The following questions target the "generate once, work on all machines" goal which seems not be the goal of CMake (which seems to be more like Autoconf than like Makefiles) - but maybe CMake can be tweaked this way (allowing the generated files to be uploaded/shipped with source tarballs).
|
|
@GitMensch Taken care of. Regarding your points on the CMake built solution files. I understand your points. Keep in mind CMake was never meant to be a stand alone Solution Wizard, but rather a powerful build automation tool. It has multiple features I'm not using (CPack/CTest). The default install output is changed by setting the CMAKE_INSTALL_PREFIX variable. I used the default per your request. All that said, CMake is what it is. It's a quick way to automate building, and it accounts for many different platforms. Cheers |
Hm, what exactly was taken care of? Please help me to understand this by answering my questions from the previous post. Thank you! |
|
Just a quick note... I see this has been hanging fire for 29 days. As you may have seen (issue #64), it looks as if CMake support is of interest to several folks. Is it the opinion of you both that we ought to first pull in a Win32 and Win32a solution, and then extend that to include X11, SDL1/2, etc.? Or should we hold off until there's a "full" solution? |
|
@Bill-Gray : I've thought about CMake to be a similar tool to automake/autoconf in the way that it is possible to use it for generating VS and other project files that are portable and can be used anywhere without further changes. But it seems that this was a completely wrong assumption and the generated files are system specific, forcing people to always use CMake for setting up the build system (which is OK if this is the "way CMake does it" as long as we have the primary build scripts in Makefiles and the CMake version is only additional). But in this case there is zero usefulness to upload any of the generated files to vcs and "adding CMake build files" just means to add the CMakelists.txt. @Bill-Gray In general (maybe see a s prerequisite) I'd like to move pdcurses.ico and pdcurses.rc (which is outdated btw) to a single separate directory, maybe pdcurses/build_aux pr pdcurses/additional_win32 or ??? To not have to change the version number and copyright parts I'd replace these by defines that are set in the makefiles from the version include we already have. Thoughts? In general I'd like to see someone that knows CMake to recheck the versions from @jwinarske (which could be changed to not use the version.rc [if this is possible]) and adding them to a new branch, include the "not VS" parts and when everything (or most) is in merge this "fresh" and (nearly) complete branch to master. This would allow @wmcbrine to merge the changes of this branch to his master if he's interested, too. |
|
@GitMensch : If I'm understanding how CMake works, then you're right: you write up your CMakelists.txt file, and CMake uses that to create a makefile for MinGW, Cygwin, etc. I am not really clear as to the utility of this, since we already have makefiles for almost every compiler in existence... perhaps it makes it easier when using PDCurses as part of a larger project that does rely on CMake? In re pdcurses.ico and pdcurses.rc: those can certainly be moved to a common folder. (Though the .rc files should, perhaps, contain something saying that they're for Win32 console or Win32 GUI. We currently have no .rc file for Windows compiles for SDL1 or SDL2, but perhaps we should... anyway, it seems to me we could end up with different .rc files for each flavor, instead of the current two identical .rc files.) Not clear on how you're thinking of addressing an automated update to the .rc file, but I'm quite open to that idea. For the moment, I've just made identical updates to both files, just as a first (tiny) step. |
I don't think of this - I think of using compiler defines (all resource compilers understand them) - just use constants in there and define the actual value (and the port) by defines. Nice side effect: we only need one in a common folder. |
|
Sorry my Github notifications were hidden in a buried folder!
@GitMensch I'll take a look at your questions and get back to you. |
|
I refactored for sdl2, added an example, and a README.md (cmake\README.md). Take a peek. |
minor typos
|
Looks nice. Some questions:
|
|
|
@GitMensch Forgot to elaborate on the Cygwin question, if you specify the "Unix Makefile" Generator it won't look for "Windows Kit" paths. |
|
@INRIX-joel-winarske Your changes look very promising. Two questions:
|
|
@GitMensch Hi Simon.
Dynamic section at offset 0x160d38 contains 29 entries: Dynamic section at offset 0xe8d48 contains 26 entries:
@Bill-Gray @GitMensch
|
|
@INRIX-joel-winarske I'm out next week, too :-) It is unclear for me what "Windows Native" means to you, but I guess you meant Visual Studio (that is a complete different issue, PGI, Borland and others [and MinGW, too] build "Windows native" applications. There are some compilations that are not in your Matrix but we have the Makefiles for these already and for the CMake parts this matrix is completely fine. I'm looking forward seeing the last piece added and integrating it (or having it integrated, if @Bill-Gray wants to do it) to PDCurses. One last note: I think it is strange to include a build bat exclusive for vs2015, especially as CMake's intension seems to be to not need these. |
|
@GitMensch Nice! "Windows Native" meaning compiled and linked with a MSFT toolchain. Perhaps instead of "Target" the matrix would indicate the CMake Generator "target". The variations quickly grow. The vs2015_build.cmd file is a test case that provides a valid command line build example. I can remove it. |
|
@INRIX-joel-winarske I think cmake/README.md has enough for "what is the correct use" (if you're not 100% sure about it it would be good to add the missing bits there and remove the vs2015_build.cmd afterwards. Read you in about 10 days :-) |
|
@INRIX-joel-winarske I'm really looking forward for the X11 addition and final merge of your changes! |
|
@INRIX-joel-winarske / @jwinarske I'd like to merge this soon - Are there any news from you? |
…or, Linux sdl2 stack building
|
Closing and re-opening a new PR. |
Hi Bill,
I've done some work with CMake/msbuild related to your project. I need to do a bit more work, but I wanted to see if this is something you would entertain merging.
Example to build x86 and x86_64 from a VS Dev Cmd Prompt:
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=c:\temp\PDCurses\dist\x86\bin -G"Visual Studio 14 2015" && cd ..
mkdir build64 && cd build64
cmake .. -DCMAKE_INSTALL_PREFIX=c:\temp\PDCurses\dist\x86_64\bin -G"Visual Studio 14 2015 Win64" && cd ..
cmake --build build --config Debug --target install
cmake --build build64 --config Debug --target install
Binary bits get copied to the CMAKE_INSTALL_PREFIX variable value. In the above cases c:\temp\PDCurses\dist\
Joel