Kinetic / kinetic-cpp-client

Mozilla Public License 2.0
15 stars 15 forks source link

Compile dependency order #44

Closed golpa closed 8 years ago

golpa commented 8 years ago

When compiling kinetic-cpp-client on CentOS 6 with cmake version 3 I see the following compile error:

Scanning dependencies of target kinetic_client
[ 33%] Building CXX object CMakeFiles/kinetic_client.dir/src/main/generated/kinetic_client.pb.cc.o
[ 34%] Building CXX object CMakeFiles/kinetic_client.dir/src/main/hmac_provider.cc.o
/mnt/golpa1/lvfs/Build/vendor/kinetic-cpp-client/src/Kinetic-cpp/src/main/hmac_provider.cc:25:26: fatal error: glog/logging.h: No such file or directory

and if you manage to get past that error you get:

[ 46%] Completed 'glog'
[ 46%] Built target glog
[ 47%] Building CXX object CMakeFiles/kinetic_client.dir/src/main/hmac_provider.cc.o
[ 48%] Building CXX object CMakeFiles/kinetic_client.dir/src/main/kinetic_connection_factory.cc.o
In file included from /mnt/golpa1/lvfs/Build/vendor/kinetic-cpp-client/src/Kinetic-cpp/src/main/kinetic_connection_factory.cc:20:0:
/mnt/golpa1/lvfs/Build/vendor/kinetic-cpp-client/src/Kinetic-cpp/src/main/nonblocking_packet_service.h:28:25: fatal error: gmock/gmock.h: No such file or directory

The cause seems to be that, at least on my computer, cmake is trying to build the dependencies in the wrong order.

Changing line 222 in CMakeLists.txt from add_dependencies(kinetic_client openssl) to add_dependencies(kinetic_client openssl glog gmock) seems to fix the issue.

plensing commented 8 years ago

Thanks for reporting this issue.

As there were a number of additional issues with the existing build script, I rewrote it completely. There should be no more issues in #48. If you have time, please take a look and let me know if the rewrite is missing any features you require.

golpa commented 8 years ago

I just tried it and it compiled cleanly without problems. Thank you for also getting rid of the build of ssl and protobuf and relying on the OS build. That significantly reduced the build time of this code