-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add initial CMake build support. #185
Conversation
43adfea
to
39f2aa0
Compare
Thank you for this. We would like to have CMAKE build. I am not familiar with CMAKE. Is it possible to do some wildcards of files instead of explicitly listing them? Otherwise it may be easily broken if a file is added or removed, isn't it? |
That does seem attractive, but it doesn't seem to be a common practice. I think this explains why:
This is pretty minimal as far as CMake configurations go, in my experience. What other compile flags would you like? For example I expect we should add |
Currently gmake version has |
This CMakeLists.txt provides targets for unittests, perftests and all example programs. Note that this file does not copy the `bin` folder contents to the target directory, which only applies if you do out-of-source builds. In which case you may copy the folder manually, or ideally update CMakeLists.txt to perform this. I didn't manage to get this to work. It's possible the minimum CMake version required is actually lower than that published, but I cannot test. Users of this file on earlier versions should modify this if earlier versions do in fact work. To use: rapidjson$ mkdir out rapidjson$ cd out rapidjson/out$ cmake .. rapidjson/out$ make unittests This CMake file has also been tested with beta builds of the new CLion IDE and works well. You may also configure the build using a tool such as `ccmake`. rapidjson/out$ ccmake .
-march=native -Wall -Wextra -Werror -Weffc++ -Wswitch-default
39f2aa0
to
47eb14d
Compare
Some improvements, rebased on top of master.
The file is much simpler now, fitting on one screen.
In practice this isn't an issue, so long as someone is using the CMake file. It might be a good idea to have the CI server run an additional build using CMake, just to ensure everything is alright with its configuration. |
Can you also help adding instructions in readme? |
This CMakeLists.txt
provides targets for
unittests,
perftests` and all example programs.Note that this file does not copy the
bin
folder contents to the target directory, which only applies if you do out-of-source builds. In which case you may copy the folder manually, or ideally updateCMakeLists.txt
to perform this. I didn't manage to get this to work.It's possible the minimum CMake version required is actually lower than that published, but I cannot test. Users of this file on earlier versions should modify this if earlier versions do in fact work.
To use:
This CMake file has also been tested with beta builds of the new CLion IDE and works well.
You may also configure the build using a tool such as
ccmake
.