Skip to content

Commit 864b5ca

Browse files
committed
[CMAKE] Added sampled to the build depending on a CMake option to be passed during configure.
Signed-off-by: Hatim-Pierre FAZILEABASSE <hatim-pierre.fazileabasse@ingenico.com>
1 parent 9ca7024 commit 864b5ca

File tree

8 files changed

+9
-2
lines changed

8 files changed

+9
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ script:
1717
- "cd build/$BUILDTYPE"
1818
- "cmake --configure -DCMAKE_BUILD_TYPE=$BUILDTYPE ../../"
1919
- "cmake --build ."
20-
- "cd test"
20+
- "cd tests"
2121
- "ctest ."
2222

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ project(json-maker
99

1010
set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL "ON" FORCE)
1111
set(CMAKE_EXECUTE_PROCESS_COMMAND_ECHO STDOUT)
12+
option(BUILD_SAMPLES "Will add sample apps to the build process." OFF)
1213

1314
add_compile_options(-std=c99 -Wall -pedantic)
1415

1516
add_subdirectory(src)
16-
add_subdirectory(test)
17+
add_subdirectory(tests)
18+
if(BUILD_SAMPLES)
19+
add_subdirectory(samples)
20+
endif() #BUILD_SAMPLES

samples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_subdirectory(src)

samples/src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
add_executable(sample_1 example.c)
2+
target_link_libraries(sample_1 PRIVATE json_maker)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)