[CMake] file property SWIG_FLAGS results in NOTFOUND

Axel Wachtler axel.wachtler at gmx.de
Thu Mar 31 16:23:40 EST 2005


Hallo all,

I use cmake in a project under mingw and under linux, so the
Makefile Generator is "Unix Makefiles".

Currently with Swig, two issues coming up (may be coming from
layer 8, e.g. from the guy sitting in front of the terminal).


(1)
I just tried to use the cmake example at swig.org.

When I run the example I get in the Makefile

/usr/bin/swig -python NOTFOUND -c -I/usr/include/python2.3 \
  -I/mnt/net/axel/1/scratch/cmake_vortrag/src/Cmswig/build

It seems that NOTFOUND is coming from
SET_SOURCE_FILES_PROPERTIES(../Source/example.i
     PROPERTIES SWIG_FLAGS ... )

I did a workaround while copying UseSWIG.cmake to a local
dir and fix it by commenting out the use of the SWIG_FLAGS
file property.

Also I would suggest to remove the hardcoded "-c"
from UseSWIG.cmake, because it means raw wrapper code,
so that a C file can not get linked properly.
This could be set by the user, if needed.


(2)
The second question is, I want to add a custom file generator
before swig is called (a Python script, which generates
another swig module),  how I can do this? I could not find a
valid target  name, to use in  ADD_CUSTOM_(TARGET|COMMAND).

Thanks for the help and best regards

Axel


---
Some Details:

.
|-- Cmswig
|   |-- Config
|   |   `-- config.cmake
|   |-- Source
|   |   `-- example.i
|   `-- build
|       |-- CMakeLists.txt
|       |-- ...
|       `-- ... # all other cmake files
|-- Config
|   |-- config.cmake
|   `-- maincfg.cmake
|-- Makefile
`-- build
     |-- CMakeLists.txt
     |-- ...
     `-- ... # all other cmake files

---

cat Cmswig/build/CMakeLists.txt
SET(TDIR /mnt/net/axel/1/scratch/cmake_test/src)
INCLUDE("../Config/config.cmake")

---

cat CmSwig/Config/config.cmake
MESSAGE("== CmSwig ==")
PROJECT( "CmSwig" )
INCLUDE("${TDIR}/Config/maincfg.cmake")

# Build a swig module for pyhon
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})

FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS "")

SET_SOURCE_FILES_PROPERTIES(../Source/example.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(../Source/example.i PROPERTIES SWIG_FLAGS 
"-includeall")
SWIG_ADD_MODULE(example python ../Source/example.i)
SWIG_LINK_LIBRARIES(example ${PYTHON_LIBRARIES})

---

The file ${TDIR}/Config/maincfg.cmake currently is empty.


-- 
------------------------------------------------------------------
Axel Wachtler
Mail:        axel.wachtler at gmx.de
Fingerprint: FA2C 4FB1 AC18 5FA3 F4F1 1114 3F38 E0DF 8C3A DC95
Public Key:  http://www.keyserver.net
------------------------------------------------------------------



More information about the CMake mailing list