From 743730550cad80afebf841e709e88db4a9625710 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 6 Jul 2016 16:49:55 -0600 Subject: [PATCH] CMakeLists.txt: move example subdir adds after add_subdirectory(src) is called This will ensure that all src modules are scanned first before examples (c++/java). In certain cases when doing parallel builds with many cores (8), the examples for MODBUS, BACNET, and OPENZWAVE would not be built, since their dependant libraries had not yet been located (in the src/ dir(s) via pkg_check_modules()), by the time the examples were being compiled. Signed-off-by: Jon Trulson --- CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbab8284..00e5951f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,14 +231,6 @@ if (RPM) include(CPack) endif() -if(BUILDEXAMPLES) - add_subdirectory (examples/c++) -endif() - -if(BUILDJAVAEXAMPLES) - add_subdirectory (examples/java) -endif() - if (BUILDSWIGPYTHON OR BUILDTESTS) if (BUILDPYTHON3) set (PYTHONBUILD_VERSION 3) @@ -248,6 +240,14 @@ if (BUILDSWIGPYTHON OR BUILDTESTS) endif () add_subdirectory (src) +if(BUILDEXAMPLES) + add_subdirectory (examples/c++) +endif() + +if(BUILDJAVAEXAMPLES) + add_subdirectory (examples/java) +endif() + if (BUILDTESTS) find_package (PythonInterp ${PYTHONBUILD_VERSION} REQUIRED)