[CMake] file property SWIG_FLAGS results in NOTFOUND
Axel Wachtler
axel.wachtler at gmx.de
Sat Apr 2 04:49:58 EST 2005
Hallo Anton, Hallo Brad,
thanks for your help to my questions. Just for documentation
I want to post the fixes I made, to solve the issues - maybe
somebody will find it helpfull.
In the bug tracker, I created to fix (1) the entries 1729 and 1730
and for (2) the entry 1731.
The patch attached to this mail should be applied to a local copy
of UseSWIG.cmake.
cp /<where_cmake_resides>/share/CMake/Modules/UseSWIG.cmake .
patch -p0 < UseSWIG.patch
It comments out the SWIG_FLAGS-property and the "-c" line (1) and
uses a SWIG_MODULE_${name}_EXTRA_DEPS variable in the custom command
(2), which generates the swig command line.
With SWIG_MODULE_${name}_EXTRA_DEPS a code generator can be triggered.
Best Regards
Axel
> Please report this as a bug here:
>
> http://www.cmake.org/Bug
>
> > (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).
>
>
> You don't actually need a target name. That is the old custom command
> format. Just specify as an OUTPUT a file that is used as an input by
> the swig macro. The generation rule should automatically be put in the
> right place.
>
> -Brad
--
------------------------------------------------------------------
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
------------------------------------------------------------------
If pro is the opposite of con, then the opposite of progress must
be congress!
-------------- next part --------------
--- UseSWIG.cmake Sat Apr 2 11:33:30 2005
+++ MyUseSWIG.cmake Sat Apr 2 11:33:30 2005
@@ -64,7 +64,7 @@
GET_FILENAME_COMPONENT(swig_source_file_name_we "${infile}" NAME_WE)
GET_SOURCE_FILE_PROPERTY(swig_source_file_generated ${infile} GENERATED)
GET_SOURCE_FILE_PROPERTY(swig_source_file_cplusplus ${infile} CPLUSPLUS)
- GET_SOURCE_FILE_PROPERTY(swig_source_file_flags ${infile} SWIG_FLAGS)
+# GET_SOURCE_FILE_PROPERTY(swig_source_file_flags ${infile} SWIG_FLAGS)
SET(swig_source_file_fullname "${infile}")
IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
STRING(REGEX REPLACE
@@ -122,8 +122,8 @@
SET(swig_special_flags)
IF(swig_source_file_cplusplus)
SET(swig_special_flags ${swig_special_flags} "-c++")
- ELSE(swig_source_file_cplusplus)
- SET(swig_special_flags ${swig_special_flags} "-c")
+# ELSE(swig_source_file_cplusplus)
+# SET(swig_special_flags ${swig_special_flags} "-c")
ENDIF(swig_source_file_cplusplus)
SET(swig_extra_flags)
IF(SWIG_MODULE_${name}_EXTRA_FLAGS)
@@ -140,6 +140,7 @@
${swig_include_dirs}
-o "${swig_generated_file_fullname}"
"${swig_source_file_fullname}"
+ DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
MAIN_DEPENDENCY "${swig_source_file_fullname}"
COMMENT "Swig source")
SET_SOURCE_FILES_PROPERTIES("${swig_generated_file_fullname}"
More information about the CMake
mailing list