diff options
| author | Adam <Adam@anope.org> | 2010-07-15 22:55:02 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-07-15 22:55:02 -0400 |
| commit | a22f8d3b2de88b9bb6f80f0c2780846ae23ab389 (patch) | |
| tree | a2fdf570868896a787df8a1169951b0028e68d6b /src/tools | |
| parent | 43b1e43afb85639485e36d24da351dc0f121be6e (diff) | |
Moved some files and diretories around, made cmake skip files it knows it can't compile because of missing dependices.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/CMakeLists.txt | 47 | ||||
| -rw-r--r-- | src/tools/smtp.h | 1 |
2 files changed, 25 insertions, 23 deletions
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index b22a796a4..e96b3523e 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,7 +1,5 @@ -# Find all the *.c and *.cpp files within the current source directory, and sort the list -file(GLOB TOOLS_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") -file(GLOB TOOLS_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") -set(TOOLS_SRCS ${TOOLS_SRCS_C} ${TOOLS_SRCS_CPP}) +# Find all the *.cpp files within the current source directory, and sort the list +file(GLOB TOOLS_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") sort_list(TOOLS_SRCS) # Set all the files to use C++ as well as set their compile flags @@ -10,25 +8,30 @@ set_source_files_properties(${TOOLS_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS # Iterate through all the source files foreach(SRC ${TOOLS_SRCS}) # Convert the source file extension to have no extension - string(REGEX REPLACE "\\.(c|cpp)$" "" EXE ${SRC}) + string(REGEX REPLACE "\\.cpp$" "" EXE ${SRC}) + # Create skip variable + set(SKIP) # Calculate the header file dependencies for the given source file - calculate_depends(${SRC}) - # For anoptsmtp, we also want hashcomp.cpp included, so we force it into the sources - if(SRC STREQUAL anopesmtp.cpp) - set(SRC ${SRC} ${Anope_SOURCE_DIR}/src/hashcomp.cpp) - endif(SRC STREQUAL anopesmtp.cpp) - # Generate the executable and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand - add_executable(${EXE} ${SRC}) - set_target_properties(${EXE} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}") - add_dependencies(${EXE} ${PROGRAM_NAME}) - # Set the executable to be installed to the bin directory under the main directory - install(TARGETS ${EXE} - DESTINATION bin - ) - # Add the executable to the list of files for CPack to ignore - get_target_property(EXE_BINARY ${EXE} LOCATION) - get_filename_component(EXE_BINARY ${EXE_BINARY} NAME) - add_to_cpack_ignored_files("${EXE_BINARY}$" TRUE) + calculate_depends(${SRC} SKIP) + # Only continue if this file isn't skipped + if(NOT SKIP) + # For anoptsmtp, we also want hashcomp.cpp included, so we force it into the sources + if(SRC STREQUAL anopesmtp.cpp) + set(SRC ${SRC} ${Anope_SOURCE_DIR}/src/hashcomp.cpp) + endif(SRC STREQUAL anopesmtp.cpp) + # Generate the executable and set its linker flags, also set it to depend on the main Anope executable to be built beforehand + add_executable(${EXE} ${SRC}) + set_target_properties(${EXE} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}") + add_dependencies(${EXE} ${PROGRAM_NAME}) + # Set the executable to be installed to the bin directory under the main directory + install(TARGETS ${EXE} + DESTINATION bin + ) + # Add the executable to the list of files for CPack to ignore + get_target_property(EXE_BINARY ${EXE} LOCATION) + get_filename_component(EXE_BINARY ${EXE_BINARY} NAME) + add_to_cpack_ignored_files("${EXE_BINARY}$" TRUE) + endif(NOT SKIP) endforeach(SRC) # Only for Windows, set anopesmtp to require the wsock32 library diff --git a/src/tools/smtp.h b/src/tools/smtp.h index 426d5bc9d..b7c9ef249 100644 --- a/src/tools/smtp.h +++ b/src/tools/smtp.h @@ -12,7 +12,6 @@ #define SMTP_H #include "sysconf.h" -#define CoreExport #include "hashcomp.h" /*************************************************************************/ |
