blob: 61ba7bc1aafd3eb5b6f15713c829b6aa135c59ef [file] [log] [blame]
Don Turnerfda67012018-01-19 18:10:25 +00001cmake_minimum_required(VERSION 3.4.1)
2
Don Turner6ee9cf32018-07-12 18:09:59 +01003# TODO: Remove this line and inherit it from the host environment
Phil Burk4a42e112018-08-24 10:11:52 -07004set(ANDROID_NDK $ENV{HOME}/Library/Android/sdk/ndk-bundle)
Don Turner6ee9cf32018-07-12 18:09:59 +01005
Don Turner94fe4852018-07-03 08:42:09 +01006# Include GoogleTest library
Don Turnereb236cc2018-07-03 08:33:05 +01007set(GOOGLETEST_ROOT ${ANDROID_NDK}/sources/third_party/googletest)
Don Turnerfda67012018-01-19 18:10:25 +00008add_library(gtest STATIC ${GOOGLETEST_ROOT}/src/gtest_main.cc ${GOOGLETEST_ROOT}/src/gtest-all.cc)
9target_include_directories(gtest PRIVATE ${GOOGLETEST_ROOT})
10target_include_directories(gtest PUBLIC ${GOOGLETEST_ROOT}/include)
11
Don Turner94fe4852018-07-03 08:42:09 +010012# Include Oboe sources
13set (OBOE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
14add_subdirectory(${OBOE_DIR} ./oboe-bin)
15include_directories(${OBOE_DIR}/include)
16
Don Turner63fef122018-08-24 12:51:58 +010017# include android headers
18include_directories(${ANDROID_NDK}/sysroot/usr/include)
19
Don Turner94fe4852018-07-03 08:42:09 +010020# Build the test binary
21add_executable(testOboe
22 testUtilities.cpp
23 testStreamClosedMethods.cpp
Don Turner0412fd52018-07-18 17:08:34 +010024 testStreamStates.cpp
Don Turner63fef122018-08-24 12:51:58 +010025 testStreamOpen.cpp
Don Turnerff649d02018-07-04 18:35:02 +010026 testXRunBehaviour.cpp
Don Turner94fe4852018-07-03 08:42:09 +010027 )
Don Turnerba5a01b2018-07-10 18:40:20 +010028target_link_libraries(testOboe gtest oboe)