[CMake] need help with modified helloworld

Clark J. Wang dearvoid at gmail.com
Wed Jul 25 01:05:10 EDT 2007


On 7/25/07, Andy Dingfelder <DingfelderA at sirtrack.com> wrote:
>
> I'm wondering if someone could help me with a simple change to the
> helloworld example
>
> I have gotten the helloworld to work with either windows output or
> linux output, by changing the base CMakeLists.txt file but am struggling
> on how to build both
>
> the current example is set up as follows:
>
> CMakeExample/Hello
> CMakeExample/Demo
> CMakeExample/Build
> CMakeExample/CmakeLists.txt
>
> My goal is to set up my system something like this:
>
> CMakeExample/src/Hello
> CMakeExample/src/Demo
> CMakeExample/lib     <-- not sure if I need this?
> CMakeExample/linuxBuild/CmakeLists.txt
> CMakeExample/windowsBuild/CmakeLists.txt


CMakeLists.txt should be put under the topmost directory of your project.
And since CMake is a cross-platform make, you need not use two different
CMakeLists.txt for Linux and Windows.

It seems that the only difference between the CmakeLists.txt file for
> linux and windows is that the windows one has
> SET(CMAKE_C_COMPILER i686-mingw32-gcc)
> SET(CMAKE_CXX_COMPILER i686-mingw32-g++)
> while the linux one uses the default
>
> basically I want the helloworld example but running "out of source
> directory"
>
> thoughts?
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> WARNING: This email and any attachments may be confidential and/or
> privileged. They are intended for the addressee only and are not to be
> read,
> used, copied or disseminated by anyone receiving them in error.  If you
> are
> not the intended recipient, please notify the sender by return email and
> delete this message and any attachments.
>
> The views expressed in this email are those of the sender and do not
> necessarily reflect the official views of Landcare Research.
>
> SirTrack
> http://www.sirtrack.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070725/86544a4e/attachment.html


More information about the CMake mailing list