See here for information on build/source directories:<br><a href="http://www.paraview.org/Wiki/CMake_FAQ#Out-of-source_build_trees">http://www.paraview.org/Wiki/CMake_FAQ#Out-of-source_build_trees</a><br><br>For your example compiler flag (is that gcc only?) and all other info you've provided so far, you'd probably want to do something like this:<br>
<br>if(CMAKE_CONFIGURATION_TYPES)<br>
set(CMAKE_CONFIGURATION_TYPES Debug Release)<br>
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE
STRING "Reset the configurations to what we need" FORCE)<br>
endif()<br><br>set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D _DEBUG")<br>set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /D _NDEBUG")<br><br>if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CROSSCOMPILING)<br>
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -no-rtti")<br>endif()<br><br>Hope this helps!<br><br><div class="gmail_quote">On Thu, Sep 23, 2010 at 10:50 AM, Andrea Galeazzi <span dir="ltr"><<a href="mailto:galeazzi@korg.it">galeazzi@korg.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">But where could I put the custom options for the compiler, for example in arm-debug I'd like to have<br>
CMAKE_CXX_FLAGS -no-rtti<br>
what do you mean with build directory, the source directory?<br>
<br>
Citando Ryan Pavlik <<a href="mailto:rpavlik@iastate.edu" target="_blank">rpavlik@iastate.edu</a>>:<div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Keep these lines, if they are necessary for your system:<br>
if(CMAKE_CONFIGURATION_TYPES)<br>
set(CMAKE_CONFIGURATION_TYPES Debug Release)<br>
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE<br>
STRING "Reset the configurations to what we need" FORCE)<br>
endif()<br>
<br>
Remove the other lines. In general, for something like this, you'd have<br>
multiple binary/build directories for a single source tree. With a<br>
multi-config generator like Visual Studio, you just would need one build<br>
directory for each platform (win32 and arm). For a single-config generator<br>
like NMake or Unix Makefiles, you'd have one build directory for each<br>
platform-mode pair (win32-release, win32-debug, etc).<br>
<br>
Hope this helps!<br>
<br>
Ryan<br>
<br>
On Thu, Sep 23, 2010 at 9:58 AM, Andrea Galeazzi <<a href="mailto:galeazzi@korg.it" target="_blank">galeazzi@korg.it</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi everybody,<br>
I've got a project with two configuration (Debug and Release) and two<br>
target: win32 and ARM.<br>
In your opinion what's the best way to manage a such kind of project?<br>
As an example, in my CmakeList I have the following piece of code that<br>
works fine only for visual studio.<br>
if(CMAKE_CONFIGURATION_TYPES)<br>
set(CMAKE_CONFIGURATION_TYPES Debug Release)<br>
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE<br>
STRING "Reset the configurations to what we need" FORCE)<br>
set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG")<br>
set(CMAKE_CXX_FLAGS_RELEASE "/D _NDEBUG")<br>
endif()<br>
<br>
What I need is to move this code in another file so I can also specify<br>
similar options for gcc etc......<br>
On the other hand in CMakeList.txt should contain just only the<br>
sources,include path and the other statements not involving the specific<br>
target or configuration.<br>
Cheers<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at:<br>
<a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
</blockquote>
<br>
<br>
<br>
--<br>
Ryan Pavlik<br>
HCI Graduate Student<br>
Virtual Reality Applications Center<br>
Iowa State University<br>
<br>
<a href="mailto:rpavlik@iastate.edu" target="_blank">rpavlik@iastate.edu</a><br>
<a href="http://academic.cleardefinition.com" target="_blank">http://academic.cleardefinition.com</a><br>
Internal VRAC/HCI Site: <a href="http://tinyurl.com/rpavlik" target="_blank">http://tinyurl.com/rpavlik</a><br>
<br>
</blockquote>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ryan Pavlik<br>HCI Graduate Student<br>Virtual Reality Applications Center<br>Iowa State University<br><br><a href="mailto:rpavlik@iastate.edu">rpavlik@iastate.edu</a><br>
<a href="http://academic.cleardefinition.com">http://academic.cleardefinition.com</a><br>Internal VRAC/HCI Site: <a href="http://tinyurl.com/rpavlik">http://tinyurl.com/rpavlik</a><br>