... | ... | @@ -646,7 +646,7 @@ add_subdirectory(subdir) |
|
|
# Create the executable.
|
|
|
add_executable(generated ${CMAKE_CURRENT_BINARY_DIR}/subdir/foo.c)
|
|
|
# Tell CMake the source won't be available until build time.
|
|
|
set_source_file_properties(${CMAKE_CURRENT_BINARY_DIR}/subdir/foo.c PROPERTIES GENERATED 1)
|
|
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/subdir/foo.c PROPERTIES GENERATED 1)
|
|
|
# Make sure the source is generated before the executable builds.
|
|
|
add_dependencies(generated generate_foo)
|
|
|
```
|
... | ... | @@ -1071,8 +1071,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
|
|
|
|
|
set(CMAKE_SWIG_FLAGS "")
|
|
|
|
|
|
set_source_file_properties(example.i PROPERTIES CPLUSPLUS ON)
|
|
|
set_source_file_properties(example.i PROPERTIES SWIG_FLAGS "-includeall")
|
|
|
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})
|
... | ... | @@ -1099,8 +1099,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
|
|
|
|
|
set(CMAKE_SWIG_FLAGS "-c++")
|
|
|
|
|
|
set_source_file_properties(${INTERFACE_FILES} PROPERTIES CPLUSPLUS ON)
|
|
|
set_source_file_properties(${INTERFACE_FILES} PROPERTIES CMAKE_SWIG_FLAGS "-includeall")
|
|
|
set_source_files_properties(${INTERFACE_FILES} PROPERTIES CPLUSPLUS ON)
|
|
|
set_source_files_properties(${INTERFACE_FILES} PROPERTIES CMAKE_SWIG_FLAGS "-includeall")
|
|
|
swig_add_module(${MODULE_NAME} tcl ${INTERFACE_FILES} ${SRC_FILES})
|
|
|
swig_link_libraries(${MODULE_NAME} ${TCL_LIBRARIES})
|
|
|
```
|
... | ... | @@ -1124,7 +1124,7 @@ try setting the `-includeall` property on fewer source files: |
|
|
|
|
|
```cmake
|
|
|
# Try doing this on fewer files
|
|
|
set_source_file_properties(example.i PROPERTIES SWIG_FLAGS "-includeall")
|
|
|
set_source_files_properties(example.i PROPERTIES SWIG_FLAGS "-includeall")
|
|
|
```
|
|
|
|
|
|
In particular, you may need `-includeall` only on the top-level `.i`
|
... | ... | |