Skip to content

Commit 7dd2ecd

Browse files
committed
Move cmake packages detection after compiler settings.
1 parent f8e26ee commit 7dd2ecd

File tree

2 files changed

+29
-21
lines changed

2 files changed

+29
-21
lines changed

CMakeLists.txt

+27-21
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,6 @@ set(GENERIC_MICRO_VERSION ${VERSION_PATCH})
5353

5454
set(MINIMUM_LEPTONICA_VERSION 1.74)
5555

56-
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.cppan)
57-
if (NOT Leptonica_DIR AND NOT MSVC)
58-
find_package(PkgConfig REQUIRED)
59-
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
60-
link_directories(${Leptonica_LIBRARY_DIRS})
61-
else()
62-
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
63-
endif()
64-
else()
65-
if (STATIC)
66-
set(CPPAN_BUILD_SHARED_LIBS 0)
67-
else()
68-
set(CPPAN_BUILD_SHARED_LIBS 1)
69-
endif()
70-
add_subdirectory(.cppan)
71-
endif()
72-
73-
find_package(OpenCL QUIET)
74-
75-
option(BUILD_TRAINING_TOOLS "Build training tools" ON)
76-
7756
###############################################################################
7857
#
7958
# compiler and linker
@@ -105,6 +84,33 @@ if (UNIX)
10584
set(LIB_pthread pthread)
10685
endif()
10786

87+
###############################################################################
88+
#
89+
# packages
90+
#
91+
###############################################################################
92+
93+
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.cppan)
94+
if (NOT Leptonica_DIR AND NOT MSVC)
95+
find_package(PkgConfig REQUIRED)
96+
pkg_check_modules(Leptonica REQUIRED lept>=${MINIMUM_LEPTONICA_VERSION})
97+
link_directories(${Leptonica_LIBRARY_DIRS})
98+
else()
99+
find_package(Leptonica ${MINIMUM_LEPTONICA_VERSION} REQUIRED CONFIG)
100+
endif()
101+
else()
102+
if (STATIC)
103+
set(CPPAN_BUILD_SHARED_LIBS 0)
104+
else()
105+
set(CPPAN_BUILD_SHARED_LIBS 1)
106+
endif()
107+
add_subdirectory(.cppan)
108+
endif()
109+
110+
find_package(OpenCL QUIET)
111+
112+
option(BUILD_TRAINING_TOOLS "Build training tools" ON)
113+
108114
###############################################################################
109115
#
110116
# configure

cppan.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
local_settings:
22
#use_shared_libs: true
3+
#short_local_names: true
4+
#use_cache: false
35
#generator: Visual Studio 14 2015 Win64
46
silent: false
57
#copy_import_libs: true

0 commit comments

Comments
 (0)