Commit 8257dc35 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[CMake] publicize qpoases compile definition

To fix use of `-DHPP_CONSTRAINTS_USE_QPOASES` in dependent project (eg.
hpp-corbaserver) which depend on hpp-constraints through cmake exports
and not .pc files.

Before:
```
$ grep -r HPP_CONSTRAINTS_USE_QPOASES build
build/config.log:_PKG_CONFIG_CFLAGS = -I${includedir} -DHPP_CONSTRAINTS_USE_QPOASES
build/CMakeCache.txt:_PKG_CONFIG_CFLAGS:INTERNAL=-I${includedir} -DHPP_CONSTRAINTS_USE_QPOASES
build/hpp-constraints.pc:Cflags:  -I${includedir} -DHPP_CONSTRAINTS_USE_QPOASES
```

After:
```
>$ grep -r HPP_CONSTRAINTS_USE_QPOASES build
build/build.ninja:  DEFINES = -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_MPL_LIMIT_LIST_SIZE=30 -DBOOST_MPL_LIMIT_VECTOR_SIZE=30 -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_THREAD_DYN_LINK -DHPP_CONSTRAINTS_USE_QPOASES -DHPP_FCL_HAS_OCTOMAP -DHPP_FCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=1 -DOCTOMAP_MINOR_VERSION=9 -DOCTOMAP_PATCH_VERSION=3 -DPINOCCHIO_WITH_HPP_FCL -DPINOCCHIO_WITH_URDFDOM -Dhpp_constraints_EXPORTS
[…]
build/config.log:_PKG_CONFIG_CFLAGS = -I${includedir} -DHPP_CONSTRAINTS_USE_QPOASES
build/CMakeFiles/Export/lib/cmake/hpp-constraints/hpp-constraintsTargets.cmake:  INTERFACE_COMPILE_DEFINITIONS "HPP_CONSTRAINTS_USE_QPOASES"
build/CMakeCache.txt:_PKG_CONFIG_CFLAGS:INTERNAL=-I${includedir} -DHPP_CONSTRAINTS_USE_QPOASES
build/hpp-constraints.pc:Cflags:  -I${includedir} -DHPP_CONSTRAINTS_USE_QPOASES
```
parent c7688745
Pipeline #18159 passed with stage
in 9 minutes and 40 seconds
......@@ -151,6 +151,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC hpp-pinocchio::hpp-pinocchio)
IF(USE_QPOASES)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC ${qpOASES_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${qpOASES_LIBRARIES})
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PUBLIC -DHPP_CONSTRAINTS_USE_QPOASES)
ENDIF(USE_QPOASES)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment