Skip to content
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

CMake Error: No source or binary directory provided #28

Closed
ulyssesrr opened this issue Jan 27, 2019 · 2 comments
Closed

CMake Error: No source or binary directory provided #28

ulyssesrr opened this issue Jan 27, 2019 · 2 comments

Comments

@ulyssesrr
Copy link

ulyssesrr commented Jan 27, 2019

$ make package-dev
VERSION BUILD DEFINED 2.0.0-0-g3ba20ce
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ulysses/git/ROCT-Thunk-Interface/build
CMake Error: No source or binary directory provided
make[3]: *** [CMakeFiles/build-dev.dir/build.make:57: CMakeFiles/build-dev] Error 1
make[2]: *** [CMakeFiles/Makefile2:142: CMakeFiles/build-dev.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:181: CMakeFiles/package-dev.dir/rule] Error 2
make: *** [Makefile:225: package-dev] Error 2

I have tracked the issue to the build-dev custom target command:

add_custom_target ( build-dev
    COMMAND ${CMAKE_COMMAND}
        -DSOURCE_DIR="${SOURCE_DIR}"
        -DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"
        -DCPACK_RPM_PACKAGE_REQUIRES="hsakmt-roct"
        -DCPACK_PACKAGING_INSTALL_PREFIX="${CPACK_PACKAGING_INSTALL_PREFIX}"
    WORKING_DIRECTORY ${DEV_BUILD_DIR} )

It invokes cmake with some vars arguments -Dvar=value but without a directory argument.

It seems this was an undocummeted behaviour of cmake that worked by accident and became broken on cmake-3.13.3 : https://gitlab.kitware.com/cmake/cmake/issues/18817
Acording to the link above they will revert to a warning on 3.13.4 but its expected to become an error again in cmake 3.14.

The fix is to add a directory argument, just adding the current directory worked for me, since the command specifies a WORKING_DIRECTORY:
https://gist.github.com/ulyssesrr/d7c93e121bc9c5c7a4e0564be5e4ac21

@rigred
Copy link

rigred commented Jan 27, 2019

Thanks for posting this - also coincidentally helped me fix an issue on yet another project aside from just roct.

@kentrussell
Copy link
Contributor

Fixed in 3.1 (well, fixed before then, but not an issue now)

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

No branches or pull requests

3 participants