mirror of
https://github.com/anope/anope.git
synced 2026-06-12 19:14:47 +02:00
OK, so the FIND sub-command of string() in CMake was only added with 2.8.5, change this to use the REGEX sub-commands instead. Also while I'm at it, make -pthread only get added when not on Mac OS X, it's auto-included there.
This commit is contained in:
+4
-5
@@ -133,10 +133,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
|
||||
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
|
||||
# For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off
|
||||
string(FIND ${INCLUDE} " (framework directory)" FRAMEWORK)
|
||||
if(NOT FRAMEWORK EQUAL -1)
|
||||
string(SUBSTRING ${INCLUDE} 0 ${FRAMEWORK} INCLUDE)
|
||||
endif(NOT FRAMEWORK EQUAL -1)
|
||||
string(REGEX REPLACE " \\(framework directory\\)$" "" INCLUDE ${INCLUDE})
|
||||
# Convert the path to an absolute one, just in case it wasn't
|
||||
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
|
||||
# Add that directory to the list of default include directories
|
||||
@@ -313,7 +310,9 @@ if(NOT MSVC)
|
||||
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
|
||||
if(HAVE_PTHREAD)
|
||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||
if(NOT APPLE)
|
||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||
endif(NOT APPLE)
|
||||
else(HAVE_PTHREAD)
|
||||
message(FATAL_ERROR "The pthread library is required to build Anope")
|
||||
endif(HAVE_PTHREAD)
|
||||
|
||||
+4
-2
@@ -395,10 +395,12 @@ macro(calculate_depends SRC SKIP)
|
||||
# This used to be find_in_list, but it was changed to this loop to do a find on each default include directory, this fixes Mac OS X trying to get it's framework directories in here
|
||||
set(FOUND_IN_DEFAULTS -1)
|
||||
foreach(DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIRS})
|
||||
string(REGEX REPLACE "\\+" "\\\\+" DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIR})
|
||||
string(REGEX MATCH ${DEFAULT_INCLUDE_DIR} FOUND_DEFAULT ${FOUND_${FILENAME}_INCLUDE})
|
||||
string(FIND ${FOUND_${FILENAME}_INCLUDE} ${DEFAULT_INCLUDE_DIR} FOUND_DEFAULT)
|
||||
if(NOT FOUND_DEFAULT EQUAL -1)
|
||||
if(FOUND_DEFAULT)
|
||||
set(FOUND_IN_DEFAULTS 0)
|
||||
endif(NOT FOUND_DEFAULT EQUAL -1)
|
||||
endif(FOUND_DEFAULT)
|
||||
endforeach(DEFAULT_INCLUDE_DIR)
|
||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
find_in_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||
|
||||
Reference in New Issue
Block a user