Re: [CMake] Using CMake with SWIG and Ruby
Bumping to the top, still looking for some help. On Tue, Apr 10, 2012 at 9:52 PM, Dev Guy devguy...@gmail.com wrote: Hi Guy, with all my searching and reading I've have not been able to find a way to build a Ruby extension using SWIG with CMake. Here is my CMakeLists.txt CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(RUBY_WRAPPER) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) FIND_PACKAGE(Ruby) INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(CMAKE_SWIG_FLAGS -c++) SET_SOURCE_FILES_PROPERTIES(person.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(person.i PROPERTIES SWIG_FLAGS -includeall) SWIG_ADD_MODULE(person ruby person.i person.cpp) SWIG_LINK_LIBRARIES(person ${RUBY_LIBRARY}) When I type make, I get the following error: [ 33%] Swig source /home/yadav/dev/cpp/swig_example/person.h:19: Error: Unable to find 'string' make[2]: *** [personRUBY_wrap.cxx] Error 1 make[1]: *** [CMakeFiles/person.dir/all] Error 2 make: *** [all] Error 2 -- Kind Regards, Rajinder Yadav SafetyNet Test Driven Development http://safetynet.devmentor.org -- Kind Regards, Rajinder Yadav SafetyNet Test Driven Development http://safetynet.devmentor.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Using CMake with SWIG and Ruby
Hi Guy, with all my searching and reading I've have not been able to find a way to build a Ruby extension using SWIG with CMake. Here is my CMakeLists.txt CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(RUBY_WRAPPER) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) FIND_PACKAGE(Ruby) INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(CMAKE_SWIG_FLAGS -c++) SET_SOURCE_FILES_PROPERTIES(person.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(person.i PROPERTIES SWIG_FLAGS -includeall) SWIG_ADD_MODULE(person ruby person.i person.cpp) SWIG_LINK_LIBRARIES(person ${RUBY_LIBRARY}) When I type make, I get the following error: [ 33%] Swig source /home/yadav/dev/cpp/swig_example/person.h:19: Error: Unable to find 'string' make[2]: *** [personRUBY_wrap.cxx] Error 1 make[1]: *** [CMakeFiles/person.dir/all] Error 2 make: *** [all] Error 2 -- Kind Regards, Rajinder Yadav SafetyNet Test Driven Development http://safetynet.devmentor.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] how to specify a different source directory
I have a project file and within it I have created a test folder and placed some testing code there. From my test CMakelist, I need to access a .cpp file from the parent folder but I am not sure how to do this? Thus the call to add_executable fails because it can't locate the source file. -- Kind Regards, Rajinder Yadav -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] how to specify a different source directory
On Thu, Feb 2, 2012 at 7:46 PM, Dev Guy devguy...@gmail.com wrote: I have a project file and within it I have created a test folder and placed some testing code there. From my test CMakelist, I need to access a .cpp file from the parent folder but I am not sure how to do this? Thus the call to add_executable fails because it can't locate the source file. OK I figured out when I pass in the source file to add_executable, I just need to prefix the source file with ../ Is this the proper way to do it, or should I be using another cmake command to declare a source folder? Thanks, Rajinder -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] syntax error on Win7 x64
I am seeing an error from CMake on Win7 x64 that I don't see in WinXP. The following 2 statements seems to be causing the errors below (I've double checked that the environment var MSSDK_ROOT exists and is defined). include_directories(${ENV[MSSDK_ROOT]}\\Include) link_directories(${ENV[MSSDK_ROOT]}\\Lib) CMake Error === CMake Warning (dev) at CMakeLists.txt:9 (include_directories): Syntax error in cmake code at C:/dev/cpp/Project/safetynet/MonitorTestClient/CMakeLists.txt:9 when parsing string ${ENV[MSSDK_ROOT]}\\Include syntax error, unexpected cal_SYMBOL, expecting } (18) Policy CMP0010 is not set: Bad variable reference syntax is an error. Run cmake --help-policy CMP0010 for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at CMakeLists.txt:10 (link_directories): Syntax error in cmake code at C:/dev/cpp/Project/safetynet/MonitorTestClient/CMakeLists.txt:10 when parsing string ${ENV[MSSDK_ROOT]}\\Lib syntax error, unexpected cal_SYMBOL, expecting } (18) -- Kind Regards, Rajinder Yadav -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] syntax error on Win7 x64
OK I realized my error, I should be using $ENV{MSSDK_ROOT} On Wed, Feb 1, 2012 at 12:02 AM, Dev Guy devguy...@gmail.com wrote: I am seeing an error from CMake on Win7 x64 that I don't see in WinXP. The following 2 statements seems to be causing the errors below (I've double checked that the environment var MSSDK_ROOT exists and is defined). include_directories(${ENV[MSSDK_ROOT]}\\Include) link_directories(${ENV[MSSDK_ROOT]}\\Lib) CMake Error === CMake Warning (dev) at CMakeLists.txt:9 (include_directories): Syntax error in cmake code at C:/dev/cpp/Project/safetynet/MonitorTestClient/CMakeLists.txt:9 when parsing string ${ENV[MSSDK_ROOT]}\\Include syntax error, unexpected cal_SYMBOL, expecting } (18) Policy CMP0010 is not set: Bad variable reference syntax is an error. Run cmake --help-policy CMP0010 for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at CMakeLists.txt:10 (link_directories): Syntax error in cmake code at C:/dev/cpp/Project/safetynet/MonitorTestClient/CMakeLists.txt:10 when parsing string ${ENV[MSSDK_ROOT]}\\Lib syntax error, unexpected cal_SYMBOL, expecting } (18) -- Kind Regards, Rajinder Yadav -- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1 -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] building libs and specifying addition folders
Hi, I am relatively new to CMake and I've read the tutorial. However I have a few questions. 1. How can I declare a CMakeLists file to create a project to build a DLL or static lib ? I assume if I build a DLL on windows, it will build as a shared lib on Linux 2. If my main source folder has 2 sub-folders, one that only includes header files call is Include and another folder that contains source files call it Utils. How do I add declare them to my CMakeLists files so that both the header and addition source files are found and and compiled in the main source folder to build the final binary. Thanks, -- Kind Regards, Rajinder Yadav -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Fwd: building libs and specifying addition folders
On Thu, Jan 19, 2012 at 1:01 AM, John Drescher dresche...@gmail.com wrote: -- Forwarded message -- From: John Drescher dresche...@gmail.com Date: Thu, Jan 19, 2012 at 1:00 AM Subject: Re: [CMake] building libs and specifying addition folders To: Dev Guy devguy...@gmail.com On Wed, Jan 18, 2012 at 10:57 PM, Dev Guy devguy...@gmail.com wrote: Hi, I am relatively new to CMake and I've read the tutorial. However I have a few questions. 1. How can I declare a CMakeLists file to create a project to build a DLL or static lib ? I assume if I build a DLL on windows, it will build as a shared lib on Linux put SHARED in the add_library statement For more info than that type the following from a command prompt or shell: cmake --help-command add_library 2. If my main source folder has 2 sub-folders, one that only includes header files call is Include and another folder that contains source files call it Utils. How do I add declare them to my CMakeLists files so that both the header and addition source files are found and and compiled in the main source folder to build the final binary. add_subdirectory Again for help: cmake --help-command add_subdirectory John -- John M. Drescher -- John thanks, I was able to get a DLL built, now I have a program that want to link against the lib and use the DLL. What I've done is create a Lib folder under the source folder wanting to use the lib, I copied over the lib find and header file. I added the following to CMakeLists.txt add_subdirectory(Lib) target_link_libraries (SimpleTester UnitTest) However I am seeing 2 errors: Error 1, when I run CMake I see: CMake Warning (dev) at CMakeLists.txt:6 (add_subdirectory): The source directory C:/dev/Project/UnitTestSample/Lib does not contain a CMakeLists.txt file. CMake does not support this case but it used to work accidentally and is being allowed for compatibility. Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run cmake --help-policy CMP0014 for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. -- Configuring done -- Generating done -- Build files have been written to: C:/dev/Project/UnitTestSample/build == Error 2 When I build I get a link error, which I fix by copying over the lib file into the build folder. How can I tell the linker from CMake where to find the lib? LINK : fatal error LNK1104: cannot open file 'UnitTest.lib' LINK Pass 1 failed. with 2 NMAKE : fatal error U1077: 'C:\Program Files\CMake 2.8\bin\cmake.exe' : return code '0x' Stop. NMAKE : fatal error U1077: 'C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe' : retu rn code '0x2' Stop. NMAKE : fatal error U1077: 'C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe' : retu rn code '0x2' Stop. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake