[Cmake] Re: [Swig] ANNOUNCE: CMake 2.0.3 with SWIG support
William A. Hoffman
billlist at nycap.rr.com
Sat Aug 21 06:02:57 EDT 2004
Hi,
To move the .py files, you can use the swig -outdir option.
That can be set with the SWIG_FLAGS property, something like this:
SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS
"-outdir ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}")
(That is assuming that you are using EXECUTABLE_OUTPUT_PATH.
For the make clean, you can add that like this:
SET_DIRECTORY_PROPERTIES(PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${ADDITIONAL_MAKE_CLEAN_FILES};myLibrary.py")
The problem is that running swig on a .i file may generate any number of .py files
depending on the classes being wrapped.
-Bill
At 03:51 PM 8/20/2004, Anton Deguet wrote:
>Hello,
>
>I finally updated my projects to CMake 2.0.3 and decided to use the new
>macros introduced to simplify the SWIG wrapping. I have one minor
>comment/addition for the Python wrapping. Swig generates the file
>myLibrary.py and:
>- This file stays in the current binary directory. It would be nice to
>have it moved to the directory where _myLibrary.so resides.
>- This file is not removed when I do make clean.
>
>Sincerely,
>
>Anton Deguet
>
>
>On Wed, 2004-08-04 at 12:37, William A. Hoffman wrote:
>> CMake is a cross platform build manager. It allows you to specify build parameters for C and C++ programs in a cross platform manner. It generates native build files such as makefiles, nmake files and visual studio projects.
>>
>> The most recent release contains direct support for SWIG projects.
>>
>> A simple SWIG example follows:
>>
>>
>> PROJECT(example_python)
>> FIND_PACKAGE(SWIG REQUIRED)
>> INCLUDE(${SWIG_USE_FILE})
>> FIND_PACKAGE(PythonLibs)
>> INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
>> INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
>> SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON)
>> SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall")
>> SWIG_ADD_MODULE(example python example.i example.cxx)
>> SWIG_LINK_LIBRARIES(example ${PYTHON_LIBRARIES})
>>
>> The above example will create makefiles or visual studio projects
>> that will run swig on example.i, generate the swig wrapper cxx file,
>> and compile example.cxx into _example.so (UNIX) or _example.dll (windows).
>>
>> For more information about CMake, see:
>> www.cmake.org
>>
>>
>> -Bill Hoffman
>>
>> _______________________________________________
>> Swig maillist - Swig at cs.uchicago.edu
>> http://mailman.cs.uchicago.edu/mailman/listinfo/swig
>--
>Anton Deguet Systems Engineer
>ERC CISST Johns Hopkins University
>http://cisstweb.cs.jhu.edu 410 516 5261
More information about the Cmake
mailing list