GPUOpen-LibrariesAndSDKs / RadeonProRender-Baikal

MIT License
334 stars 78 forks source link

CMake script update #153

Closed harokyang closed 6 years ago

harokyang commented 6 years ago

Modified CMake script to: 1: Correctly copying necessary dlls to build folder. The former script didn't work on a fresh build. Have to rebuild a second time for the dlls being copied Debug and Relase dlls can be copied separately now

2: Created symbolic link in build folder to find resources and OpenGL/OpenCL kernel files The output build folder can now be placed anywhere, all executables can be running in it's own folder The above change means the project are now compatible with CMake for Visual Studio, no more VS_DEBUGGER_WORKING_DIRECTORY nor CurrentDir in launch.vj.json required

3: Added install command. On Windows, install will copy all required files for BaikalStandalone to a single folder, easy way to pack another BaikalStandaloneDemo On Linux, just don't do this I don't think the directories have be properly organized yet

PS: Some install command should be put into CMakelists.txt of RadeonRays, but that requires another pull request, so I did a cheap workaround(see the end of CMakelists.txt of BaikalStandalone)

Kvalme commented 6 years ago

Hi.

Thanks for the PR. Can you please add "cache" folder creation in bin folder? With current change we will miss cache and that will lead to a lot of kernel recompilations.

harokyang commented 6 years ago

A symlink cache, or a physical one? Or shall we create a cache folder if it does not existed by code instead of by build script?

Kvalme commented 6 years ago

A physical one. But sure, change to create folder from tests/application would be the best one. But I think we will never have a time to implement it.

harokyang commented 6 years ago

Added utility functions to recursively create directories Cache folder will now be created if not existed With mkpath() and mkfilepath(), you can easily build any directory tree structure

Tried std::filesystem / std::experimental::filesystem Quite easy to use with Visual Studio, but a lot of headache due to the linkage setup on Linux And IIRC the latest Xcode didn't shipped with stdc++fs So I gave up and implemented my own version

Kvalme commented 6 years ago

Thank you for this change! Unfortunately it can't be built on OSX.

[ 44%] Building CXX object Baikal/CMakeFiles/Baikal.dir/Utils/mkpath.cpp.o
/Users/user/JN/WS/RadeonProRender-Baikal_Build/Baikal/Utils/mkpath.cpp:41:25: error: use of undeclared identifier 'errno'
        if (err != 0 && errno == EEXIST)
                        ^
/Users/user/JN/WS/RadeonProRender-Baikal_Build/Baikal/Utils/mkpath.cpp:41:34: error: use of undeclared identifier 'EEXIST'
        if (err != 0 && errno == EEXIST)
                                 ^
2 errors generated.
harokyang commented 6 years ago

I see, mac OSX requires errno.h included But I don't have a mac environment for test Could you please do this for me

Kvalme commented 6 years ago

We checked build. Looks like #include is enought to build to pass. Can you please add this to mkpath.cpp so tests can start on this pull request?

harokyang commented 6 years ago

Done