From 09144e712b7adbac6c5d88e716031ab2503c70dc Mon Sep 17 00:00:00 2001 From: Noel Eck Date: Tue, 29 Nov 2016 12:25:25 -0800 Subject: [PATCH] cmake: Consolidated BUILDJAVAEXAMPLES and BUILDEXAMPLES The java examples will now build if BUILDSWIGJAVA=on and BUILDEXAMPLES=on. This is similar to the C/C++ examples. * Replaced BUILDJAVAEXAMPLES w/BUILDEXAMPLES * Updated docs * Updated travis-ci Signed-off-by: Noel Eck --- .travis.yml | 2 +- CMakeLists.txt | 6 +++--- docs/building.md | 6 +----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 835f7297..f37a1572 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ script: - sudo make install - sudo ldconfig # Build/install UPM - - cd $UPM_ROOT && mkdir $UPM_BUILD && cd $_ && cmake -DNODE_ROOT_DIR:PATH="${NODE_ROOT_DIR}" -DBUILDSWIGJAVA=$BUILDJAVA -DBUILDEXAMPLES=ON -DBUILDJAVAEXAMPLES=$BUILDJAVA -DBUILDTESTS=ON -DBUILDFTI=ON .. && sudo make install && sudo ldconfig && ctest --output-on-failure -E examplenames_js + - cd $UPM_ROOT && mkdir $UPM_BUILD && cd $_ && cmake -DNODE_ROOT_DIR:PATH="${NODE_ROOT_DIR}" -DBUILDSWIGJAVA=$BUILDJAVA -DBUILDEXAMPLES=ON -DBUILDTESTS=ON -DBUILDFTI=ON .. && sudo make install && sudo ldconfig && ctest --output-on-failure -E examplenames_js addons: apt: sources: diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dbb84e0..4482ac9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,7 @@ option (BUILDFTI "Build Funtion Table Interface (FTI) in C sensor libraries" OFF option (BUILDSWIGPYTHON "Build swig python modules" ON) option (BUILDSWIGNODE "Build swig node modules" ON) option (BUILDSWIGJAVA "Build swig java modules" OFF) -option (BUILDEXAMPLES "Build C/C++ example binaries" OFF) -option (BUILDJAVAEXAMPLES "Build java example jars" OFF) +option (BUILDEXAMPLES "Build C/C++/JAVA examples" OFF) option (IPK "Generate IPK using CPack" OFF) option (RPM "Generate RPM using CPack" OFF) option (NPM "Generate NPM/GYP tarballs" OFF) @@ -417,7 +416,8 @@ if(BUILDEXAMPLES) endif(BUILDCPP) endif() -if(BUILDJAVAEXAMPLES) +# Build java examples +if(BUILDSWIGJAVA AND BUILDEXAMPLES) add_subdirectory (examples/java) endif() diff --git a/docs/building.md b/docs/building.md index 94c32aee..ca930186 100644 --- a/docs/building.md +++ b/docs/building.md @@ -80,14 +80,10 @@ Building documentation ~~~~~~~~~~~~~ -DBUILDDOC=ON ~~~~~~~~~~~~~ -Build C++ example binaries +Build C/C++/JAVA examples ~~~~~~~~~~~~~ -DBUILDEXAMPLES=ON ~~~~~~~~~~~~~ -Build Java examples -~~~~~~~~~~~~~ --DBUILDJAVAEXAMPLES=ON -~~~~~~~~~~~~~ If you intend to turn on all the options and build everything at once (C++, Java, Node, Python and Documentation) you will have to edit the