From 72e5b99baa4a127bcb32a02405c08e652fda3b17 Mon Sep 17 00:00:00 2001 From: klickverbot Date: Mon, 27 Sep 2010 08:31:09 +0000 Subject: [PATCH] CMake: Added two configuration options for excluding the unit tests and the tools from the build. By default, the tools are built along the library, the tests are not, however. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@821 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- CMakeLists.txt | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 693fc61c8..a9189a726 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,9 +49,26 @@ ELSE ( ENABLE_BOOST_WORKAROUND ) INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) ENDIF ( ENABLE_BOOST_WORKAROUND ) + ADD_SUBDIRECTORY( code/ ) -IF ( WIN32 ) - ADD_SUBDIRECTORY( test/ ) - ADD_SUBDIRECTORY( tools/assimp_view/ ) -ENDIF ( WIN32 ) -ADD_SUBDIRECTORY( tools/assimp_cmd/ ) + +SET ( BUILD_ASSIMP_TOOLS ON CACHE BOOL + "If the supplementary tools for Assimp are built in addition to the library." +) +IF ( BUILD_ASSIMP_TOOLS ) + IF ( WIN32 ) + ADD_SUBDIRECTORY( tools/assimp_view/ ) + ENDIF ( WIN32 ) + ADD_SUBDIRECTORY( tools/assimp_cmd/ ) +ENDIF ( BUILD_ASSIMP_TOOLS ) + +SET ( BUILD_TESTS OFF CACHE BOOL + "If the test suite for Assimp is built in addition to the library." +) +IF ( BUILD_TESTS ) + IF ( WIN32 ) + ADD_SUBDIRECTORY( test/ ) + ELSE ( WIN32 ) + MESSAGE( WARNING "The Assimp test suite is currently Windows-only." ) + ENDIF ( WIN32 ) +ENDIF ( BUILD_TESTS )