Explorar el Código

Tweaks for non-default compiler

add-code-of-conduct-1
Trevor Irons hace 6 años
padre
commit
9b8a6662eb
Se han modificado 2 ficheros con 27 adiciones y 16 borrados
  1. 3
    1
      CMake/SuperBuild.cmake
  2. 24
    15
      CMakeLists.txt

+ 3
- 1
CMake/SuperBuild.cmake Ver fichero

@@ -49,7 +49,9 @@ else()
49 49
                    -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
50 50
                    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 
51 51
     	           -DYAML_CPP_BUILD_TESTS=OFF
52
-                   -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 
52
+                   -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
53
+                   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} 
54
+                   -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} 
53 55
 		#INSTALL_COMMAND ""
54 56
 	)	
55 57
 

+ 24
- 15
CMakeLists.txt Ver fichero

@@ -24,6 +24,7 @@ set(LEMMA_VERSION_NOQUOTES "${LEMMA_VERSION_MAJOR}.${LEMMA_VERSION_MINOR}.${LEMM
24 24
 ## Options--what do you want to do
25 25
 option ( BUILD_SHARED_LIBS      "Shared or static libraries"  OFF )
26 26
 
27
+# If CMAKE_BUILD_TYPE is not specified, assume Release. 
27 28
 IF( NOT CMAKE_BUILD_TYPE )
28 29
    SET( CMAKE_BUILD_TYPE Release ... FORCE )
29 30
 ENDIF()
@@ -39,6 +40,7 @@ option (LEMMA_VTK8_SUPPORT "VTK 8.x library for visualisation and grids" OFF)
39 40
 
40 41
 #option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
41 42
 
43
+SET (CMAKE_CROSSCOMPILING TRUE)
42 44
 
43 45
 ##########################################################################################
44 46
 ## Only look for packages where we build them...this makes finding VTK a problem though! #
@@ -47,22 +49,29 @@ if (CMAKE_CROSSCOMPILING)
47 49
     message ( STATUS "Cross-compiling! Only searching in install directory for components." )
48 50
     # Kind of hack-ish, CMake doesn't always find this. It's buried in Cross compilation, so, 
49 51
     # hopefully anyone doing this can problem solve. 
50
-    SET( CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/CMake ${CMAKE_INSTALL_PREFIX}/share/eigen3 )
51
-    #SET( CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX} )
52
-    SET( CMAKE_FIND_ROOT_PATH ONLY ${CMAKE_INSTALL_PREFIX})
53
-    SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY  ONLY ) 
54
-    SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE  ONLY ) 
55
-    SET( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE  ONLY )
56
-    UNSET( Eigen3_DIR CACHE ) 
57
-    UNSET( yaml-cpp_DIR CACHE ) 
58
-    UNSET( Eigen3_FOUND CACHE ) 
59
-    UNSET( yaml-cpp_FOUND CACHE ) 
60
-    find_package (yaml-cpp 0.6 PATHS ${CMAKE_INSTALL_PREFIX} ) #QUIET )  # Serialisation of classes 
61
-    find_package (Eigen3 3.3 PATHS ${CMAKE_INSTALL_PREFIX}  )   # QUIET)     # Matrix/Vector & Math
62
-endif()
52
+    #    SET( CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/CMake ${CMAKE_INSTALL_PREFIX}/share/eigen3 )
53
+
54
+    #    SET( CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX} )
55
+    #    SET( CMAKE_FIND_ROOT_PATH ONLY ${CMAKE_INSTALL_PREFIX} )
56
+    #    SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY  ONLY ) 
57
+    #    SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE  ONLY ) 
58
+    #    SET( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE  ONLY )
59
+
60
+    #    UNSET( Eigen3_DIR CACHE ) 
61
+    #    UNSET( yaml-cpp_DIR CACHE ) 
62
+    #    UNSET( Eigen3_FOUND CACHE ) 
63
+    #    UNSET( yaml-cpp_FOUND CACHE ) 
63 64
 
64
-find_package (Eigen3 3.3 QUIET)     # Matrix/Vector & Math
65
-find_package (yaml-cpp 0.6 QUIET )  # Serialisation of classes 
65
+    #message( STATUS "........Looking for yaml-cpp in ${CMAKE_INSTALL_PREFIX}" )
66
+    
67
+    find_package (yaml-cpp 0.6 PATHS ${CMAKE_INSTALL_PREFIX}  NO_DEFAULT_PATH ) # Serialisation of classes 
68
+    find_package (Eigen3   3.3 PATHS ${CMAKE_INSTALL_PREFIX}  NO_DEFAULT_PATH ) # Matrix/Vector & Math
69
+
70
+    #message( STATUS "yaml-cpp include dir ${YAML_CPP_INCLUDE_DIR}" )
71
+else()
72
+    find_package (Eigen3 3.3 QUIET)     # Matrix/Vector & Math
73
+    find_package (yaml-cpp 0.6 QUIET )  # Serialisation of classes 
74
+endif()
66 75
 
67 76
 INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIR})
68 77
 

Loading…
Cancelar
Guardar