From e1222202dd1f980cc541e81f297b82360c9c2b51 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 12 May 2013 17:41:59 +0200 Subject: [PATCH] 0001097: CMake stops with error: Circular ... <- ... dependency dropped. --- CMakeLists.txt | 6 ++++++ data/examples/CMakeLists.txt | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 104dffe66..17cda74bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -439,8 +439,14 @@ IF(APPLE) SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") ENDIF(APPLE) +# force build directory to be different to source directory +#if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) +#MESSAGE(SEND_ERROR "The build directory (${CMAKE_BINARY_DIR}) must be different to the source directory " +# "(${CMAKE_SOURCE_DIR}). Please choose another build directory!") +#elseif() add_subdirectory(src) add_subdirectory(data) +#endif() # ================================================================================ # == Packaging =================================================================== diff --git a/data/examples/CMakeLists.txt b/data/examples/CMakeLists.txt index eb0e2f991..4c92d776b 100644 --- a/data/examples/CMakeLists.txt +++ b/data/examples/CMakeLists.txt @@ -12,7 +12,10 @@ ADD_CUSTOM_TARGET(Example_data ALL SOURCES ${Examples_Files} ) -fc_copy_sources(Examples "${CMAKE_BINARY_DIR}/data/examples" ${Examples_Files}) +# 0001097: CMake stops with error "Circular ... <- ... dependency dropped." +if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") + fc_copy_sources(Examples "${CMAKE_BINARY_DIR}/data/examples" ${Examples_Files}) +endif() INSTALL( FILES