Skip to content

Commit af55566

Browse files
committed
Added MUNKRESCPP_DEVEL_MODE configuration option which allow reduce dependencies for users (boost, etc).
1 parent 35fc0fb commit af55566

File tree

3 files changed

+31
-27
lines changed

3 files changed

+31
-27
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ before_script:
1818
- BUILD_DIR=`pwd`/build
1919
- mkdir -p ${BUILD_DIR}
2020
- cd ${BUILD_DIR}
21-
- cmake -DCMAKE_BUILD_TYPE=Debug ${BUILD_DIR}/..
21+
- cmake -DCMAKE_BUILD_TYPE=Debug -DMUNKRESCPP_DEVEL_MODE=ON ${BUILD_DIR}/..
2222
script:
2323
- cd ${BUILD_DIR}
2424
- make && make tests

CMakeLists.txt

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,38 @@ add_custom_target (example)
4343
add_dependencies (example munkres.bin)
4444

4545

46-
# Enable the ExternalProject_Add directive.
47-
# Which used for getting external tools for the Project.
48-
include (ExternalProject)
46+
option (MUNKRESCPP_DEVEL_MODE "Configure project in development mode." OFF)
47+
if (MUNKRESCPP_DEVEL_MODE)
48+
# Enable the ExternalProject_Add directive.
49+
# Which used for getting external tools for the Project.
50+
include (ExternalProject)
4951

5052

51-
# Testing
52-
add_subdirectory (tests)
53+
# Testing
54+
add_subdirectory (tests)
5355

5456

55-
# Benchmarking
56-
add_subdirectory (benchmarks)
57+
# Benchmarking
58+
add_subdirectory (benchmarks)
5759

5860

59-
# Custom target to build everything.
60-
add_custom_target (full)
61-
add_dependencies (
62-
full
63-
munkres
64-
example
65-
tests
66-
benchmarks
67-
)
61+
# Custom target to build everything.
62+
add_custom_target (full)
63+
add_dependencies (
64+
full
65+
munkres
66+
example
67+
tests
68+
benchmarks
69+
)
6870

6971

70-
# Static code analyse.
71-
set (CppCheck_REPORT ${PROJECT_BINARY_DIR}/cppcheck.report)
72-
add_custom_command (
73-
OUTPUT ${CppCheck_REPORT}
74-
COMMAND cppcheck ${MunkresCppLib_SOURCES} ${MunkresCppBin_SOURCES} -I${PROJECT_SOURCE_DIR}/src -I${PROJECT_SOURCE_DIR} --enable=all --force --inconclusive > cppcheck.report 2>&1
75-
)
76-
add_custom_target (cppcheck DEPENDS ${CppCheck_REPORT})
77-
set_directory_properties (PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CppCheck_REPORT})
72+
# Static code analyse.
73+
set (CppCheck_REPORT ${PROJECT_BINARY_DIR}/cppcheck.report)
74+
add_custom_command (
75+
OUTPUT ${CppCheck_REPORT}
76+
COMMAND cppcheck ${MunkresCppLib_SOURCES} ${MunkresCppBin_SOURCES} -I${PROJECT_SOURCE_DIR}/src -I${PROJECT_SOURCE_DIR} --enable=all --force --inconclusive > cppcheck.report 2>&1
77+
)
78+
add_custom_target (cppcheck DEPENDS ${CppCheck_REPORT})
79+
set_directory_properties (PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CppCheck_REPORT})
80+
endif ()

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ Development
6565

6666
For development purpose in the project implemented a variety of build targets.
6767
All of them help to continuously check correctness of algorithm implementation, performance, memory management, etc.
68+
To configure project in development mode ```-DMUNKRESCPP_DEVEL_MODE=ON``` option must be passed to CMake.
6869

6970
Launch of unit tests.
7071
The project contains unit tests to build and launch it performs the following steps:
7172
```
7273
$ git clone https://github.com/saebyn/munkres-cpp.git
7374
$ cd munkres-cpp
7475
$ mkdir build && cd build
75-
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
76+
$ cmake -DCMAKE_BUILD_TYPE=Debug -DMUNKRESCPP_DEVEL_MODE=ON ..
7677
$ make tests
7778
$ tests/munkrestest
7879
```
@@ -101,7 +102,7 @@ Buildning microbenchmarks:
101102
$ git clone https://github.com/saebyn/munkres-cpp.git
102103
$ cd munkres-cpp
103104
$ mkdir build && cd build
104-
$ cmake -DCMAKE_BUILD_TYPE=Release ..
105+
$ cmake -DCMAKE_BUILD_TYPE=Release -DMUNKRESCPP_DEVEL_MODE=ON ..
105106
$ make benchmarks
106107
```
107108
To get comparable results it's required to generate data set wich will be used for all benchmarks:

0 commit comments

Comments
 (0)