When adding the the CMakeLists.txt, I wasn't able to
reference the other sibling projects. This change is to remove
the target_include_directories entries in favor
of using target_link_library which is the more canonical way
to reference other projects now that they exist.
Details
nix develop cd native/cpp/CommonCpp rm -rf build && mkdir build && cd build && cmake .. && make -j
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Getting the following when I try this in native/cpp/CommonCpp/CryptoTools which I'm guessing is the directory I should be in given the diff title:
[ 75%] Building CXX object CMakeFiles/comm-cryptotools.dir/Session.cpp.o /Users/atul/comm/native/cpp/CommonCpp/CryptoTools/Session.cpp:2:10: fatal error: 'PlatformSpecificTools.h' file not found #include "PlatformSpecificTools.h" ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/atul/comm/native/cpp/CommonCpp/CryptoTools/Tools.cpp:2:10: fatal error: 'PlatformSpecificTools.h' file not found #include "PlatformSpecificTools.h" ^~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. 1 error generated. make[2]: *** [CMakeFiles/comm-cryptotools.dir/Session.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: *** [CMakeFiles/comm-cryptotools.dir/Tools.cpp.o] Error 1 /Users/atul/comm/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp:2:10: fatal error: 'PlatformSpecificTools.h' file not found #include "PlatformSpecificTools.h" ^~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [CMakeFiles/comm-cryptotools.dir/CryptoModule.cpp.o] Error 1 make[1]: *** [CMakeFiles/comm-cryptotools.dir/all] Error 2 make: *** [all] Error 2
Getting the following when I try this in native/cpp/CommonCpp/CryptoTools which I'm guessing is the directory I should be in given the diff title:
This is by design. The idea is that people just need to reference CommonCpp and pulling out the needed project. Since they are all so coupled, it's not much of a loss. Being able to build the project from the directory itself was just to be able to get the majority of the CMake logic merged.
As mentioned in the summary:
This change is to remove the target_include_directories entries in favor of using target_link_library which is the more canonical way to reference other projects now that they exist.
The target_include_directoriesworked because we only used code located in headers, if we wanted to use headers and source files then the changes here are the correct way to reference other projects.