I'm trying to migrate from Visual Studio towards Jetbrains' (awesome) CLion IDE which uses CMake to organize the projects.
Until now, the transition has been smooth: creating CMake projects and importing them into CLion is easy, and I can begin coding on one plateform then continue on another one without problems.
However, one aspect of Visual Studio that I couldn't find an equivalent to in CMake is property sheets: I use them mainly for holding the include directories' paths and the linking libs for libraries (i.e. one .vsprops
file for each library, e.g. OpenCV.vsprops
, Boost.vsprops
, etc.).
This way, in VS, I could share a library's .vsprops
file between different projects without having to configure the paths/libs each time.
Does CMake have a similar mechanism to Visual Studio's property sheets ? How is it possible to store a library's includes/libs in a CMake-parsable file then "import" it in CMakeLists.txt in order to link against the library ?
Basically, what I want to do is:
- Create a "cmake property sheet" (for lack of a better name) for a given library.
- Then, in CMakeLists.txt, write something like
link_target_to_libs(myTarget "path/to/propertySheet1" "path/to/propertySheet2" ...)
.