From 6ca60d907e8e46f98ac2dd0cbc95bafd42d9d368 Mon Sep 17 00:00:00 2001
From: Gennady Pospelov <g.pospelov@fz-juelich.de>
Date: Tue, 17 Sep 2013 15:54:33 +0200
Subject: [PATCH] CMake fix for python tests

---
 CMakeLists.txt                                |  2 +-
 Tests/FunctionalTests/TestCore/CMakeLists.txt | 17 ++++++-----------
 Tests/FunctionalTests/TestFit/CMakeLists.txt  | 16 ++++++----------
 3 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed74303c48e..1b442de15e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@ project(BornAgain)
 
 # --- General project settings ---
 if(NOT BORNAGAIN_PYTHON)
-#    set(BORNAGAIN_PYTHON ON)
+    set(BORNAGAIN_PYTHON ON)
 endif()
 
 if(NOT BORNAGAIN_APP)
diff --git a/Tests/FunctionalTests/TestCore/CMakeLists.txt b/Tests/FunctionalTests/TestCore/CMakeLists.txt
index d8e1013294b..90d2e2e1dcf 100644
--- a/Tests/FunctionalTests/TestCore/CMakeLists.txt
+++ b/Tests/FunctionalTests/TestCore/CMakeLists.txt
@@ -25,20 +25,15 @@ if(MSVC)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /EHsc ")
 endif()
 
-include_directories(${Boost_INCLUDE_DIRS})
+include_directories(
+    ${Boost_INCLUDE_DIRS}
+    ${BornAgainCore_INCLUDE_DIRS}
+    ${EIGEN3_INCLUDE_DIR}
+)
+
 foreach(_test ${list_of_tests})
-#     file(GLOB source_files ${_test}/*.cpp)
-#     add_executable(${_test} EXCLUDE_FROM_ALL ${source_files})
-#     include_directories(${BornAgainCore_INCLUDE_DIRS})
-#     include_directories(${Boost_INCLUDE_DIRS})
-#     target_link_libraries(${_test} ${BornAgainCore_LIBRARY}) 
-#     add_test( ${_test} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_test} "${CMAKE_BINARY_DIR}/Tests/ReferenceData/BornAgain/") # TestName ExeName Arguments
-#     add_dependencies(check ${_test})
    BORNAGAIN_EXECUTABLE(${_test} LOCATIONS ${_test} EXCLUDE_FROM_ALL LIBRARIES ${BornAgainCore_LIBRARY})
    BORNAGAIN_ADD_TEST(${_test} INPUT_DIR ${CMAKE_BINARY_DIR}/Tests/ReferenceData/BornAgain/)
 endforeach()
 
 
-#set_property(TARGET ${_test} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
-#set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-
diff --git a/Tests/FunctionalTests/TestFit/CMakeLists.txt b/Tests/FunctionalTests/TestFit/CMakeLists.txt
index 8e2e02c6f6b..98a44bc1c8d 100644
--- a/Tests/FunctionalTests/TestFit/CMakeLists.txt
+++ b/Tests/FunctionalTests/TestFit/CMakeLists.txt
@@ -15,20 +15,16 @@ if(MSVC)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /EHsc ")
 endif()
 
-include_directories(${Boost_INCLUDE_DIRS})
-include_directories(${BornAgainCore_INCLUDE_DIRS})
-include_directories(${BornAgainFit_INCLUDE_DIRS})
+include_directories(
+    ${Boost_INCLUDE_DIRS}
+    ${BornAgainCore_INCLUDE_DIRS}
+    ${BornAgainFit_INCLUDE_DIRS}
+    ${EIGEN3_INCLUDE_DIR}
+)
 
 foreach(_test ${list_of_tests})
     BORNAGAIN_EXECUTABLE(${_test} LOCATIONS ${_test} EXCLUDE_FROM_ALL LIBRARIES ${BornAgainFit_LIBRARY} ${BornAgainCore_LIBRARY})
     BORNAGAIN_ADD_TEST(${_test})
 endforeach()
 
-#foreach(_test ${list_of_tests})
-#    file(GLOB source_files ${_test}/*.cpp)
-#    add_executable(${_test} ${source_files})
-#    target_link_libraries(${_test} ${BornAgainFit_LIBRARY} ${BornAgainCore_LIBRARY}) 
-#    install (TARGETS ${_test} DESTINATION bin COMPONENT Applications)
-#endforeach()
-
 
-- 
GitLab