# don't build in the source directory if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") message (SEND_ERROR "Do not build in the source directory.") message (FATAL_ERROR "Remove the created \"CMakeCache.txt\" file and the \"CMakeFiles\" directory, then create a build directory and call \"${CMAKE_COMMAND} \".") endif ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") # finds all files with a given extension macro (append_files files ext) foreach (dir ${ARGN}) file (GLOB _files "${dir}/*.${ext}") list (APPEND ${files} ${_files}) endforeach (dir) endmacro (append_files) macro (target_library_output_dir tgt dir) if (NOT DEFINED PYTHON_PACKAGE_VERSION) set_property(TARGET ${tgt} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${dir}) endif() endmacro()