Skip to content

Commit

Permalink
Merge branch 'develop' into detector_descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed May 4, 2015
2 parents 134cb1e + 641abd8 commit b70fc34
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cmakeFindModules/FindOpenMVG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FIND_PATH(OPENMVG_INCLUDE_DIR openMVG/version.h
)

IF(OPENMVG_INCLUDE_DIR)
MESSAGE(STATUS "OpenMVG headers found in ${OPENMVG_INCLUDE_DIRS}")
MESSAGE(STATUS "OpenMVG headers found in ${OPENMVG_INCLUDE_DIR}")
ELSE()
MESSAGE(STATUS "NOT FOUND")
ENDIF (OPENMVG_INCLUDE_DIR)
Expand Down
22 changes: 18 additions & 4 deletions src/cmakeFindModules/OptimizeForArchitecture.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,22 @@ macro(OptimizeForArchitecture)
set(_available_vector_units_list)

if(TARGET_ARCHITECTURE STREQUAL "auto")
AutodetectHostArchitecture()
message(STATUS "Detected CPU: ${TARGET_ARCHITECTURE}")
if(${CMAKE_COMPILER_IS_GNUCXX})
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_GREATER 4.2 OR GCC_VERSION VERSION_EQUAL 4.2)
set(_is_arch_native_supported YES)
endif()
endif()

if(_is_arch_native_supported)
AddCompilerFlag("-march=native")
set(TARGET_ARCHITECTURE "native")
message(STATUS "Optimizing for the host architecture using -march=native")
else()
AutodetectHostArchitecture()
message(STATUS "Detected CPU: ${TARGET_ARCHITECTURE}")
endif()
endif(TARGET_ARCHITECTURE STREQUAL "auto")

if(TARGET_ARCHITECTURE STREQUAL "core")
Expand Down Expand Up @@ -193,13 +207,13 @@ macro(OptimizeForArchitecture)
list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "sse4a")
elseif(TARGET_ARCHITECTURE STREQUAL "generic")
list(APPEND _march_flag_list "generic")
elseif(TARGET_ARCHITECTURE STREQUAL "none")
elseif(TARGET_ARCHITECTURE STREQUAL "none" OR TARGET_ARCHITECTURE STREQUAL "native")
# add this clause to remove it from the else clause
else(TARGET_ARCHITECTURE STREQUAL "core")
message(FATAL_ERROR "Unknown target architecture: \"${TARGET_ARCHITECTURE}\". Please set TARGET_ARCHITECTURE to a supported value.")
endif(TARGET_ARCHITECTURE STREQUAL "core")

if(NOT TARGET_ARCHITECTURE STREQUAL "none")
if(NOT (TARGET_ARCHITECTURE STREQUAL "none" OR TARGET_ARCHITECTURE STREQUAL "native"))
set(_disable_vector_unit_list)
set(_enable_vector_unit_list)
_my_find(_available_vector_units_list "sse2" SSE2_FOUND)
Expand Down

0 comments on commit b70fc34

Please sign in to comment.