Browse Source

fix for CxxTest in superbuild

lagkey
Trevor Irons 6 years ago
parent
commit
a81921d01e
3 changed files with 38 additions and 28 deletions
  1. 32
    27
      CMake/SuperBuild.cmake
  2. 5
    1
      CMakeLists.txt
  3. 1
    0
      Modules/LemmaCore/CMakeLists.txt

+ 32
- 27
CMake/SuperBuild.cmake View File

@@ -13,8 +13,11 @@ else()
13 13
         #CONFIGURE_COMMAND ""
14 14
         #BUILD_COMMAND ""
15 15
     )
16
-    include_directories ("${CMAKE_INSTALL_PREFIX}/include/eigen3/")
17
-    set (Eigen3_DIR  "${CMAKE_INSTALL_PREFIX}/include/eigen3" CACHE  PATH "" FORCE )
16
+    
17
+    # Are these necessary?
18
+    #include_directories ("${CMAKE_INSTALL_PREFIX}/include/eigen3/")
19
+    #set (Eigen3_DIR  "${CMAKE_INSTALL_PREFIX}/include/eigen3" CACHE  PATH "" FORCE )
20
+    
18 21
     #find_package (Eigen3 3.3 NO_MODULE REQUIRED)
19 22
     #if (eigen3_FOUND)
20 23
     #    message( STATUS "Eigen was found!!!!!!!!!!!!!! ${eigen_DIR}" )
@@ -42,34 +45,36 @@ else()
42 45
                    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 
43 46
     	           -DYAML_CPP_BUILD_TESTS=OFF
44 47
 	)	
45
-	include_directories ("${CMAKE_INSTALL_PREFIX}/include/yaml-cpp")
46
-	add_library(yaml-my-cpp SHARED IMPORTED)
48
+    # is this necessary?
49
+	#include_directories ("${CMAKE_INSTALL_PREFIX}/include/yaml-cpp")
47 50
 endif()
48 51
 
49 52
 if (LEMMA_ENABLE_TESTING)
50
-if (CXXTEST_FOUND)
51
-    #message( STATUS "CXXTEST FOUND" )
52
-else()
53
-	#message( STATUS "CxxTest will be built and installed along with Lemma, override if desired in GUI."  )
54
-	ExternalProject_Add(CxxTest
55
-		GIT_REPOSITORY "https://github.com/CxxTest/cxxtest.git"
56
-		GIT_TAG "master"
57
-		UPDATE_COMMAND ""
58
-		PATCH_COMMAND ""
59
-		CONFIGURE_COMMAND ""
60
-		BUILD_COMMAND ""
61
-		INSTALL_COMMAND ""
62
-    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest
63
-    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} /
64
-                   -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
65
-                   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
66
-	)
67
-	# The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues 
68
-	# with users wanting to specify their own path, its not recommended  
69
-	#set (CXXTEST_INCLUDE_DIR  "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/") # CACHE  PATH "" FORCE )
70
-	#set (CXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen") # CACHE PATH "" FORCE )
71
-	#find_package(CxxTest REQUIRED)
72
-endif()
53
+    if (CXXTEST_FOUND)
54
+        message( STATUS "CxxTest was found" )
55
+    else()
56
+	    message( STATUS "CxxTest WAS NOT FOUND") 
57
+	    ExternalProject_Add(CxxTest
58
+		    GIT_REPOSITORY "https://github.com/CxxTest/cxxtest.git"
59
+		    GIT_TAG "master"
60
+		    UPDATE_COMMAND ""
61
+		    PATCH_COMMAND ""
62
+		    CONFIGURE_COMMAND ""
63
+		    BUILD_COMMAND ""
64
+		    INSTALL_COMMAND ""
65
+    	    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest
66
+    	    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} /
67
+                       -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} /
68
+                       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
69
+	    )
70
+        #enable_testing()
71
+	    # The values "CACHE PATH "" FORCE" makes the GUI show the values of the local CxxTest, but this can cause issues 
72
+	    # with users wanting to specify their own path. However, the SuperBuild needs this, in theory you are only here 
73
+        # because a usable CXXTEST was not already found on the machine, so likely this is sane to do  
74
+	    set (CXXTEST_INCLUDE_DIR  "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/" CACHE  PATH "" FORCE )
75
+	    set (CXXTEST_PYTHON_TESTGEN_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/external/CxxTest/src/CxxTest/bin/cxxtestgen" CACHE PATH "" FORCE )
76
+	    find_package(CxxTest REQUIRED)
77
+    endif()
73 78
 endif()
74 79
 
75 80
 # tinyxml2, this library is used for XML IO 

+ 5
- 1
CMakeLists.txt View File

@@ -35,7 +35,10 @@ endif()
35 35
 
36 36
 ## Optional Dependencies
37 37
 if (LEMMA_ENABLE_TESTING)
38
-    find_package (CxxTest QUIET)                # Unit testin 
38
+    message (STATUS "LEMMA_ENABLE_TESTING is set" )
39
+    #find_package (CxxTest QUIET)            # Unit testing 
40
+    find_package (CxxTest)            # Unit testing 
41
+    message (STATUS "CXXTEST_FOUND ${CxxTest_FOUND}" )
39 42
 endif()
40 43
 
41 44
 #######################################################################
@@ -61,6 +64,7 @@ if ( NOT Eigen3_FOUND OR
61 64
   	return()                      # stop processing this file further
62 65
 else()
63 66
 	#project (Blah)                # <-- YOUR PROJECT NAME HERE
67
+	message( STATUS "CXX test Dir${CXXTEST_DIR}" )
64 68
 	message( STATUS "Everything was found, happy Lemma-ing" )
65 69
 endif()
66 70
 

+ 1
- 0
Modules/LemmaCore/CMakeLists.txt View File

@@ -21,6 +21,7 @@ if (LEMMA_MATIO_SUPPORT)
21 21
 endif()
22 22
 
23 23
 target_link_libraries (lemmacore Eigen3::Eigen)
24
+#target_link_libraries (lemmacore CxxTest)
24 25
 target_link_libraries (lemmacore ${YAML_CPP_LIBRARIES}) 
25 26
 
26 27
 # Linking

Loading…
Cancel
Save