Skip to content

Commit

Permalink
Move cmake packages detection after compiler settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
egorpugin committed Apr 10, 2018
1 parent f8e26ee commit 7dd2ecd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
48 changes: 27 additions & 21 deletions CMakeLists.txt
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cppan.yml
@@ -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
Expand Down

0 comments on commit 7dd2ecd

Please sign in to comment.