1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 09:43:13 +02:00

Implemented dependency calculation within CMake, now header file dependencies are no longer hardcoded.

Also a few minor changes to the CMakeLists.txt files.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1840 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2008-12-17 20:18:11 +00:00
parent ad7b5bdd30
commit fd45a3ad42
7 changed files with 316 additions and 127 deletions
+18 -15
View File
@@ -35,21 +35,24 @@ foreach(SRC ${MODULES_SRCS})
#)
#add_custom_target(modules_${SO_TARGET} DEPENDS ${BUILD_DIR}/${SO})
#add_dependencies(modules modules_${SO_TARGET})
set(HEADERS ${Anope_SOURCE_DIR}/include/module.h)
if(${SRC}_HEADERS)
foreach(HEADER ${${SRC}_HEADERS})
string(SUBSTRING ${HEADER} 0 1 FIRST_CHAR)
string(SUBSTRING ${HEADER} 1 1 SECOND_CHAR)
if(FIRST_CHAR STREQUAL "/" OR SECOND_CHAR STREQUAL ":")
set(HEADERS ${HEADERS} ${HEADER})
else(FIRST_CHAR STREQUAL "/" OR SECOND_CHAR STREQUAL ":")
set(HEADERS ${HEADERS} ${Anope_SOURCE_DIR}/include/${HEADER})
endif(FIRST_CHAR STREQUAL "/" OR SECOND_CHAR STREQUAL ":")
endforeach(HEADER)
endif(${SRC}_HEADERS)
if(HEADERS)
set_source_files_properties(${SRC} PROPERTIES OBJECT_DEPENDS "${HEADERS}")
endif(HEADERS)
#set(HEADERS ${Anope_SOURCE_DIR}/include/module.h)
#if(${SRC}_HEADERS)
# foreach(HEADER ${${SRC}_HEADERS})
# string(SUBSTRING ${HEADER} 0 1 FIRST_CHAR)
# string(SUBSTRING ${HEADER} 1 1 SECOND_CHAR)
# if(FIRST_CHAR STREQUAL "/" OR SECOND_CHAR STREQUAL ":")
# set(HEADERS ${HEADERS} ${HEADER})
# else(FIRST_CHAR STREQUAL "/" OR SECOND_CHAR STREQUAL ":")
# set(HEADERS ${HEADERS} ${Anope_SOURCE_DIR}/include/${HEADER})
# endif(FIRST_CHAR STREQUAL "/" OR SECOND_CHAR STREQUAL ":")
# endforeach(HEADER)
#endif(${SRC}_HEADERS)
#if(HEADERS)
# set_source_files_properties(${SRC} PROPERTIES OBJECT_DEPENDS "${HEADERS}")
#endif(HEADERS)
calculate_depends(${SRC})
get_source_file_property(HEADERS ${SRC} OBJECT_DEPENDS)
message(STATUS "${SRC}'s OBJECT_DEPENDS: ${HEADERS}")
if(WIN32 AND MSVC)
set(SRC ${SRC} ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
endif(WIN32 AND MSVC)