Browse Source

Clean up CMake for default compilers

add-code-of-conduct-1
Trevor Irons 6 years ago
parent
commit
2cd3336f69
2 changed files with 25 additions and 8 deletions
  1. 24
    7
      CMake/SuperBuild.cmake
  2. 1
    1
      CMakeLists.txt

+ 24
- 7
CMake/SuperBuild.cmake View File

1
 include(ExternalProject)
1
 include(ExternalProject)
2
 
2
 
3
+project (SuperBuild CXX C)
4
+
3
 if (Eigen3_FOUND)
5
 if (Eigen3_FOUND)
4
     message( STATUS "Eigen was found ${eigen_DIR}" )
6
     message( STATUS "Eigen was found ${eigen_DIR}" )
5
 else()
7
 else()
14
 		#BUILD_COMMAND     ""
16
 		#BUILD_COMMAND     ""
15
 		#INSTALL_COMMAND     ""
17
 		#INSTALL_COMMAND     ""
16
     )
18
     )
17
-
18
     #message("Source dir of myExtProj = ${SOURCE_DIR}")   
19
     #message("Source dir of myExtProj = ${SOURCE_DIR}")   
19
     #ExternalProject_Get_property(EIGEN SOURCE_DIR)
20
     #ExternalProject_Get_property(EIGEN SOURCE_DIR)
20
     #message("Source dir of myExtProj = ${SOURCE_DIR}")   
21
     #message("Source dir of myExtProj = ${SOURCE_DIR}")   
29
     #endif()
30
     #endif()
30
 endif()
31
 endif()
31
 
32
 
33
+
32
 if (yaml-cpp_FOUND)
34
 if (yaml-cpp_FOUND)
33
     message( STATUS "YAML-CPP was found ${yaml-cpp_FOUND}" )
35
     message( STATUS "YAML-CPP was found ${yaml-cpp_FOUND}" )
34
     #message( STATUS "YAML-CPP PATH ${yaml-cpp_PATH}" )
36
     #message( STATUS "YAML-CPP PATH ${yaml-cpp_PATH}" )
39
 else()
41
 else()
40
     message( STATUS "YAML-CPP WAS NOT FOUND, BUILDING" )
42
     message( STATUS "YAML-CPP WAS NOT FOUND, BUILDING" )
41
     message( STATUS "CMAKE BUILD TYPE ${CMAKE_BUILD_TYPE}" )
43
     message( STATUS "CMAKE BUILD TYPE ${CMAKE_BUILD_TYPE}" )
42
-	ExternalProject_Add(YAML_CPP
44
+    message( STATUS "CMAKE CXX COMPILER ${CMAKE_CXX_COMPILER}" )
45
+#    if ( ${CMAKE_C_COMPILER} )
46
+#        message( STATUS "Compiling Yaml with Cxx COMPILER ${CMAKE_CXX_COMPILER}" )
47
+#	    ExternalProject_Add(YAML_CPP
48
+#		GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
49
+#		GIT_TAG   "yaml-cpp-0.6.1" # "master" 
50
+#		UPDATE_COMMAND ""
51
+#		PATCH_COMMAND ""
52
+#    	PREFIX ${CMAKE_CURRENT_BINARY_DIR}/external/yaml-cpp
53
+#    	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} 
54
+#                   -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
55
+#                   -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 
56
+#    	           -DYAML_CPP_BUILD_TESTS=OFF
57
+#                   -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
58
+#                   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} 
59
+#                   -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 
60
+#        )
61
+#    else()
62
+	    ExternalProject_Add(YAML_CPP
43
 		GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
63
 		GIT_REPOSITORY  "https://github.com/jbeder/yaml-cpp.git"
44
 		GIT_TAG   "yaml-cpp-0.6.1" # "master" 
64
 		GIT_TAG   "yaml-cpp-0.6.1" # "master" 
45
 		UPDATE_COMMAND ""
65
 		UPDATE_COMMAND ""
52
                    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
72
                    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
53
                    -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} 
73
                    -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} 
54
                    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 
74
                    -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 
55
-		#INSTALL_COMMAND ""
56
-	)	
57
-
58
-    # is this necessary?
59
-	#include_directories ("${CMAKE_INSTALL_PREFIX}/include/yaml-cpp")
75
+        )
76
+#    endif()
60
 endif()
77
 endif()
61
 
78
 
62
 if (LEMMA_ENABLE_TESTING)
79
 if (LEMMA_ENABLE_TESTING)

+ 1
- 1
CMakeLists.txt View File

41
 #option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
41
 #option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
42
 
42
 
43
 SET( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMake/ )
43
 SET( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMake/ )
44
-message( STATUS "MODULE PATH ${CMAKE_MODULE_PATH}" )
44
+#message( STATUS "MODULE PATH ${CMAKE_MODULE_PATH}" )
45
 
45
 
46
 SET (CMAKE_CROSSCOMPILING TRUE)
46
 SET (CMAKE_CROSSCOMPILING TRUE)
47
 
47
 

Loading…
Cancel
Save