diff options
-rw-r--r-- | unittests/CMakeLists.txt | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 39fc51437..c2990c59f 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -17,10 +17,12 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") set(GTEST_DIR gtest) add_subdirectory(${GTEST_DIR}) include_directories(${GTEST_DIR}/include) + +set(PX_SRC ${CMAKE_SOURCE_DIR}/../src) include_directories(${CMAKE_SOURCE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/../src) -include_directories(${CMAKE_SOURCE_DIR}/../src/modules) -include_directories(${CMAKE_SOURCE_DIR}/../src/lib) +include_directories(${PX_SRC}) +include_directories(${PX_SRC}/modules) +include_directories(${PX_SRC}/lib) add_definitions(-D__EXPORT=) @@ -37,25 +39,25 @@ endfunction() # add each test -add_executable(autodeclination_test autodeclination_test.cpp ${CMAKE_SOURCE_DIR}/../src/lib/geo_lookup/geo_mag_declination.c) +add_executable(autodeclination_test autodeclination_test.cpp ${PX_SRC}/lib/geo_lookup/geo_mag_declination.c) add_gtest(autodeclination_test) # mixer_test -add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/mixer_multirotor.generated.h - COMMAND ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/multi_tables.py > ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/mixer_multirotor.generated.h) +add_custom_command(OUTPUT ${PX_SRC}/modules/systemlib/mixer/mixer_multirotor.generated.h + COMMAND ${PX_SRC}/modules/systemlib/mixer/multi_tables.py > ${PX_SRC}/modules/systemlib/mixer/mixer_multirotor.generated.h) add_executable(mixer_test mixer_test.cpp hrt.cpp - ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/mixer.cpp - ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/mixer_group.cpp - ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/mixer_load.c - ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/mixer_multirotor.cpp - ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/mixer_multirotor.generated.h - ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/mixer/mixer_simple.cpp - ${CMAKE_SOURCE_DIR}/../src/modules/systemlib/pwm_limit/pwm_limit.c - ${CMAKE_SOURCE_DIR}/../src/systemcmds/tests/test_mixer.cpp) + ${PX_SRC}/modules/systemlib/mixer/mixer.cpp + ${PX_SRC}/modules/systemlib/mixer/mixer_group.cpp + ${PX_SRC}/modules/systemlib/mixer/mixer_load.c + ${PX_SRC}/modules/systemlib/mixer/mixer_multirotor.cpp + ${PX_SRC}/modules/systemlib/mixer/mixer_multirotor.generated.h + ${PX_SRC}/modules/systemlib/mixer/mixer_simple.cpp + ${PX_SRC}/modules/systemlib/pwm_limit/pwm_limit.c + ${PX_SRC}/systemcmds/tests/test_mixer.cpp) add_gtest(mixer_test) # conversion_test -add_executable(conversion_test conversion_test.cpp ${CMAKE_SOURCE_DIR}/../src/systemcmds/tests/test_conv.cpp) +add_executable(conversion_test conversion_test.cpp ${PX_SRC}/systemcmds/tests/test_conv.cpp) add_gtest(conversion_test) # sbus2_test @@ -65,10 +67,10 @@ add_gtest(sbus2_test) # st24_test # TODO: move to gtest -add_executable(st24_test st24_test.cpp hrt.cpp ${CMAKE_SOURCE_DIR}/../src/lib/rc/st24.c) +add_executable(st24_test st24_test.cpp hrt.cpp ${PX_SRC}/lib/rc/st24.c) add_gtest(st24_test) # sf0x_test # TODO: move to gtest -add_executable(sf0x_test sf0x_test.cpp ${CMAKE_SOURCE_DIR}/../src/drivers/sf0x/sf0x_parser.cpp) +add_executable(sf0x_test sf0x_test.cpp ${PX_SRC}/drivers/sf0x/sf0x_parser.cpp) add_gtest(sf0x_test) |