-
Notifications
You must be signed in to change notification settings - Fork 29
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
Rework Dependency Management #150
Comments
I never worked with I think this needs a lot of investigating, but could result in a much simpler project setup. Especially with the internal branches. It may also make it easier to integrate other toolchains like MinGW or Cygwin, since they probably can't work with either the |
Alright, I tried to convert one of my other projects to make use of the There exists some strategies to circumvent this limitation, but this needs more investigating, for which I don't have the time right now. Edit: But my current feeling is that dependency management with CMake is not going to happen. And we should look into other ways of adding dependencies for plugins. |
You can try FetchContent . I use it to fetch and build bullet for one of my cosmocout plugins. Here is a snippet from the CMakeLists.txt. include(FetchContent)
FetchContent_Declare(
bullet
GIT_REPOSITORY https://github.com/bulletphysics/bullet3.git
GIT_TAG 2.89
GIT_PROGRESS TRUE
GIT_SHALLOW TRUE
USES_TERMINAL_DOWNLOAD TRUE
FETCHCONTENT_QUIET OFF
# This doesn't overwrite USE_DOUBLE_PRECISION, why ???
# CMAKE_CACHE_ARGS -DUSE_DOUBLE_PRECISION:BOOL=TRUE
# explained here http://cmake.3232098.n2.nabble.com/Passing-CMake-Arguments-to-FetchContent-td7599242.html
# i have to use set with INTERNAL, see below
)
FetchContent_GetProperties(bullet)
#FetchContent_MakeAvailable(bullet)
if(NOT bullet_POPULATED)
message(STATUS "Populating bullet, please wait...")
#http://cmake.3232098.n2.nabble.com/Passing-CMake-Arguments-to-FetchContent-td7599242.html
set(USE_DOUBLE_PRECISION ON CACHE INTERNAL "" FORCE)
set(BUILD_UNIT_TESTS OFF CACHE INTERNAL "" FORCE)
set(BUILD_CPU_DEMOS OFF CACHE INTERNAL "" FORCE)
set(BUILD_BULLET2_DEMOS OFF CACHE INTERNAL "" FORCE)
if (WIN32)
set(USE_MSVC_RUNTIME_LIBRARY_DLL YES CACHE INTERNAL "" FORCE)
set(INSTALL_LIBS YES CACHE INTERNAL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
else()
set(BUILD_SHARED_LIBS ON CACHE INTERNAL "" FORCE)
endif()
FetchContent_Populate(bullet)
message(STATUS "finished building bullet")
add_subdirectory(${bullet_SOURCE_DIR} ${bullet_BINARY_DIR})
endif()
set(BULLET_INCLUDE_DIRS "${bullet_SOURCE_DIR}/src") If your dependency is a well written cmake project, then you can use a combination of |
Moved here from #149
The text was updated successfully, but these errors were encountered: