Browse Source

Tweaks for non-default compiler

add-code-of-conduct-1
Trevor Irons 6 years ago
parent
commit
9b8a6662eb
2 changed files with 27 additions and 16 deletions
  1. 3
    1
      CMake/SuperBuild.cmake
  2. 24
    15
      CMakeLists.txt

+ 3
- 1
CMake/SuperBuild.cmake View File

49
                    -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
49
                    -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
50
                    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 
50
                    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 
51
     	           -DYAML_CPP_BUILD_TESTS=OFF
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
 		#INSTALL_COMMAND ""
55
 		#INSTALL_COMMAND ""
54
 	)	
56
 	)	
55
 
57
 

+ 24
- 15
CMakeLists.txt View File

24
 ## Options--what do you want to do
24
 ## Options--what do you want to do
25
 option ( BUILD_SHARED_LIBS      "Shared or static libraries"  OFF )
25
 option ( BUILD_SHARED_LIBS      "Shared or static libraries"  OFF )
26
 
26
 
27
+# If CMAKE_BUILD_TYPE is not specified, assume Release. 
27
 IF( NOT CMAKE_BUILD_TYPE )
28
 IF( NOT CMAKE_BUILD_TYPE )
28
    SET( CMAKE_BUILD_TYPE Release ... FORCE )
29
    SET( CMAKE_BUILD_TYPE Release ... FORCE )
29
 ENDIF()
30
 ENDIF()
39
 
40
 
40
 #option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
41
 #option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
41
 
42
 
43
+SET (CMAKE_CROSSCOMPILING TRUE)
42
 
44
 
43
 ##########################################################################################
45
 ##########################################################################################
44
 ## Only look for packages where we build them...this makes finding VTK a problem though! #
46
 ## Only look for packages where we build them...this makes finding VTK a problem though! #
47
     message ( STATUS "Cross-compiling! Only searching in install directory for components." )
49
     message ( STATUS "Cross-compiling! Only searching in install directory for components." )
48
     # Kind of hack-ish, CMake doesn't always find this. It's buried in Cross compilation, so, 
50
     # Kind of hack-ish, CMake doesn't always find this. It's buried in Cross compilation, so, 
49
     # hopefully anyone doing this can problem solve. 
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
 INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIR})
76
 INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIR})
68
 
77
 

Loading…
Cancel
Save