endif()
endmacro()
-function(KATIE_SETUP_SOURCES SOURCESVAR)
- set(compilesources)
- foreach(source ${ARGN})
- get_filename_component(sourcename ${source} NAME)
- set(compileflags)
- # TODO: sse4.1 and sse4.2 support, currently not needed
- foreach(flag 3dnow avx mmx sse sse2 sse3 ssse3 iwmmxt neon)
- string(REGEX MATCH "${flag}" flagmatch ${sourcename})
- string(TOUPPER "${flag}" upperflag)
- if("${flagmatch}" MATCHES "(iwmmxt|neon)" AND NOT "${KATIE_ARCHITECTURE}" STREQUAL "arm")
- set(flagmatch)
- katie_warning("The source file ${source} is ARM specifiec, make it conditional")
- endif()
- if("${flagmatch}" STREQUAL "mmx" AND "${sourcename}" MATCHES "iwmmxt")
- # false positive
- set(flagmatch)
- endif()
- if("${flagmatch}" STREQUAL "neon" AND KATIE_${upperflag}_RESULT)
- set(compileflags "${compileflags} -mfpu=neon")
- elseif("${flagmatch}" STREQUAL "iwmmxt" AND KATIE_${upperflag}_RESULT)
- set(compileflags "${compileflags} -mcpu=iwmmxt")
- elseif(flagmatch AND KATIE_${upperflag}_RESULT)
- set(compileflags "${compileflags} -m${flag}")
- endif()
- endforeach()
- if(compileflags)
- # message(STATUS "Setting up compile flags for: ${source} to: ${compileflags}")
- set_source_files_properties(${source} PROPERTIES COMPILE_FLAGS "${compileflags}")
- set(compilesources ${compilesources} ${source})
- endif()
- endforeach()
- if(compilesources)
- set(${SOURCESVAR} ${${SOURCESVAR}} ${compilesources} PARENT_SCOPE)
- endif()
-endfunction()
-
# a function to change full installation paths to relative so that CPack
# generators do not choke, still paths must contain a string of some sort - if
# they are null even quoting them will not help and CMake will complain that