summaryrefslogtreecommitdiff
path: root/src/tools/CMakeLists.txt
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-10-17 18:33:55 -0400
committerAdam <Adam@anope.org>2016-10-17 18:33:55 -0400
commit22d166fd4e98b67cac7103b48801fb95a0179f01 (patch)
tree300b00bd52c5d3a26978bfe23bbdc2adc9c0fa26 /src/tools/CMakeLists.txt
parent1ba242179fee46583098f48421af39ce9a8985a1 (diff)
Address casemapping issues in sqlite/mysql
Diffstat (limited to 'src/tools/CMakeLists.txt')
-rw-r--r--src/tools/CMakeLists.txt33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index f302c3ef7..ee445a00e 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -1,27 +1,16 @@
-# Find all the *.cpp files within the current source directory, and sort the list
-file(GLOB TOOLS_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
-list(SORT TOOLS_SRCS)
-# Set all the files to use C++ as well as set their compile flags
-set_source_files_properties(${TOOLS_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
-
-# Iterate through all the source files
-foreach(SRC ${TOOLS_SRCS})
- # Convert the source file extension to have no extension
- string(REGEX REPLACE "\\.cpp$" "" EXE ${SRC})
- # 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_DIR}
+function(build_sqlite LIBNAME)
+ add_library(tools_anope_sqlite_${LIBNAME} SHARED anope_sqlite.cpp)
+ set_source_files_properties(anope_sqlite.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
+ set_target_properties(tools_anope_sqlite_${LIBNAME} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}" OUTPUT_NAME "anope_sqlite_${LIBNAME}")
+ install(TARGETS tools_anope_sqlite_${LIBNAME}
+ DESTINATION ${LIB_DIR}
)
- # 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()
+endfunction()
+
+build_sqlite(ascii)
+build_sqlite(rfc1459)
+build_sqlite(rfc1459_inspircd)
# If not on Windows, generate anoperc and install it along with mydbgen
if(NOT WIN32)