Skip to content

Commit

Permalink
tests: only enable when PARTIO_GTEST_ENABLED is ON
Browse files Browse the repository at this point in the history
We were entering the src/tests directory but it should not be
built when PARTIO_GTEST_ENABLED=OFF. Move the add_subdirectory
step into the conditional block.
  • Loading branch information
davvid committed Jul 2, 2023
1 parent e3c03bc commit 2200a23
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,17 @@ endif()
# Make modules able to see partio library
set(PARTIO_LIBRARIES partio ${ZLIB_LIBRARY})

## Traverse subdirectories
add_subdirectory(src/lib)
add_subdirectory(src/tools)
add_subdirectory(src/py)
add_subdirectory(src/doc)

if (${PARTIO_GTEST_ENABLED})
set(GTEST_LOCATION "/usr" CACHE STRING "gtest installation prefix")
set(GTEST_INCLUDE_PATH ${GTEST_LOCATION}/include)
set(GTEST_LIBDIR ${CMAKE_INSTALL_LIBDIR})
set(GTEST_LINK_PATH ${GTEST_LOCATION}/${GTEST_LIBDIR} CACHE STRING "gtest library directory")

add_subdirectory(src/tests)
endif()

## Traverse subdirectories
add_subdirectory(src/lib)
add_subdirectory(src/tools)
add_subdirectory(src/py)
add_subdirectory(src/tests)
add_subdirectory(src/doc)

0 comments on commit 2200a23

Please sign in to comment.