<br>
<br><br><div class="gmail_quote">On Mon, Dec 20, 2010 at 11:54 PM, Ryan Pavlik <span dir="ltr"><<a href="mailto:rpavlik@iastate.edu">rpavlik@iastate.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
It seems you might be "over-analyzing" the conversion: makefiles are much lower-level than well-written cmake build systems. I would suggest you start with the CMake tutorial [1], then start from scratch on the build system for this code. Think at a high level, about what files turn into what executables and libraries - my experience has been that the most time-consuming task of creating a cmake-based build system is creating the modules to find dependencies, not the actual creation of the basic build itself. ls *.cpp *.h | sort | pbcopy is a handy command on the mac - you can then just "paste" and have a list of the c++ source files from a directory. (I'll stop you ahead of time: don't use file(GLOB) - it is not the right solution.) Also, don't put anything in your cmakelists.txt files that is system-specific: the purpose of these files is to handle configuring and building on a number of different machines, with the idea that the user/developer configures the system-specific settings in the cmake gui.<div>
<br></div><div>If you do this and still have issues, we'll need to see more of the build system files (cmakelists.txt files) to be able to help.</div><div><br></div><div>Ryan<br><div><br></div></div></blockquote><div>
<br></div><div>thanks. as for now I from experimenting w/ </div><div><br></div><div>[1] <a href="http://www.cmake.org/cmake/help/cmake_tutorial.html" target="_blank">http://www.cmake.org/cmake/help/cmake_tutorial.html</a></div>
<div><br></div><div>the culprit was the line <i>CPPFLAGS <span class="Apple-tab-span" style="white-space:pre">        </span>= -g -c -Wall -arch i386</i> </div><div>left inside CMakeLists.txt, (more relevant to a makefile).<br>
It still does not compile, there is a linking issue, <br>but I am not far from a 4/4 (parts) compilation. will check it 'n </div><div>let you know</div><meta charset="utf-8"><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div><div class="gmail_quote"><div><div></div><div class="h5">On Mon, Dec 20, 2010 at 4:34 PM, ny <span dir="ltr"><<a href="mailto:nikos.yiotis@gmail.com" target="_blank">nikos.yiotis@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
<span style="border-collapse:collapse;font-family:arial, sans-serif"><h1 style="font-family:arial, sans-serif;font-size:16px;margin-top:12px;margin-right:5px;margin-bottom:5px;margin-left:10px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;color:rgb(0, 0, 0);background:inherit;border-right:inherit">
<span style="font-size:12px;font-weight:normal">greetings!<br><br>I am trying to build research code written in (templated) c++, size<br>is approximately ~15K lines.<br>
<br>The code was never been tested on a mac, not to mention snow leopard.<br></span><span style="font-size:12px;font-weight:normal">I have the guarantee that it compiles + builds for win + linux.<br>
</span><span style="font-size:12px;font-weight:normal">Project was a collaborative effort and unfortunately I am stuck without a <br></span><span style="font-size:12px;font-weight:normal">makefile =P and with the ugly *.vcproj file.</span></h1>
<h1 style="font-family:arial, sans-serif;font-size:16px;margin-top:12px;margin-right:5px;margin-bottom:5px;margin-left:10px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;color:rgb(0, 0, 0);background:inherit;border-right:inherit">
<span style="font-size:12px;font-weight:normal">Note that I did not use an automated ruby script I found for<br>the translation of *.vcproj to makefile, since the script only<br>handled the basics -> no pre/post-build steps or file-specific flags are<br>
included;<br>instead, I translated from scratch to CMakelists and then converted to<br>makefile. not that tricky as it sounds..<br><br>So, assuming the problem is w/ the makefile, why do I have a clean<br>makefile during the configuration/generation steps?<br>
Note that I choose to generate Unix makefile, not an xcode project.<br><br>I 've successfully translated the *.vcproj file into a makefile,<br>fixed a few issues, linked to external libs, but the build w/ make fails and<br>
I get<br><br><i>i686-apple-darwin10-g++-4.2.1: g++: No such file or directory<br>make[2]: *** [CMakeFiles/.../.../...cpp.o] Error 1<br>make[1]: *** [CMakeFiles/.../.../all] Error 2<br>make: *** [all] Error 2<br></i><br>which, honestly, I don't remember seeing before -> complaining about <br>
g++ I mean and not missing file or dir. Note that g++ *is* in place, I can<br>successfully compile other programs.<br></span><span style="font-size:13px;font-weight:normal"><br></span></h1><h1 style="font-family:arial, sans-serif;font-size:16px;margin-top:12px;margin-right:5px;margin-bottom:5px;margin-left:10px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;color:rgb(0, 0, 0);background:inherit;border-right:inherit">
<span style="font-size:13px;font-weight:normal">Assuming that /usr/bin was somehow not in the path during the cmake invocation,<br></span><span style="font-size:13px;font-weight:normal">I used </span></h1>
<div><span style="font-size:12px;font-weight:normal"><span style="font-size:13px"><div><i><br></i></div><div><i>set(CMAKE_C_COMPILER /usr/bin/gcc)</i></div><div><i>set(CMAKE_CXX_COMPILER /usr/bin/g++)</i></div>
<div><br></div><div>in the beginning of my CMakeList.txt without any luck. </div><div>It complained temporarily for a conflict, i.e. had to reset the cache,</div><div>but no progress so far. I</div></span></span></div><h1 style="font-family:arial, sans-serif;font-size:16px;margin-top:12px;margin-right:5px;margin-bottom:5px;margin-left:10px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;color:rgb(0, 0, 0);background:inherit;border-right:inherit">
<span style="font-size:12px;font-weight:normal"><br><br>I am stuck a few hours now and I suspect (or better hope) that the<br></span><span style="font-size:12px;font-weight:normal">problem is sth similar to the typical 32-bit/64-bit problem in mac<br>
</span><span style="font-size:12px;font-weight:normal">ports. I tried w/ -arch i386 -m32 flags without any luck, so I 'd love to <br></span><span style="font-size:12px;font-weight:normal">hear any thoughts, ideas..</span></h1>
<h1 style="font-family:arial, sans-serif;font-size:16px;margin-top:12px;margin-right:5px;margin-bottom:5px;margin-left:10px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;color:rgb(0, 0, 0);background:inherit;border-right:inherit">
<span style="font-size:12px;font-weight:normal"><br>I guess there are parts of the code need to be re-written especially<br>for OS X SL, but I cannot figure out the problem since the failing error is not<br>
descriptive enough.<br><br>When I build a xcodeproj (with g++ flag -arch i386), I get:<br><br><i>lipo: can't figure out the architecture type of: /var/folders/9b/<br>9b2CWG5gHvCi5hawjO4o5E+++TI/-Tmp-//ccXHDX6t.out<br>
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1<br></i><br>When I build a xcodeproj (with g++ flag -arch x86_64), I get:<br><br><i>setenv LANG en_US.US-ASCII<br>/Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -<br>
pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -mdynamic-no-<br>pic -DCMAKE_INTDIR="Debug" -isysroot /Developer/SDKs/MacOSX10.6.sdk -<br>mmacosx-version-min=10.6 -gdwarf-2 -Wmost -Wno-four-char-constants -<br>
Wno-unknown-pragmas //... ...<br>i686-apple-darwin10-gcc-4.2.1: g++: No such file or directory<br>Command /Developer/usr/bin/gcc-4.2 failed with exit code 1</i><br><br>all cryptic..<br><br>Finally, although developing on a mac, I do not use Cocoa(/xcode)<br>
that uses otool to find any required shared libraries. So from the<br>command line I don't have to care about otool and instead I use the ldd.<br><br>thanks for any help!<br><br>ps. note that I am building from command line without xcode<br>
and the -pedantic flag I use is not the reason of the failure</span></h1></span><div dir="ltr"><div style="padding-top:10px;padding-right:0pt;padding-bottom:5px;padding-left:0pt"><div dir="ltr"><div style="padding-top:10px;padding-right:0pt;padding-bottom:5px;padding-left:0pt">
<br></div></div></div></div>
<br></div></div><div class="im">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <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: <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></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" 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>
</div></div>
</blockquote></div><br>