--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,7 +89,9 @@
   DESTINATION "${CMAKE_INSTALL_DATADIR}/licenses/${PROJECT_NAME}"
 )
 
+if(WITH_TESTS)
 # add the testsuite
 enable_testing()
 set(fpm-toml "${PROJECT_SOURCE_DIR}/fpm.toml")
 add_subdirectory("test")
+endif()
