boostorg / boostorg/boost

Trying to build with CMake, but dependency is not maitained with add_subdirectory

Open
#580 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
8.6k
Forks
1.9k
Avg merge
39m
Merged PRs (30d)
2

Description

Hi,

I was trying to build boost with cmake, but I had several errors of the form:
```
CMake Error at libs/date_time/CMakeLists.txt:10 (add_library):
Target "boost_date_time" links to target "Boost::tuple" but the target was
not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?


CMake Error at libs/date_time/CMakeLists.txt:10 (add_library):
Target "boost_date_time" links to target "Boost::function" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
```
Looking at BoostRoot.cmake it seems the for loop at line 224:
```
foreach(__boost_lib_cml IN LISTS __boost_libraries)
...
add_subdirectory(libs/${__boost_lib})
__boost_auto_install(${__boost_lib})
...
endif()
```

does not care about the order of dependencies while doing add_subdirectory. Wouldn't the correct order of add_subdirectory be in accordance with the order in which ${__boost_include_libraries} are listed instead of alphabetical order ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.