Skip to content

Commit

Permalink
cmake: show configuration summary
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Apr 22, 2019
1 parent 21838b0 commit 3f9bb66
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,17 @@ foreach(flag ${Vc_ARCHITECTURE_FLAGS})
endforeach()

# add definition as expected in src/arch/simddetect.cpp
set(AVX_OPT 0)
set(AVX2_OPT 0)
set(SSE41_OPT 0)
set(MARCH_NATIVE_OPT 0)
set(AVX_OPT OFF)
set(AVX2_OPT OFF)
set(SSE41_OPT OFF)
set(MARCH_NATIVE_OPT OFF)
foreach(flag ${_enable_vector_unit_list}) # from OptimizeForArchitecture()
string(TOUPPER "${flag}" flag)
string(REPLACE "\." "_" flag "${flag}")
set(sim_flags "${sim_flags} -D${flag}")
string(REPLACE "_" "" flag "${flag}")
if("${flag}" MATCHES "AVX|AVX2|SSE41")
set("${flag}_OPT" 1)
set("${flag}_OPT" ON)
endif()
endforeach(flag)
FILE(GLOB arch_files "src/arch/*.cpp")
Expand All @@ -204,7 +204,7 @@ CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native")
set_source_files_properties(src/arch/dotproduct.cpp PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ffast-math")
set(MARCH_NATIVE_OPT 1)
set(MARCH_NATIVE_OPT ON)
endif()

set(AUTOCONFIG_SRC ${CMAKE_CURRENT_BINARY_DIR}/config_auto.h.in)
Expand Down Expand Up @@ -237,6 +237,33 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/TesseractConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/TesseractConfig.cmake @ONLY)

# show summary of configuration
message( STATUS )
message( STATUS "General configuration for Tesseract ${PACKAGE_VERSION}")
message( STATUS "--------------------------------------------------------")
message( STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message( STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID}")
message( STATUS "CXX compiler options: ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UP}} ${CMAKE_CXX_FLAGS}")
message( STATUS "Linker options: ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UP}}")
message( STATUS "Install directory: ${CMAKE_INSTALL_PREFIX}")
message( STATUS "Architecture flags: ${Vc_ARCHITECTURE_FLAGS}")
message( STATUS "Vector unit list: ${_enable_vector_unit_list}")
message( STATUS "AVX_OPT: ${AVX_OPT}")
message( STATUS "AVX2_OPT: ${AVX2_OPT}")
message( STATUS "SSE41_OPT: ${SSE41_OPT}")
message( STATUS "MARCH_NATIVE_OPT: ${MARCH_NATIVE_OPT}")
message( STATUS "sim_flags: ${sim_flags}")

This comment has been minimized.

Copy link
@egorpugin

egorpugin Nov 10, 2019

Contributor

simd?

This comment has been minimized.

Copy link
@zdenop

zdenop Nov 11, 2019

Author Contributor

Thanks. Fixed.

message( STATUS )
message( STATUS "Build with cppan [CPPAN_BUILD]: ${CPPAN_BUILD}")
message( STATUS "Build with openmp support [OPENMP_BUILD]: ${OPENMP_BUILD}")
message( STATUS "Disable disable graphics (ScrollView) [GRAPHICS_DISABLED]: ${GRAPHICS_DISABLED}")
message( STATUS "Enable embedded build [EMBEDDED]: ${EMBEDDED}")
message( STATUS "Disable the legacy OCR engine [DISABLED_LEGACY_ENGINE]: ${DISABLED_LEGACY_ENGINE}")
message( STATUS "Build training tools [BUILD_TRAINING_TOOLS]: ${BUILD_TRAINING_TOOLS}")
message( STATUS "Build tests [BUILD_TESTS]: ${BUILD_TESTS}")
message( STATUS "--------------------------------------------------------")
message( STATUS )

###############################################################################
#
# build
Expand Down

0 comments on commit 3f9bb66

Please sign in to comment.