Re: [CMake] Can't get include() to work!
Robert Dailey wrote: The problem isn't about MAC line endings not working. I could care less about line ending requirements, I'll go with whatever works. The main problem I have is that CMake didn't TELL me what the problem was. It should have said, Hey dummy, your line endings are unacceptable. Please change them to LINUX line endings. That would have saved me hours of time! Sure, it is just that you are the very first person to run into this in the last 8 years. I am curious how you created the file. I will try to come up with a way to detect mac files and issue an error. -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Thu, Dec 4, 2008 at 6:53 AM, Bill Hoffman [EMAIL PROTECTED]wrote: Robert Dailey wrote: The problem isn't about MAC line endings not working. I could care less about line ending requirements, I'll go with whatever works. The main problem I have is that CMake didn't TELL me what the problem was. It should have said, Hey dummy, your line endings are unacceptable. Please change them to LINUX line endings. That would have saved me hours of time! Sure, it is just that you are the very first person to run into this in the last 8 years. I am curious how you created the file. I will try to come up with a way to detect mac files and issue an error. I used Notepad++ to edit my file. I didn't change line endings manually, so MAC must be set as the default for some reason. Notepad++ has some great syntax highlighting for CMake scripts. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
Robert Dailey wrote: Well, good news and bad news on this subject. The good news is that I managed to get my includes working in my initial case. I had my includes.cmake file in the wrong directory The bad news is now I'm having another issue with include(), and this time I DO have my cmake files in the correct directory. I have a file called utility.cmake which has a couple of Boost CMake utility functions in it that I'm borrowing, PARSE_ARGUMENTS() being one of them. When I do include( utility.cmake ) it works fine and I get no errors when I include it, however when I try to call parse_arguments() in the CMakeLists.txt file that's performing the include() it says: /*Unknown CMake command parse_arguments.*/ Any idea why it can't find that macro? Maybe it finds the wrong utility.cmake file? Try adding some message(here) type stuff to make sure the correct files are being loaded. With cmake 2.6.2 you can run cmake --trace to see all the files and commands as they are run by cmake. Should help you find the problem pretty quick. -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Wed, Dec 3, 2008 at 1:18 PM, Bill Hoffman [EMAIL PROTECTED]wrote: Maybe it finds the wrong utility.cmake file? Try adding some message(here) type stuff to make sure the correct files are being loaded. With cmake 2.6.2 you can run cmake --trace to see all the files and commands as they are run by cmake. Should help you find the problem pretty quick. I did as you suggested and added a message() call inside of utility.cmake and I see it printed when I run CMake. So this means I'm loading the correct file then? ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Wed, Dec 3, 2008 at 1:55 PM, Bill Hoffman [EMAIL PROTECTED]wrote: Did you try the --trace? Maybe a spelling error? Please post a complete small example that shows the problem if none of that helps. Below is the relevant portion of the output from --trace. It's a bit hard to read, but notice that after the include( utility.cmake ) line there is no code included. Odd. C:/IT/work/jewett/CMakeLists.txt(1): cmake_minimum_required(VERSION 2.6 ) C:/IT/work/jewett/CMakeLists.txt(5): set(third_party ${CMAKE_CURRENT_SOURCE_DIR}/third_party ) C:/IT/work/jewett/CMakeLists.txt(7): add_subdirectory(vfx ) C:/IT/work/jewett/vfx/CMakeLists.txt(1): cmake_minimum_required(VERSION 2.6 ) C:/IT/work/jewett/vfx/CMakeLists.txt(3): project(vfx ) C:/IT/work/jewett/vfx/CMakeLists.txt(5): include(utility.cmake ) C:/IT/work/jewett/vfx/CMakeLists.txt(6): include(include_directories.cmake ) C:/IT/work/jewett/vfx/include_directories.cmake(1): set(include_directories ${third_party}/.. ${thi rd_party}/boost/1_36_0 ${third_party}/boost/sandbox/channel ${third_party}/boost/sandbox/chrono ${th ird_party}/boost/sandbox/dataflow ${third_party}/boost/sandbox/dispatcher ${third_party}/boost/sandb ox/extension ${third_party}/boost/sandbox/flyweight ${third_party}/boost/sandbox/move ${third_party} /boost/sandbox/tree ${third_party}/boost/sandbox/unique_ptr ${third_party}/cg/include ${third_party} /Eigen ${third_party}/EMotionFX/Source ${third_party}/fmod/include ${third_party}/FreeImage ${third_ party}/glew ${third_party}/glib/include ${third_party}/glibmm/include ${third_party}/glut ${third_pa rty}/iconv/include ${third_party}/libRocket/include ${third_party}/libxml2/include ${third_party}/li bxml++/include ${third_party}/OpenSSL/include ${third_party}/python/inc ${third_party}/tbb/21_200806 05oss/include ${third_party}/VisualLeakDetector/include ${third_party}/zlib/include ) C:/IT/work/jewett/vfx/CMakeLists.txt(7): include(link_directories.cmake ) C:/IT/work/jewett/vfx/link_directories.cmake(1): set(link_directories ${third_party}/boost/1_36_0/l ib ${third_party}/cg/lib ${third_party}/EMotionFX/Bin ${third_party}/EMotionFX/Core/Bin ${third_part y}/fmod/lib ${third_party}/FreeImage ${third_party}/glew ${third_party}/glib/lib ${third_party}/glib mm/lib ${third_party}/glut ${third_party}/iconv/lib ${third_party}/libRocket/bin ${third_party}/libx ml2/lib ${third_party}/libxml++/lib ${third_party}/python/lib ${third_party}/zlib/lib ) C:/IT/work/jewett/vfx/CMakeLists.txt(11): macro(create_test project_name ) C:/IT/work/jewett/vfx/CMakeLists.txt(22): macro(component project_name ) C:/IT/work/jewett/vfx/CMakeLists.txt(43): macro(library_component project_name ) C:/IT/work/jewett/vfx/CMakeLists.txt(60): macro(executable_component project_name libraries ) C:/IT/work/jewett/vfx/CMakeLists.txt(69): add_subdirectory(messenger ) C:/IT/work/jewett/vfx/messenger/CMakeLists.txt(1): library_component(messenger ) CMake Error at vfx/CMakeLists.txt:44 (parse_arguments): Unknown CMake command parse_arguments. Call Stack (most recent call first): vfx/messenger/CMakeLists.txt:1 (library_component) -- Configuring incomplete, errors occurred! ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Wed, Dec 3, 2008 at 2:19 PM, Bill Hoffman [EMAIL PROTECTED]wrote: Robert Dailey wrote: On Wed, Dec 3, 2008 at 1:55 PM, Bill Hoffman [EMAIL PROTECTED]mailto: [EMAIL PROTECTED] wrote: Did you try the --trace? Maybe a spelling error? Please post a complete small example that shows the problem if none of that helps. Below is the relevant portion of the output from --trace. It's a bit hard to read, but notice that after the include( utility.cmake ) line there is no code included. Odd. Do you still have the message in the utility.cmake? That should show up in the trace?? lol. I actually removed it on accident. I can't seem to get this right, sorry. Below is the trace output with the message() back in: C:/IT/work/jewett/CMakeLists.txt(1): cmake_minimum_required(VERSION 2.6 ) C:/IT/work/jewett/CMakeLists.txt(5): set(third_party ${CMAKE_CURRENT_SOURCE_DIR}/third_party ) C:/IT/work/jewett/CMakeLists.txt(7): add_subdirectory(vfx ) C:/IT/work/jewett/vfx/CMakeLists.txt(1): cmake_minimum_required(VERSION 2.6 ) C:/IT/work/jewett/vfx/CMakeLists.txt(3): project(vfx ) C:/IT/work/jewett/vfx/CMakeLists.txt(5): include(utility.cmake ) C:/IT/work/jewett/vfx/utility.cmake(1): message(utility.cmake loaded ) utility.cmake loaded C:/IT/work/jewett/vfx/CMakeLists.txt(6): include(include_directories.cmake ) C:/IT/work/jewett/vfx/include_directories.cmake(1): set(include_directories ${third_party}/.. ${thi rd_party}/boost/1_36_0 ${third_party}/boost/sandbox/channel ${third_party}/boost/sandbox/chrono ${th ird_party}/boost/sandbox/dataflow ${third_party}/boost/sandbox/dispatcher ${third_party}/boost/sandb ox/extension ${third_party}/boost/sandbox/flyweight ${third_party}/boost/sandbox/move ${third_party} /boost/sandbox/tree ${third_party}/boost/sandbox/unique_ptr ${third_party}/cg/include ${third_party} /Eigen ${third_party}/EMotionFX/Source ${third_party}/fmod/include ${third_party}/FreeImage ${third_ party}/glew ${third_party}/glib/include ${third_party}/glibmm/include ${third_party}/glut ${third_pa rty}/iconv/include ${third_party}/libRocket/include ${third_party}/libxml2/include ${third_party}/li bxml++/include ${third_party}/OpenSSL/include ${third_party}/python/inc ${third_party}/tbb/21_200806 05oss/include ${third_party}/VisualLeakDetector/include ${third_party}/zlib/include ) C:/IT/work/jewett/vfx/CMakeLists.txt(7): include(link_directories.cmake ) C:/IT/work/jewett/vfx/link_directories.cmake(1): set(link_directories ${third_party}/boost/1_36_0/l ib ${third_party}/cg/lib ${third_party}/EMotionFX/Bin ${third_party}/EMotionFX/Core/Bin ${third_part y}/fmod/lib ${third_party}/FreeImage ${third_party}/glew ${third_party}/glib/lib ${third_party}/glib mm/lib ${third_party}/glut ${third_party}/iconv/lib ${third_party}/libRocket/bin ${third_party}/libx ml2/lib ${third_party}/libxml++/lib ${third_party}/python/lib ${third_party}/zlib/lib ) C:/IT/work/jewett/vfx/CMakeLists.txt(11): macro(create_test project_name ) C:/IT/work/jewett/vfx/CMakeLists.txt(22): macro(component project_name ) C:/IT/work/jewett/vfx/CMakeLists.txt(43): macro(library_component project_name ) C:/IT/work/jewett/vfx/CMakeLists.txt(60): macro(executable_component project_name libraries ) C:/IT/work/jewett/vfx/CMakeLists.txt(69): add_subdirectory(messenger ) C:/IT/work/jewett/vfx/messenger/CMakeLists.txt(1): library_component(messenger ) CMake Error at vfx/CMakeLists.txt:44 (parse_arguments): Unknown CMake command parse_arguments. Call Stack (most recent call first): vfx/messenger/CMakeLists.txt:1 (library_component) -- Configuring incomplete, errors occurred! ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
Robert Dailey wrote: lol. I actually removed it on accident. I can't seem to get this right, sorry. Below is the trace output with the message() back in: C:/IT/work/jewett/CMakeLists.txt(1): cmake_minimum_required(VERSION 2.6 ) C:/IT/work/jewett/CMakeLists.txt(5): set(third_party ${CMAKE_CURRENT_SOURCE_DIR}/third_party ) C:/IT/work/jewett/CMakeLists.txt(7): add_subdirectory(vfx ) C:/IT/work/jewett/vfx/CMakeLists.txt(1): cmake_minimum_required(VERSION 2.6 ) C:/IT/work/jewett/vfx/CMakeLists.txt(3): project(vfx ) C:/IT/work/jewett/vfx/CMakeLists.txt(5): include(utility.cmake ) C:/IT/work/jewett/vfx/utility.cmake(1): message(utility.cmake loaded ) utility.cmake loaded C:/IT/work/jewett/vfx/CMakeLists.txt(6): include(include_directories.cmake ) Seems to be the only thing in the file. Maybe it would help if you posted utility.cmake... -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Wed, Dec 3, 2008 at 2:33 PM, Bill Hoffman [EMAIL PROTECTED]wrote: Seems to be the only thing in the file. Maybe it would help if you posted utility.cmake... It's attached. utility.cmake Description: Binary data ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
Robert Dailey wrote: On Wed, Dec 3, 2008 at 2:33 PM, Bill Hoffman [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Seems to be the only thing in the file. Maybe it would help if you posted utility.cmake... It's attached. Found it... The file has mac format line endings. If I change it to unix or windows line feeds it works fine. The mac file format must fool the parser into only reading one line of the file and thinking that it is all done. That first message statement was the only thing that was being run. (which is why trace did not show anything...) -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Wed, Dec 3, 2008 at 2:53 PM, Bill Hoffman [EMAIL PROTECTED]wrote: Found it... The file has mac format line endings. If I change it to unix or windows line feeds it works fine. The mac file format must fool the parser into only reading one line of the file and thinking that it is all done. That first message statement was the only thing that was being run. (which is why trace did not show anything...) Thanks for looking into this for me, I really appreciate it. This sounds like a bug to me, as the CMake program didn't give me any hint as to what the problem was. I hope this is fixed later! ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
Robert Dailey wrote: On Wed, Dec 3, 2008 at 2:53 PM, Bill Hoffman [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Found it... The file has mac format line endings. If I change it to unix or windows line feeds it works fine. The mac file format must fool the parser into only reading one line of the file and thinking that it is all done. That first message statement was the only thing that was being run. (which is why trace did not show anything...) Thanks for looking into this for me, I really appreciate it. This sounds like a bug to me, as the CMake program didn't give me any hint as to what the problem was. I hope this is fixed later! Perhaps a bug in the standard c++ library streams... But really who creates text files in this format anymore? I think you have to go back to pre-OSX days to get files like this by default. I will check to see if there is a quick fix, but I am guessing most text based programs would yack on this file -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Dec 3, 2008, at 8:42 PM, Bill Hoffman wrote: Robert Dailey wrote: On Wed, Dec 3, 2008 at 2:53 PM, Bill Hoffman [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Found it... The file has mac format line endings. If I change it to unix or windows line feeds it works fine. The mac file format must fool the parser into only reading one line of the file and thinking that it is all done. That first message statement was the only thing that was being run. (which is why trace did not show anything...) Thanks for looking into this for me, I really appreciate it. This sounds like a bug to me, as the CMake program didn't give me any hint as to what the problem was. I hope this is fixed later! Perhaps a bug in the standard c++ library streams... But really who creates text files in this format anymore? I think you have to go back to pre-OSX days to get files like this by default. I will check to see if there is a quick fix, but I am guessing most text based programs would yack on this file -Bill Actaully, on OS X some of the text editors including BBEdit and TextMate and Eclipse all give you the option of setting your line endings to mac, dos or unix. In some of those the defaults are mac which is /r/n. It is up to the user to set the default for new files to unix. Just FYI. _ Mike Jackson [EMAIL PROTECTED] BlueQuartz Softwarewww.bluequartz.net Principal Software Engineer Dayton, Ohio ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
Michael Jackson wrote: Actaully, on OS X some of the text editors including BBEdit and TextMate and Eclipse all give you the option of setting your line endings to mac, dos or unix. In some of those the defaults are mac which is /r/n. It is up to the user to set the default for new files to unix. \ http://en.wikipedia.org/wiki/End-of-line * LF:Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others * CR+LF: DEC RT-11 and most other early non-Unix, non-IBM OSes, CP/M, MP/M, DOS, OS/2, Microsoft Windows, Symbian OS * CR:Commodore machines, Apple II family, Mac OS up to version 9 and OS-9 So, it is just a \r in this file, and not a \r\n. \r\n is Windows, and unix uses \n only. I guess the problem is in the lexer CMake uses, and not the C++ library... It uses \n as the line ending. That works on but unix and windows, but not with \r only mac files. I suppose we could put a check to see if a file has no \n, but lots of \r, and complain that it is an invalid file. Robert, how did you create the file, was it the default for some editor? -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Wed, Dec 3, 2008 at 8:41 PM, Bill Hoffman [EMAIL PROTECTED]wrote: http://en.wikipedia.org/wiki/End-of-line * LF:Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others * CR+LF: DEC RT-11 and most other early non-Unix, non-IBM OSes, CP/M, MP/M, DOS, OS/2, Microsoft Windows, Symbian OS * CR:Commodore machines, Apple II family, Mac OS up to version 9 and OS-9 So, it is just a \r in this file, and not a \r\n. \r\n is Windows, and unix uses \n only. I guess the problem is in the lexer CMake uses, and not the C++ library... It uses \n as the line ending. That works on but unix and windows, but not with \r only mac files. I suppose we could put a check to see if a file has no \n, but lots of \r, and complain that it is an invalid file. Robert, how did you create the file, was it the default for some editor? The problem isn't about MAC line endings not working. I could care less about line ending requirements, I'll go with whatever works. The main problem I have is that CMake didn't TELL me what the problem was. It should have said, Hey dummy, your line endings are unacceptable. Please change them to LINUX line endings. That would have saved me hours of time! ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Mon, Dec 1, 2008 at 11:52 PM, Robert Dailey [EMAIL PROTECTED] wrote: On Mon, Dec 1, 2008 at 9:53 PM, Philip Lowman [EMAIL PROTECTED] wrote: include( ${CMAKE_CURRENT_SOURCE_DIR}/includes.cmake) should also work. CMAKE_MODULE_PATH may also help you if you have a lot of includes. http://www.vtk.org/Wiki/CMake_Useful_Variables I definitely tried this (using CMAKE_CURRENT_SOURCE_DIR) and it didn't work. I'll try Michael's method tomorrow and see if I get any different results. I can't replicate this as a bug. Maybe your setup differs substantially from this (which works fine on CMake 2.6.2)? Apparantly the use of ${CMAKE_CURRENT_SOURCE_DIR} is superfluous. CMakeLists.txt: PROJECT(foo) INCLUDE(bar.cmake) ADD_SUBDIRECTORY(subdir) bar.cmake: MESSAGE(bar) subdir/CMakeLists.txt: INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/baz.cmake) subdir/baz.cmake: MESSAGE(baz) -- Philip Lowman ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Can't get include() to work!
For some reason I cannot get include() to work. In a CMakeLists.txt of mine (not the root CMakeLists.txt) I call the following: cmake_minimum_required( VERSION 2.6 ) include( includes.cmake ) project( vfx ) And I have a file called includes.cmake in the same directory containing the CMakeLists.txt above. When I run *cmake -G Visual Studio 9 2008*, I get the following output: C:\IT\work\jewettcmake -G Visual Studio 9 2008 CMake Error at vfx/CMakeLists.txt:2 (include): include could not find load file: includes.cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Dec 1, 2008, at 5:12 PM, Robert Dailey wrote: For some reason I cannot get include() to work. In a CMakeLists.txt of mine (not the root CMakeLists.txt) I call the following: cmake_minimum_required( VERSION 2.6 ) include( includes.cmake ) project( vfx ) And I have a file called includes.cmake in the same directory containing the CMakeLists.txt above. When I run cmake -G Visual Studio 9 2008, I get the following output: C:\IT\work\jewettcmake -G Visual Studio 9 2008 CMake Error at vfx/CMakeLists.txt:2 (include): include could not find load file: includes.cmake How is your cmake file being called? If it is being called with include(...) then basically your file contents is substituted for the include(...) call. So the file includes.cmake without any leading prefix directory makes sense that it can not be found. You basically need to get the current directory that CMake is traversing to figure out what prefix to use. Do you _really_ need to place the include(includes.cmake) BEFORE the project() command? If you can swap these two lines then you can do something like: project (vfx) include ( ${vfx_SOURCE_DIR}/includes.cmake ) and it should find the includes.cmake file in the same directory as the vfx CMakeLists.txt file. Hope that helps. ___ Mike Jackson [EMAIL PROTECTED] BlueQuartz Softwarewww.bluequartz.net Principal Software Engineer Dayton, Ohio ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Mon, Dec 1, 2008 at 7:59 PM, Michael Jackson [EMAIL PROTECTED] wrote: On Dec 1, 2008, at 5:12 PM, Robert Dailey wrote: For some reason I cannot get include() to work. In a CMakeLists.txt of mine (not the root CMakeLists.txt) I call the following: cmake_minimum_required( VERSION 2.6 ) include( includes.cmake ) project( vfx ) And I have a file called includes.cmake in the same directory containing the CMakeLists.txt above. When I run cmake -G Visual Studio 9 2008, I get the following output: C:\IT\work\jewettcmake -G Visual Studio 9 2008 CMake Error at vfx/CMakeLists.txt:2 (include): include could not find load file: includes.cmake How is your cmake file being called? If it is being called with include(...) then basically your file contents is substituted for the include(...) call. So the file includes.cmake without any leading prefix directory makes sense that it can not be found. You basically need to get the current directory that CMake is traversing to figure out what prefix to use. Do you _really_ need to place the include(includes.cmake) BEFORE the project() command? If you can swap these two lines then you can do something like: project (vfx) include ( ${vfx_SOURCE_DIR}/includes.cmake ) and it should find the includes.cmake file in the same directory as the vfx CMakeLists.txt file. Hope that helps. include( ${CMAKE_CURRENT_SOURCE_DIR}/includes.cmake) should also work. CMAKE_MODULE_PATH may also help you if you have a lot of includes. http://www.vtk.org/Wiki/CMake_Useful_Variables -- Philip Lowman ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Can't get include() to work!
On Mon, Dec 1, 2008 at 9:53 PM, Philip Lowman [EMAIL PROTECTED] wrote: include( ${CMAKE_CURRENT_SOURCE_DIR}/includes.cmake) should also work. CMAKE_MODULE_PATH may also help you if you have a lot of includes. http://www.vtk.org/Wiki/CMake_Useful_Variables I definitely tried this (using CMAKE_CURRENT_SOURCE_DIR) and it didn't work. I'll try Michael's method tomorrow and see if I get any different results. ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake