Move cmake packages detection after compiler settings.

This commit is contained in:
Egor Pugin 2018-04-11 00:16:31 +03:00
parent f8e26eedff
commit 7dd2ecd026
2 changed files with 29 additions and 21 deletions

View File

@ -53,27 +53,6 @@ set(GENERIC_MICRO_VERSION ${VERSION_PATCH})
set(MINIMUM_LEPTONICA_VERSION 1.74)
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.cppan)
if (NOT Leptonica_DIR AND NOT MSVC)
find_package(PkgConfig REQUIRED)
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
link_directories(${Leptonica_LIBRARY_DIRS})
else()
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
endif()
else()
if (STATIC)
set(CPPAN_BUILD_SHARED_LIBS 0)
else()
set(CPPAN_BUILD_SHARED_LIBS 1)
endif()
add_subdirectory(.cppan)
endif()
find_package(OpenCL QUIET)
option(BUILD_TRAINING_TOOLS "Build training tools" ON)
###############################################################################
#
# compiler and linker
@ -105,6 +84,33 @@ if (UNIX)
set(LIB_pthread pthread)
endif()
###############################################################################
#
# packages
#
###############################################################################
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.cppan)
if (NOT Leptonica_DIR AND NOT MSVC)
find_package(PkgConfig REQUIRED)
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
link_directories(${Leptonica_LIBRARY_DIRS})
else()
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
endif()
else()
if (STATIC)
set(CPPAN_BUILD_SHARED_LIBS 0)
else()
set(CPPAN_BUILD_SHARED_LIBS 1)
endif()
add_subdirectory(.cppan)
endif()
find_package(OpenCL QUIET)
option(BUILD_TRAINING_TOOLS "Build training tools" ON)
###############################################################################
#
# configure

View File

@ -1,5 +1,7 @@
local_settings:
#use_shared_libs: true
#short_local_names: true
#use_cache: false
#generator: Visual Studio 14 2015 Win64
silent: false
#copy_import_libs: true