-
Notifications
You must be signed in to change notification settings - Fork 17
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
Place all relevant headers in /include during installation #489
base: master
Are you sure you want to change the base?
Conversation
"src/*/*.hpp" | ||
"src/*/*/*.hpp" | ||
) | ||
get_property(INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that this collects everything specified in include_directories
. I suppose on Mac it can as well collect include_directories(SYSTEM /usr/local/include)
, which we probably do not want? I'm not sure what's the best course of action to avoid this situation here.
@hmusta I tried using Metagraph as an external project, and besides problems with includes (that are at least resolved by this commit), I also get a bunch of linking errors: [100%] Linking CXX executable MyExecutable
/usr/bin/ld: CMakeFiles/MyExecutable.dir/src/main.cpp.o: in function `spdlog::logger::sink_it_(spdlog::details::log_msg const&)':
main.cpp:(.text._ZN6spdlog6logger8sink_it_ERKNS_7details7log_msgE[_ZN6spdlog6logger8sink_it_ERKNS_7details7log_msgE]+0x253): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/bin/ld: CMakeFiles/MyExecutable.dir/src/main.cpp.o: in function `spdlog::logger::flush_()':
main.cpp:(.text._ZN6spdlog6logger6flush_Ev[_ZN6spdlog6logger6flush_Ev]+0x24a): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/bin/ld: CMakeFiles/MyExecutable.dir/src/main.cpp.o: in function `std::make_unsigned<long>::type fmt::v10::detail::to_unsigned<long>(long)':
main.cpp:(.text._ZN3fmt3v106detail11to_unsignedIlEENSt13make_unsignedIT_E4typeES4_[_ZN3fmt3v106detail11to_unsignedIlEENSt13make_unsignedIT_E4typeES4_]+0x21): undefined reference to `fmt::v10::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/MyExecutable.dir/src/main.cpp.o: in function `fmt::v10::detail::format_decimal_result<char*> fmt::v10::detail::format_decimal<char, unsigned int>(char*, unsigned int, int)':
main.cpp:(.text._ZN3fmt3v106detail14format_decimalIcjEENS1_21format_decimal_resultIPT_EES5_T0_i[_ZN3fmt3v106detail14format_decimalIcjEENS1_21format_decimal_resultIPT_EES5_T0_i]+0x3f): undefined reference to `fmt::v10::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/MyExecutable.dir/src/main.cpp.o: in function `fmt::v10::detail::format_decimal_result<char*> fmt::v10::detail::format_decimal<char, unsigned long>(char*, unsigned long, int)':
main.cpp:(.text._ZN3fmt3v106detail14format_decimalIcmEENS1_21format_decimal_resultIPT_EES5_T0_i[_ZN3fmt3v106detail14format_decimalIcmEENS1_21format_decimal_resultIPT_EES5_T0_i]+0x42): undefined reference to `fmt::v10::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/MyExecutable.dir/src/main.cpp.o: in function `std::back_insert_iterator<fmt::v10::basic_memory_buffer<char, 250ul, std::allocator<char> > > fmt::v10::vformat_to<std::back_insert_iterator<fmt::v10::basic_memory_buffer<char, 250ul, std::allocator<char> > >, 0>(std::back_insert_iterator<fmt::v10::basic_memory_buffer<char, 250ul, std::allocator<char> > >, fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)':
main.cpp:(.text._ZN3fmt3v1010vformat_toISt20back_insert_iteratorINS0_19basic_memory_bufferIcLm250ESaIcEEEELi0EEET_S7_NS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_20basic_format_contextINS0_8appenderEcEEEE[_ZN3fmt3v1010vformat_toISt20back_insert_iteratorINS0_19basic_memory_bufferIcLm250ESaIcEEEELi0EEET_S7_NS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_20basic_format_contextINS0_8appenderEcEEEE]+0x3e): undefined reference to `void fmt::v10::detail::vformat_to<char>(fmt::v10::detail::buffer<char>&, fmt::v10::basic_string_view<char>, fmt::v10::detail::vformat_args<char>::type, fmt::v10::detail::locale_ref)'
collect2: error: ld returned 1 exit status These are resolved by adding find_package(spdlog REQUIRED)
target_link_libraries(MyExecutable PRIVATE spdlog::spdlog) But I assume it uses system-wide |
AFAIK you can set the path in |
This is true, but currently Metagraph doesn't even install it in the install dir: $ ls install/lib/
cmake libjsoncpp.a libmetagraph-core.a libz.a pkgconfig Do we want to also put |
I'd prefer to have it be linked statically in |
Isn't it already linked statically the way it is written now? I'm not sure what needs to be updated to ensure it. |
Should partially help with #485.