[CMake] CMake on Solaris - 2 issues that I can't figure out

David Cole david.cole at kitware.com
Sat Dec 24 08:56:05 EST 2011


What version of CMake are you using?

  cmake --version

should tell you...


On Fri, Dec 23, 2011 at 4:00 PM, bmahf <bmahf at hotmail.com> wrote:
> Hi all,
>
> 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.
>
> Thanks...
>
> --
> View this message in context: http://cmake.3232098.n2.nabble.com/CMake-on-Solaris-2-issues-that-I-can-t-figure-out-tp7122563p7122563.html
> Sent from the CMake mailing list archive at Nabble.com.
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list