To support using this CMakeLists.txt file as an add_subdirectory() of a higher-level project, change CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR, CMAKE_BINARY_DIR to CMAKE_CURRENT_BINARY_DIR, and let values be set for otherwise internally-used variables (CMAKE_DEBUG_POSTFIX, DLLDEST, LIBDEST, HDRDEST, and TESTDEST).
To support using this CMakeLists.txt file as an add_subdirectory() of a higher-level project, change CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR, CMAKE_BINARY_DIR to CMAKE_CURRENT_BINARY_DIR, and let values be set for otherwise internally-used variables (CMAKE_DEBUG_POSTFIX, DLLDEST, LIBDEST, HDRDEST, and TESTDEST).