On Mon, Dec 1, 2008 at 10:52 AM, cyril_wobow <span dir="ltr">&lt;<a href="mailto:cyril@wobow.com">cyril@wobow.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It&#39;s my understanding that you are trying to declare two &quot;solutions&quot; p1 and p2 (using visual studio&#39;s terminology).<br>
The source_group() calls affects the next &quot;project&quot; declaration (which is done with add_executable() or add_library()) in the cmake module where they occur .</blockquote></div><br>That is indeed how I would expect it to work, but that&#39;s not what is happening. Below is the actual CMake code I&#39;m using to generate projects:<br>
<br><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">macro( component project_name )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; cmake_minimum_required( VERSION 2.6 )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; set_include_directories()</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; add_definitions( -DBOOST_ALL_NO_LIB )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; project( ${project_name}_test )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file( GLOB_RECURSE testsrc test/*.[chi]pp )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add_executable( ${project_name}_test ${testsrc} )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; else()</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; message( &quot;WARNING: No unit test found for component vfx/${project_name}&quot; )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; endif()</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; project( ${project_name} )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; file( GLOB_RECURSE inc RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.[chi]pp )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; file( GLOB_RECURSE src RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} source/*.[chi]pp )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; foreach( file ${inc};${src} )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get_filename_component( path ${file} PATH )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string( REPLACE / \\ group ${path} )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source_group( ${group} FILES ${file} )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; endforeach()</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">endmacro()</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">macro( library_component project_name )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; component( ${project_name} )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">&nbsp;&nbsp;&nbsp; add_library( ${project_name} STATIC ${inc};${src} )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">endmacro()</span><br>
<br>Inside of another CMakeLists.txt file in a different subdirectory, I&#39;ll call <b><span style="font-family: courier new,monospace;">library_component( ProjectName )</span></b>. Is this a bug in CMake or am I just doing this incorrectly? Help would be appreciated! Thank you.<br>