You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our team develop a big project with many modules, I have organized the modules by cmake-packages. A module generates a package with include, lib files and FindXXX.cmake file. The module users use find_package to find the package.
The script finds lib and include files from the cmake environment variable CONAN_RPC_ROOT, but CONAN_RPC_ROOT in workspace-mode is the source code directory itself whose tree graph is not consistent with the build directory. To make find_package(RPC) OK, CONAN_RPC_ROOT must be:
-include/...
-lib/...
-proto/...
-python/...
These files are generate by the install statements in the rpc/CMakeList.txt, just like:
To handle with conan-workspace, I changed my FindRPC.cmake like this:
if (DEFINED CONAN_INCLUDE_DIRS_RPC)
set(RPC_INCLUDE_DIRS "${CONAN_INCLUDE_DIRS_RPC}")
else()
find_path(RPC_INCLUDE_DIRS
NAMES header.pb.h
PATHS ${CONAN_RPC_ROOT}/include
NO_DEFAULT_PATH)
endif()
if (DEFINED CONAN_LIB_DIRS_RPC)
set(RPC_LIBRARIES "${CONAN_LIB_DIRS_RPC})")
else()
find_library(RPC_LIBRARIES
NAME rpc_proto
PATHS ${CONAN_RPC_ROOT}/lib
NO_DEFAULT_PATH)
if (NOT RPC_LIBRARIES)
message(FATAL_ERROR "RPC_LIBRARIES NOT FOUND")
endif()
endif()
I found the cmake variables CONAN_INCLUDE_DIRS_RPC and CONAN_LIB_DIRS_RPC generated by 'conan workspace install' . I try to use them but it still doesn't work. The build folder tree graph is not consistent with the install directory.
source dir like:
src/proto/xxx.proto
build dir like:
src/proto/xxx.pb.h
src/proto/xxx.pb.cc
src/proto/xxx.proto
src/proto/xxx_pb2.py
lib/libxxx.so
after install :
include/xxx.pb.h
proto/xxx.proto
python/xxx_pb2.py
lib/libxxx.so
Are there any easy ways to use my self-defined install statements in my CMakeLists.txt with conan-workspace?
The text was updated successfully, but these errors were encountered:
Dont know if that helps: Workspaces are experimental and very limited. In our company, instead of using workspaces, we manually remove the concerned requirements from the conanfile and use cmake to create and link the libraries. I explained that in #6844.
Our team develop a big project with many modules, I have organized the modules by cmake-packages. A module generates a package with include, lib files and FindXXX.cmake file. The module users use find_package to find the package.
Now I want to use conan workspace to make the workflow better, reference:
https://docs.conan.io/en/latest/developing_packages/workspaces.html
I found the workspace mode can not work perfect with the cmake-install.
For example, my findXXX.cmake just like:
The script finds lib and include files from the cmake environment variable CONAN_RPC_ROOT, but CONAN_RPC_ROOT in workspace-mode is the source code directory itself whose tree graph is not consistent with the build directory. To make find_package(RPC) OK, CONAN_RPC_ROOT must be:
-include/...
-lib/...
-proto/...
-python/...
These files are generate by the install statements in the rpc/CMakeList.txt, just like:
To handle with conan-workspace, I changed my FindRPC.cmake like this:
I found the cmake variables CONAN_INCLUDE_DIRS_RPC and CONAN_LIB_DIRS_RPC generated by 'conan workspace install' . I try to use them but it still doesn't work. The build folder tree graph is not consistent with the install directory.
source dir like:
src/proto/xxx.proto
build dir like:
src/proto/xxx.pb.h
src/proto/xxx.pb.cc
src/proto/xxx.proto
src/proto/xxx_pb2.py
lib/libxxx.so
after install :
include/xxx.pb.h
proto/xxx.proto
python/xxx_pb2.py
lib/libxxx.so
Are there any easy ways to use my self-defined install statements in my CMakeLists.txt with conan-workspace?
The text was updated successfully, but these errors were encountered: