forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bullet3] Revise, enable Bullet3 libs (microsoft#43095)
- Loading branch information
Showing
13 changed files
with
661 additions
and
533 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index a695b71..8c407de 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1,4 +1,4 @@ | ||
-cmake_minimum_required(VERSION 2.4.3) | ||
+cmake_minimum_required(VERSION 3.11) | ||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) | ||
cmake_policy(SET CMP0017 NEW) | ||
#this line has to appear before 'PROJECT' in order to be able to disable incremental linking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/Bullet3OpenCL/CMakeLists.txt b/src/Bullet3OpenCL/CMakeLists.txt | ||
index b93b80b..c9c985c 100644 | ||
--- a/src/Bullet3OpenCL/CMakeLists.txt | ||
+++ b/src/Bullet3OpenCL/CMakeLists.txt | ||
@@ -1,3 +1,8 @@ | ||
+option(BUILD_OPENCL "Build Bullet3OpenCL_clew") | ||
+if(NOT BUILD_OPENCL) | ||
+ return() | ||
+endif() | ||
+ | ||
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src ) | ||
|
||
ADD_DEFINITIONS(-DB3_USE_CLEW) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
diff --git a/BulletConfig.cmake.in b/BulletConfig.cmake.in | ||
index 2d18304..9d97c77 100644 | ||
--- a/BulletConfig.cmake.in | ||
+++ b/BulletConfig.cmake.in | ||
@@ -15,6 +15,10 @@ | ||
# BULLET_VERSION_STRING - A human-readable string containing the version | ||
|
||
@PACKAGE_INIT@ | ||
+if("@BUILD_EXTRAS@" AND NOT "@BUILD_SHARED_LIBS@") | ||
+ include(CMakeFindDependencyMacro) | ||
+ find_dependency(tinyxml2 CONFIG) | ||
+endif() | ||
include("${CMAKE_CURRENT_LIST_DIR}/BulletTargets.cmake") | ||
|
||
set ( BULLET_FOUND 1 ) | ||
diff --git a/Extras/Serialize/BulletXmlWorldImporter/CMakeLists.txt b/Extras/Serialize/BulletXmlWorldImporter/CMakeLists.txt | ||
index 4e16d9e..ab8eb9d 100644 | ||
--- a/Extras/Serialize/BulletXmlWorldImporter/CMakeLists.txt | ||
+++ b/Extras/Serialize/BulletXmlWorldImporter/CMakeLists.txt | ||
@@ -2,7 +2,6 @@ INCLUDE_DIRECTORIES( | ||
${BULLET_PHYSICS_SOURCE_DIR}/src | ||
${BULLET_PHYSICS_SOURCE_DIR}/Extras/Serialize/BulletFileLoader | ||
${BULLET_PHYSICS_SOURCE_DIR}/Extras/Serialize/BulletWorldImporter | ||
- ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/tinyxml2 | ||
) | ||
|
||
ADD_LIBRARY( | ||
@@ -11,8 +10,9 @@ ADD_LIBRARY( | ||
btBulletXmlWorldImporter.h | ||
string_split.cpp | ||
string_split.h | ||
- ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/tinyxml2/tinyxml2.cpp | ||
) | ||
+find_package(tinyxml2 CONFIG REQUIRED) | ||
+target_link_libraries(BulletXmlWorldImporter PRIVATE tinyxml2::tinyxml2) | ||
|
||
SET_TARGET_PROPERTIES(BulletXmlWorldImporter PROPERTIES VERSION ${BULLET_VERSION}) | ||
SET_TARGET_PROPERTIES(BulletXmlWorldImporter PROPERTIES SOVERSION ${BULLET_VERSION}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
Bullet3 provides CMake targets: | ||
bullet3 provides CMake targets: | ||
|
||
find_package(Bullet CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE ${BULLET_LIBRARIES}) | ||
find_package(Bullet CONFIG REQUIRED) | ||
# specific set: BulletSoftBody, BulletDynamics, BulletInverseDynamics, | ||
# BulletCollision, Bullet3Common, LinearMath | ||
target_link_libraries(main PRIVATE ${BULLET_LIBRARIES}) | ||
# individual imported targets, e.g. for Bullet 3 libs | ||
target_link_libraries(main PRIVATE Bullet3Dynamics) | ||
|
||
bullet3 provides pkg-config modules: | ||
|
||
# specific set: BulletSoftBody, BulletDynamics, BulletCollision, LinearMath | ||
bullet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO bulletphysics/bullet3 | ||
REF 3.25 | ||
SHA512 7086e5fcf69635801bb311261173cb8d173b712ca1bd78be03df48fad884674e85512861190e45a1a62d5627aaad65cde08c175c44a3be9afa410d3dfd5358d4 | ||
HEAD_REF master | ||
) | ||
|
||
vcpkg_find_acquire_program(PKGCONFIG) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${CURRENT_PORT_DIR}/project" | ||
OPTIONS | ||
"-DSOURCE_PATH=${SOURCE_PATH}" | ||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" | ||
) | ||
vcpkg_cmake_build() |
24 changes: 24 additions & 0 deletions
24
scripts/test_ports/vcpkg-ci-bullet3/project/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(bullet3-test CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
block() | ||
find_package(Bullet CONFIG REQUIRED) | ||
|
||
add_executable(main "${SOURCE_PATH}/examples/HelloWorld/HelloWorld.cpp") | ||
target_link_libraries(main PRIVATE ${BULLET_LIBRARIES}) | ||
endblock() | ||
|
||
if(WIN32) | ||
set(unused "${PKG_CONFIG_EXECUTABLE}") | ||
return() | ||
endif() | ||
|
||
block() | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(bullet bullet REQUIRED IMPORTED_TARGET) | ||
|
||
add_executable(main-pkgconfig "${SOURCE_PATH}/examples/HelloWorld/HelloWorld.cpp") | ||
target_link_libraries(main-pkgconfig PRIVATE PkgConfig::bullet) | ||
endblock() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "vcpkg-ci-bullet3", | ||
"version-string": "ci", | ||
"description": "Port to force features of bullet3 within CI", | ||
"homepage": "https://github.com/microsoft/vcpkg", | ||
"license": "MIT", | ||
"dependencies": [ | ||
"bullet3", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
} | ||
], | ||
"default-features": [ | ||
"extras", | ||
{ | ||
"name": "opencl", | ||
"platform": "!uwp" | ||
} | ||
], | ||
"features": { | ||
"extras": { | ||
"description": "bullet3[extras]", | ||
"dependencies": [ | ||
{ | ||
"name": "bullet3", | ||
"features": [ | ||
"extras" | ||
] | ||
} | ||
] | ||
}, | ||
"opencl": { | ||
"description": "bullet3[opencl]", | ||
"dependencies": [ | ||
{ | ||
"name": "bullet3", | ||
"features": [ | ||
"opencl" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters