diff options
| author | Adam <Adam@anope.org> | 2014-04-01 22:24:50 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2014-04-01 22:24:50 -0400 |
| commit | 44637154da89028a99920bd6ead5d917d8a894a4 (patch) | |
| tree | cb2bd670800efb25beb2c71983b1db49a3f78d49 /src/tools | |
| parent | b12a51a430b00e857cc5568c9fd994bbd88c8ff7 (diff) | |
Require cmake 2.8 and C++11 support
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/CMakeLists.txt | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 200aa2bf3..394d2fc51 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,6 +1,6 @@ # 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) +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}") @@ -9,30 +9,25 @@ set_source_files_properties(${TOOLS_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS foreach(SRC ${TOOLS_SRCS}) # Convert the source file extension to have no extension string(REGEX REPLACE "\\.cpp$" "" EXE ${SRC}) - # Calculate the header file dependencies for the given source file - calculate_depends(${SRC}) - # Only continue if this file isn't skipped - if(NOT SKIP) - # 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}) - # Only for Windows, set anopesmtp to require the wsock32 library - if(WIN32 AND ${EXE} STREQUAL anopesmtp) - target_link_libraries(${EXE} wsock32) - endif(WIN32 AND ${EXE} STREQUAL anopesmtp) - if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" AND ${EXE} STREQUAL anopesmtp) - target_link_libraries(${EXE} socket nsl) - endif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" AND ${EXE} STREQUAL anopesmtp) - # Set the executable to be installed to the bin directory under the main directory - install(TARGETS ${EXE} - DESTINATION ${BIN_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) - endif(NOT SKIP) + # 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}) + # Only for Windows, set anopesmtp to require the wsock32 library + if(WIN32 AND ${EXE} STREQUAL anopesmtp) + target_link_libraries(${EXE} wsock32) + endif(WIN32 AND ${EXE} STREQUAL anopesmtp) + if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" AND ${EXE} STREQUAL anopesmtp) + target_link_libraries(${EXE} socket nsl) + endif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" AND ${EXE} STREQUAL anopesmtp) + # Set the executable to be installed to the bin directory under the main directory + install(TARGETS ${EXE} + DESTINATION ${BIN_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(SRC) # If not on Windows, generate anoperc and install it along with mydbgen |
