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 build fails when doing an in-tree build #265

Closed
saintdev opened this issue Jan 27, 2017 · 6 comments
Closed

CMake build fails when doing an in-tree build #265

saintdev opened this issue Jan 27, 2017 · 6 comments

Comments

@saintdev
Copy link

PROJECT_SOURCE_DIR equals CMAKE_CURRENT_BINARY_DIR for in-tree builds. This means the mv at src/core/CMakeLists.txt:91-92 fails because it is attempting to move the file over itself.

pwsafe $ cmake -DNO_YUBI=ON .
-- The CXX compiler identification is GNU 6.3.0
-- The C compiler identification is GNU 6.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found GTest: /usr/lib64/libgtest.so  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found wxWidgets: -L/usr/lib64;-pthread;;;-lwx_gtk2u_adv-3.0;-lwx_baseu-3.0;-lwx_gtk2u_core-3.0;-lwx_gtk2u_html-3.0;-lwx_baseu_net-3.0 (found version "3.0.2") 
-- Looking for uuid/uuid.h
-- Looking for uuid/uuid.h - found
-- Yubikey support disabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/saintdev/Projects/pwsafe
pwsafe $ make
[  0%] Generating core_st.cpp, core_st.h
mv: ‘/home/saintdev/Projects/pwsafe/src/core/core_st.cpp’ and ‘/home/saintdev/Projects/pwsafe/src/core/core_st.cpp’ are the same file
make[2]: *** [src/core/CMakeFiles/core.dir/build.make:63: src/core/core_st.cpp] Error 1
make[2]: *** Deleting file 'src/core/core_st.cpp'
make[1]: *** [CMakeFiles/Makefile2:178: src/core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
@grantdb
Copy link

grantdb commented Jan 24, 2018

I am getting this same error on Solus:
Scanning dependencies of target manpage [ 0%] Generating core_st.cpp, core_st.h [ 1%] Generating pwsafe.1.gz mv: '/home/build/YPKG/root/PasswordSafe/build/pwsafe-3/src/core/core_st.cpp' and '/home/build/YPKG/root/PasswordSafe/build/pwsafe-3/src/core/core_st.cpp' are the same file make[2]: *** [src/core/CMakeFiles/core.dir/build.make:63: src/core/core_st.cpp] Error 1 make[2]: *** Deleting file 'src/core/core_st.cpp' make[1]: *** [CMakeFiles/Makefile2:215: src/core/CMakeFiles/core.dir/all] Error 2

@grantdb
Copy link

grantdb commented Jan 24, 2018

Well I got it to build and packaged it into eopkg and installed just fine! I had to fork, branch and change some source.
src/core/CMakeLists.txt -- removed lines 91, 92
src/core/Makefile -- removed line 95

I think unrelated but I changed to "CONFIG=release" in src/core/Makefile

Cheers!

@saintdev
Copy link
Author

@grantdb You don't need to make any source changes, you just build in a separate directory.

@grantdb
Copy link

grantdb commented Jan 25, 2018

thank you @saintdev but what do you mean in a separate directory? I am doing the build under the Solus packaging chroot and I don't know how to change the directory values in that aspect?

@ronys
Copy link
Member

ronys commented Jan 26, 2018

The cmake 'paradigm' is to create a separate directory for the build process and build there. Something like:
$ git clone ...pwsafe.git
...
$ cd pwsafe
$ mkdir build
$ cd build
$ cmake ..
$ make

Using cmake to build in the source tree is not the recommended cmake way, but it shouldn't fail. Will work on a fix.

@grantdb
Copy link

grantdb commented Jan 27, 2018

Right my issue is with the solbuild system in Solus, it doesn't like out of source cmake. Otherwise it's fine, if you are not making a eopkg that is, I will look into this. Thank you

@ronys ronys closed this as completed Jan 28, 2018
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