Skip to content

Commit

Permalink
add options to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
r-shf committed Oct 19, 2015
1 parent 3beb2cb commit 281d5f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 8,24 @@ set (VERSION_MINOR 0)
set(CMAKE_CXX_FLAGS "-std=c 11 -pthread")
set(LIBAV_LIBRARIES m z avformat avcodec avutil avdevice swscale SDL)

set(basicfilters "1")
set(libavfilters "1")
set(ehealthfilters "0")
option(BUILD_BASIC_FILTERS "Build basic filters" ON)
option(BUILD_LIBAV_FILTERS "Build libav filters" ON)
option(BUILD_EHEALTH_FILTERS "Build ehealth filters" OFF)

include_directories(.)

aux_source_directory(core core_src)

if (${basicfilters})
if (BUILD_BASIC_FILTERS)
aux_source_directory(filters/basic basicfilters_src)
endif()

if(${libavfilters})
if(BUILD_LIBAV_FILTERS)
aux_source_directory(filters/libav/tools libavtools_src)
aux_source_directory(filters/libav libavfilters_src)
endif()

if(${ehealthfilters})
if(BUILD_EHEALTH_FILTERS)
aux_source_directory(filters/ehealth/tools ehealthtools_src)
aux_source_directory(filters/ehealth ehealthfilters_src)
endif()
Expand All @@ -37,11 37,11 @@ add_library(${PROJECT_NAME} SHARED ${core_src}
${ehealthtools_src}
${ehealthfilters_src})

if(${libavfilters})
if(BUILD_LIBAV_FILTERS)
target_link_libraries(${PROJECT_NAME} ${LIBAV_LIBRARIES})
endif()

if(${ehealthfilters})
if(BUILD_EHEALTH_FILTERS)
target_link_libraries(${PROJECT_NAME} ehealthsensor curl)
endif()

Expand Down
2 changes: 2 additions & 0 deletions build/build-ehealth.sh
Original file line number Diff line number Diff line change
@@ -0,0 1,2 @@
cmake -DBUILD_BASIC_FILTERS=OFF -DBUILD_LIBAV_FILTERS=OFF -DBUILD_EHEALTH_FILTERS=ON ..
make
6 changes: 3 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 2,14 @@ cmake_minimum_required (VERSION 2.6)

project (examples)

if(${basicfilters})
if(BUILD_BASIC_FILTERS)
add_subdirectory(basic)
endif()

if(${libavfilters})
if(BUILD_LIBAV_FILTERS)
add_subdirectory(libav)
endif()

if(${ehealthfilters})
if(BUILD_EHEALTH_FILTERS)
add_subdirectory(ehealth)
endif()

0 comments on commit 281d5f7

Please sign in to comment.