Comments (6)
Hi.
This is an actual problem I've run into.
I wanted to use PlayRho with Vcpkg, so I've created a portfile.
But Vcpkg was reporting errors during installation about include directories (COMPONENT
and Library
) that don't exist.
This is when I found out that order of the CMake "keywords" in install()
matters.
My Vcpkg "port" looks like this (I've took one for box2d as an example to create it)
vcpkg.json
{
"name": "playrho",
"version-semver": "1.1.1",
"port-version": 1,
"description": "Real-time oriented physics engine and library that's currently best suited for 2D games. ",
"homepage": "https://louis-langholtz.github.io/PlayRho/",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
portfile.cmake
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO louis-langholtz/PlayRho
REF fd50d14d747d892e26d8d445e123d65b4f37c161 #v1.1.1
SHA512 25a7b403a34aac22e83cc46aff796f39e92f2124e5e3c0ed5a8ba479ce840fba592b7b0216b142e51fb0b4b3c5e33770d0535f78467499e4804717be668c2082
HEAD_REF master
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DPLAYRHO_INSTALL=ON
-DPLAYRHO_BUILD_HELLOWORLD=OFF
-DPLAYRHO_BUILD_UNIT_TESTS=OFF
-DPLAYRHO_BUILD_BENCHMARK=OFF
-DPLAYRHO_BUILD_TESTBED=OFF
)
vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/playrho)
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
from playrho.
@Zbyl Thank you for your interest in PlayRho and for filing this issue!
Looking at the latest CMake Installing Targets help, I see the following usage specification:
install(TARGETS targets... [EXPORT <export-name>]
[RUNTIME_DEPENDENCIES args...|RUNTIME_DEPENDENCY_SET <set-name>]
[[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE|
PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE|FILE_SET <set-name>|CXX_MODULES_BMI]
[DESTINATION <dir>]
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
[NAMELINK_COMPONENT <component>]
[OPTIONAL] [EXCLUDE_FROM_ALL]
[NAMELINK_ONLY|NAMELINK_SKIP]
] [...]
[INCLUDES DESTINATION [<dir> ...]]
)
Reading this now and the issue you had linked, I'm recognizing how having the line
COMPONENT Library
after the
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
line (found in the PlayRho/PlayRho/CMakeLists.txt
file) appears riskier.
I imagine this risk depends though on just how order dependent CMake is, and how greedily CMake evaluates arguments like <dir> ...
- versus keywords. At least based on the above usage however, seems like COMPONENT
is better listed before INCLUDES DESTINATION
as that seems to be closer to the order suggested. Which seems to suggest:
install(TARGETS PlayRho
EXPORT PlayRho-targets
COMPONENT Library
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
Are you actually running into a problem with this, or just reporting this riskiness?
I ask in part because none of my manual testing had detected this being a problem. CMake seems too fragile to me however and the usage specification suggests it could be a problem. I'd like to see the parse tree CMake builds out of this CMakeLists.txt
file but the best I'm finding is the output of CMake with --trace-expand
.
from playrho.
Need to also back port changes from #488 into release-1.1.
from playrho.
@Zbyl Thank you again. That's very appreciated insight & your vcpkg port is also super appreciated!
I have merged a change to master to address this. I intend to back port this next to the release 1.1 branch and associated release.
from playrho.
v1.1.2 has been released now with the change in it to address this. Hopefully it fixes this problem and doesn't introduce any new ones. Please let me know what your experience with it is. Thanks again.
from playrho.
Gonna assume this is fixed now.
from playrho.
Related Issues (20)
- ToSigned shouldn't be under playrho::d2
- Bug in cmake install: not all necessary headers get installed
- API documentation publication not part of CI HOT 1
- Make use of new allocator stats support
- Testbed, UnitTests, Benchmark require git recursive clone
- Pass values from the ShapeConf to other (sub)shape configs HOT 2
- Set multiple shapes to BodyConf at once HOT 3
- No GetShapes function HOT 4
- Incomplete equality operator for Body HOT 2
- Missing properties for BodyConf HOT 7
- Extend WorldBody methods HOT 5
- Should caches be compared in the equality operator for the world? HOT 2
- Missing getters and setters for flags and inv_dt0 (for serialization purposes) HOT 1
- Ability to manually create a Contact (for serialization purposes) HOT 2
- Wrong position for transformation HOT 5
- No equivalent "IsDestroyed" method in World interface HOT 6
- Incorrect manifolds when deserializing/recreating the World state HOT 2
- GetContacts GetBodies GetJoints but no GetShapes inconsistency
- Just two very similar functions HOT 4
- Make UnitVec initializing constructor public HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playrho.