I'm relatively new to cmake, and am trying to use an existing cmake process to compile my company's code on solaris. The last person to do a solaris build in this company left a couple of years ago, and so I don't really have the knowledge of this process at my fingertips.
I have two problems:
1) When the cmake process gets to the place where it's trying to create a shared library from libraries that already exist, I get the following output:
ADD_LIBRARY for library <libname> is used with the SHARED option, but the target platform supports only STATIC libraries. Building it STATIC instead. This may lead to problems.
It is impossible that the target platform solaris cannot be supporting shared libraries. So it seems only reasonable to say that some definition is not properly set to instruct the cmake system that for the solaris platform I want shared libraries.
Has anyone run into this problem? I see a lot of talk online about this, but none of what I am seeing seems to be useful. Unfortunately, I cannot share the build process online, and I don't know enough about cmake to create an example process that does the same.
2) The decision was made to go ahead with the build, even though it was going to be creating statis libraries, and then we would go back and fix that later. So I ran gmake and get to a subproject where the __solaris__ define that I had given didn't propagate.
I have added the command "add_definitions(-D__solaris__)" to the .cmake files picked up by the main project and each of the subprojects. But when I put a "#ifdef __solaris__" followed by a #else, and put a #error in each of these blocks to give a message and abort, I always get the message saying that it didn't find __solaris__ as defined.
Having put the add_definitions call in all projects throughout the solution, I am not sure what is going on here. Does anyone have a suggestion.