summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt9
-rw-r--r--include/CMakeLists.txt16
-rw-r--r--lang/CMakeLists.txt38
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/bin/CMakeLists.txt6
-rw-r--r--src/tools/CMakeLists.txt10
6 files changed, 31 insertions, 58 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8b3d6c544..e42e6e5be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -504,11 +504,11 @@ macro(add_to_cpack_ignored_files ITEM)
endmacro(add_to_cpack_ignored_files)
# Add the initial files to ignore which will be ignored regardless of if you are building in-source or out-of-source
-add_to_cpack_ignored_files(".git\;config.cache\;.svn\;CMakeFiles" TRUE)
+add_to_cpack_ignored_files(".git\;config.cache\;.svn\;CMakeFiles\;sysconf.h$\;Makefile.inc$\;config.log\;config.status" TRUE)
+# Add the files we don't want the periods converted for
+add_to_cpack_ignored_files(".\\\\\\\\.so$;.\\\\\\\\.o$;.\\\\\\\\.s$;${Anope_SOURCE_DIR}/Makefile$")
# If the two directories are the same, we are building in-source, thus we need to ignore more files from the build
if(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
- # This variable is used in the sub-directories to determine if we are building in-source
- set(IN_SOURCE TRUE)
# Add the files that need their periods converted
add_to_cpack_ignored_files("Makefile\;cmake_install.cmake\;sysconf.h$\;CMakeCache.txt\;install_manifest.txt" TRUE)
# Add the files we don't want the periods converted for
@@ -517,9 +517,6 @@ if(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
if(MSVC)
add_to_cpack_ignored_files(".vcproj$\;.sln$\;.ncb$\;.suo$\;.dir$\;.ilk$\;.exp$\;.pdb$\;.lib$\;/debug$;/release$;/relwithdebinfo$;/minsizerel$" TRUE)
endif(MSVC)
-# Otherwise, the two directories are different and we are building out-of-source
-else(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
- set(IN_SOURCE FALSE)
endif(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
# Go into the following directories and run their CMakeLists.txt as well
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 6401d2fdc..19bbcfc6c 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -10,12 +10,10 @@ if(MSVC OR NOT SH)
COMMAND version_sh ${Anope_SOURCE_DIR}/version.log ${CMAKE_CURRENT_SOURCE_DIR}/version.sh ${CMAKE_CURRENT_BINARY_DIR}/version.h
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/version.sh DEPENDS version_sh ${CMAKE_CURRENT_SOURCE_DIR}/services.h ${CMAKE_CURRENT_SOURCE_DIR}/pseudo.h ${CMAKE_CURRENT_SOURCE_DIR}/messages.h ${SRC_SRCS}
)
- if(IN_SOURCE)
- # Add version_sh to list of files for CPack to ignore
- get_target_property(version_sh_BINARY version_sh LOCATION)
- get_filename_component(version_sh_BINARY ${version_sh_BINARY} NAME)
- add_to_cpack_ignored_files("${version_sh_BINARY}$" TRUE)
- endif(IN_SOURCE)
+ # Add version_sh to list of files for CPack to ignore
+ get_target_property(version_sh_BINARY version_sh LOCATION)
+ get_filename_component(version_sh_BINARY ${version_sh_BINARY} NAME)
+ add_to_cpack_ignored_files("${version_sh_BINARY}$" TRUE)
# For any non-Visual Studio platforms that do have sh, we will run version.h through the version.h shell script
else(MSVC OR NOT SH)
# Generate version.h from version.sh and the version.log file from the main source directory, with dependencies to the given headers and all source files in the main Anope build
@@ -25,10 +23,8 @@ else(MSVC OR NOT SH)
)
endif(MSVC OR NOT SH)
-if(IN_SOURCE)
- # Add version.h to the list of files for CPack to ignore
- add_to_cpack_ignored_files("version.h$" TRUE)
-endif(IN_SOURCE)
+# Add version.h to the list of files for CPack to ignore
+add_to_cpack_ignored_files("version.h$" TRUE)
# Add a custom target to the above file
add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h)
diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt
index 7d19d9bdf..5390e6904 100644
--- a/lang/CMakeLists.txt
+++ b/lang/CMakeLists.txt
@@ -5,11 +5,9 @@ add_executable(langcomp langcomp.c)
set_target_properties(langcomp PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
# Get the location of the binary to use later
get_target_property(langcomp_BINARY langcomp LOCATION)
-if(IN_SOURCE)
- # Add the executable to the list of files for CPack to ignore
- file(RELATIVE_PATH langcomp_BINARY_RELATIVE ${Anope_BINARY_DIR} ${langcomp_BINARY})
- add_to_cpack_ignored_files("${langcomp_BINARY_RELATIVE}$" TRUE)
-endif(IN_SOURCE)
+# Add the executable to the list of files for CPack to ignore
+file(RELATIVE_PATH langcomp_BINARY_RELATIVE ${Anope_BINARY_DIR} ${langcomp_BINARY})
+add_to_cpack_ignored_files("${langcomp_BINARY_RELATIVE}$" TRUE)
# Determine if langtool should be built
if(MSVC)
@@ -31,11 +29,9 @@ if(BUILD_LANGTOOL)
set_target_properties(langtool PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
# Get the location of the binary to use later)
get_target_property(langtool_BINARY langtool LOCATION)
- if(IN_SOURCE)
- # Add the executable to the list of files for CPack to ignore
- file(RELATIVE_PATH langtool_BINARY_RELATIVE ${Anope_BINARY_DIR} ${langtool_BINARY})
- add_to_cpack_ignored_files("${langtool_BINARY_RELATIVE}$" TRUE)
- endif(IN_SOURCE)
+ # Add the executable to the list of files for CPack to ignore
+ file(RELATIVE_PATH langtool_BINARY_RELATIVE ${Anope_BINARY_DIR} ${langtool_BINARY})
+ add_to_cpack_ignored_files("${langtool_BINARY_RELATIVE}$" TRUE)
endif(BUILD_LANGTOOL)
# If grep exists (and we aren't using Visual Studio, it hates this), use it to generate the index file
@@ -51,11 +47,9 @@ else(NOT MSVC AND GREP)
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l DEPENDS langtool
)
endif(NOT MSVC AND GREP)
-if(IN_SOURCE)
- # Add the index file to the list of files for CPack to ignore
- file(RELATIVE_PATH index_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/index)
- add_to_cpack_ignored_files("${index_RELATIVE}$")
-endif(IN_SOURCE)
+# Add the index file to the list of files for CPack to ignore
+file(RELATIVE_PATH index_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/index)
+add_to_cpack_ignored_files("${index_RELATIVE}$")
# Find all the *.l files within the current source directory, and sort the list
file(GLOB LANG_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.l")
@@ -74,11 +68,9 @@ foreach(LANG_L ${LANG_SRCS})
COMMAND ${langcomp_BINARY} ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_L} ${CMAKE_CURRENT_BINARY_DIR}/${LANG}
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_L} DEPENDS langcomp ${CMAKE_CURRENT_BINARY_DIR}/index
)
- if(IN_SOURCE)
- # Add the language file to the list of files for CPack to ignore
- file(RELATIVE_PATH LANG_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${LANG})
- add_to_cpack_ignored_files("${LANG_RELATIVE}$")
- endif(IN_SOURCE)
+ # Add the language file to the list of files for CPack to ignore
+ file(RELATIVE_PATH LANG_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${LANG})
+ add_to_cpack_ignored_files("${LANG_RELATIVE}$")
endforeach(LANG_L)
# If perl exists (and we aren't using Visual Studio, it hates this), use it to generate language.h
@@ -94,10 +86,8 @@ else(NOT MSVC AND PERL)
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/index DEPENDS langtool
)
endif(NOT MSVC AND PERL)
-if(IN_SOURCE)
- # Add language.h to the list of files for CPack to ignore
- add_to_cpack_ignored_files("language.h$" TRUE)
-endif(IN_SOURCE)
+# Add language.h to the list of files for CPack to ignore
+add_to_cpack_ignored_files("language.h$" TRUE)
# Add a custom target to depend on the language files and language.h
add_custom_target(language DEPENDS ${LANGS} ${CMAKE_CURRENT_BINARY_DIR}/language.h)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2d6518f5b..d8ed60083 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -41,10 +41,6 @@ if(WIN32)
else(MINGW)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"")
endif(MINGW)
- if(IN_SOURCE)
- # Add the resource file to the list of files for CPack to ignore
- add_to_cpack_ignored_files("win32.rc$" TRUE)
- endif(IN_SOURCE)
endif(WIN32)
# Generate the Anope executable and set it's linker flags, also set it to export it's symbols even though it's not a module
@@ -62,10 +58,8 @@ add_dependencies(${PROGRAM_NAME} language headers)
get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
set(SERVICES_BIN "${SERVICES_BINARY}")
-if(IN_SOURCE)
- # Add the Anope executable to the list of files for CPack to ignore
- add_to_cpack_ignored_files("${SERVICES_BINARY}$" TRUE)
-endif(IN_SOURCE)
+# Add the Anope executable to the list of files for CPack to ignore
+add_to_cpack_ignored_files("${SERVICES_BINARY}$" TRUE)
# Generate sysconf.h from the earlier configuration
configure_file(${Anope_SOURCE_DIR}/include/sysconf.h.cmake ${Anope_BINARY_DIR}/include/sysconf.h)
diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt
index e6aea4ec4..9bdbb23dd 100644
--- a/src/bin/CMakeLists.txt
+++ b/src/bin/CMakeLists.txt
@@ -4,10 +4,8 @@ if(NOT WIN32)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/anoperc
DESTINATION .
)
- if(IN_SOURCE)
- # Add anoperc to list of files for CPack to ignore
- add_to_cpack_ignored_files("anoperc$")
- endif(IN_SOURCE)
+ # Add anoperc to list of files for CPack to ignore
+ add_to_cpack_ignored_files("anoperc$")
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mydbgen
DESTINATION data
)
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 05c535863..c281df5b5 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -23,12 +23,10 @@ foreach(SRC ${TOOLS_SRCS})
install(TARGETS ${EXE}
DESTINATION tools
)
- if(IN_SOURCE)
- # 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(IN_SOURCE)
+ # 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)
endforeach(SRC)
# Only for Windows, set anopesmtp to require the wsock32 library