Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Rudimentary CMake support #29

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Rudimentary CMake support #29

wants to merge 22 commits into from

Conversation

torss
Copy link

@torss torss commented Mar 11, 2018

Note that this changes FastNoiseSIMD.h to a CMake configured file (see line 42 in CMakeLists.txt).
So it might be a slight inconvenience if someone doesn't want to use CMake.
(I.e. perhaps you don't want to merge this.)

@Auburn
Copy link
Owner

Auburn commented Mar 5, 2020

Thank you for your work on this, I'm still figuring out cmake. I'm using it in FastNoise2 but I haven't hooked up any config or CI support.

Could you give a run down on what platform/config the CI builds cover and what setup will they need.

Also what are the cmake options and setup steps, I will need to add some info to the wiki.

Thanks again for your help with this.

@Auburn
Copy link
Owner

Auburn commented Mar 5, 2020

@torss Why has the open simplex change been included now?

This was added because setting these flags for MSVC did cause
a runtime library mismatch in a project using FastNoiseSIMD
via add_subdirectory.
@torss
Copy link
Author

torss commented Mar 5, 2020

Oops, sorry, I completely forgot about this old PR from 2018. ;)
Feel free to close it if the changes are potentially annoying.

I'm currently only using my fork in a private test project. I just merged @c0rp3n's fork because I noticed that it apparently extends CMake support (although I personally don't need that) and @KdotJPG's fork since I wanted to try out his OpenSimplex2. So @c0rp3n would have to tell you about the CI build part, I'm not familiar with that either.

BTW nice to see that you are working on a successor, didn't know about FastNoise2 yet!

@c0rp3n
Copy link

c0rp3n commented Mar 5, 2020

So with my fork I added support for find_package in CMake and config support, then it is just a basic CI setup building on both MSVC 2019 and GCC 7.4.

The config works by just calling configure_file in CMake it then replaces the #cmakedefine with #define when the option with the same name is enabled the new file with the replaced defines is then written to the include directory. See https://pastebin.com/Tk3CuGLY for an example output after the configure.

And for buiding it would just be

mkdir build
cd build
cmake -DFN_COMPILE_AVX2=ON -DFN_COMPILE_AVX512=OFF .. && make

and then to install

sudo make install

With windows it differs slightly need to pass you need to set where you want to install it to on configure so

cmake -DCMAKE_INSTALL_PREFIX="E:/deps" ..

There will then be an install target added to the VS project which you can then use to install the library.

Edit:
You may also want to revert some of the readme changes as I just tried to make it less first person.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants