|
@@ -33,10 +33,25 @@ option (LEMMA_VTK6_SUPPORT "VTK 6.x library for visualisation and grids" OFF)
|
33
|
33
|
option (LEMMA_VTK7_SUPPORT "VTK 7.x library for visualisation and grids" OFF)
|
34
|
34
|
option (LEMMA_VTK8_SUPPORT "VTK 8.x library for visualisation and grids" OFF)
|
35
|
35
|
|
36
|
|
-## Hard Dependencies
|
37
|
|
-#set(Eigen3_DIR ${CMAKE_INSTALL_PREFIX} )
|
38
|
|
-find_package (Eigen3 3.3 QUIET) # Matrix/Vector & Math
|
39
|
|
-find_package (yaml-cpp 0.6 QUIET ) # Serialisation of classes
|
|
36
|
+#option (CMAKE_CROSSCOMPILING "Target different arch than you are on" OFF)
|
|
37
|
+
|
|
38
|
+##########################################################################################
|
|
39
|
+## Only look for packages where we build them...this makes finding VTK a problem though! #
|
|
40
|
+##########################################################################################
|
|
41
|
+if (CMAKE_CROSSCOMPILING)
|
|
42
|
+ message ( STATUS "Cross-compiling! Only searching in install directory for components." )
|
|
43
|
+ SET( CMAKE_FIND_ROOT_PATH ONLY ${CMAKE_INSTALL_PREFIX})
|
|
44
|
+ SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
|
|
45
|
+ SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
|
|
46
|
+ SET( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
|
|
47
|
+ UNSET( Eigen3_DIR CACHE )
|
|
48
|
+ UNSET( yaml-cpp_DIR CACHE )
|
|
49
|
+ find_package (Eigen3 3.3 )# QUIET) # Matrix/Vector & Math
|
|
50
|
+ find_package (yaml-cpp 0.6 ) #QUIET ) # Serialisation of classes
|
|
51
|
+endif()
|
|
52
|
+
|
|
53
|
+find_package (Eigen3 3.3 )# QUIET) # Matrix/Vector & Math
|
|
54
|
+find_package (yaml-cpp 0.6 ) #QUIET ) # Serialisation of classes
|
40
|
55
|
|
41
|
56
|
INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIR})
|
42
|
57
|
|
|
@@ -242,10 +257,17 @@ endif()
|
242
|
257
|
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
243
|
258
|
|
244
|
259
|
if (LEMMA_USE_OPENMP)
|
245
|
|
- find_package(OpenMP REQUIRED)
|
246
|
|
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
247
|
|
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
248
|
|
- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
|
|
260
|
+ if (CMAKE_CROSSCOMPILING)
|
|
261
|
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
|
|
262
|
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
|
|
263
|
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
|
|
264
|
+ #
|
|
265
|
+ else()
|
|
266
|
+ find_package(OpenMP REQUIRED)
|
|
267
|
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
|
268
|
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
|
269
|
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
|
|
270
|
+ endif()
|
249
|
271
|
endif()
|
250
|
272
|
|
251
|
273
|
configure_file (
|