diff options
Diffstat (limited to 'src/protocol')
| -rw-r--r-- | src/protocol/CMakeLists.txt | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/protocol/CMakeLists.txt b/src/protocol/CMakeLists.txt index dc8d40126..c903545c3 100644 --- a/src/protocol/CMakeLists.txt +++ b/src/protocol/CMakeLists.txt @@ -14,12 +14,21 @@ endif(WIN32) # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) set_source_files_properties(${PROTOCOL_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") +# Create an empty list to store extra include directories +set(EXTRA_INCLUDES) + # Iterate through all the source files foreach(SRC ${PROTOCOL_SRCS}) # Convert the source file extension to have a .so extension string(REGEX REPLACE "\\.(c|cpp)$" ".so" SO ${SRC}) + # Temporary variable for the current source's include directories + set(TEMP_INCLUDES) # Calculate the header file dependencies for the given source file - calculate_depends(${SRC}) + calculate_depends(${SRC} TEMP_INCLUDES) + # If there were some extra include directories, add them to the list + if(TEMP_INCLUDES) + append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES}) + endif(TEMP_INCLUDES) # For Visual Studio only, include win32_memory.cpp to the list of sources, required to override Visual Studio's overrides of the new/delete operators if(MSVC) append_to_list(SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp) @@ -39,3 +48,9 @@ foreach(SRC ${PROTOCOL_SRCS}) DESTINATION data/modules ) endforeach(SRC) + +# If there were extra include directories, remove the duplicates and add the directories to the include path +if(EXTRA_INCLUDES) + remove_list_duplicates(EXTRA_INCLUDES) + include_directories(${EXTRA_INCLUDES}) +endif(EXTRA_INCLUDES) |
