improved logic around BUILD_TESTS

This commit is contained in:
Alex Brinkman 2021-02-14 09:22:48 -08:00
parent 59821cb410
commit e0c3806045
1 changed files with 7 additions and 1 deletions

View File

@ -13,7 +13,13 @@ endif()
set(SOEM_INCLUDE_INSTALL_DIR include/soem) set(SOEM_INCLUDE_INSTALL_DIR include/soem)
set(SOEM_LIB_INSTALL_DIR lib) set(SOEM_LIB_INSTALL_DIR lib)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(BUILD_TESTS TRUE) set(BUILD_TESTS TRUE)
else()
message(STATUS "SOEM: not building tests when built as dependency")
set(BUILD_TESTS FALSE)
endif()
if(WIN32) if(WIN32)
set(OS "win32") set(OS "win32")