]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Fixed CMake so test will build correctly
authorJoshua Christopher <jcc242@nau.edu>
Fri, 1 Jun 2018 16:36:17 +0000 (10:36 -0600)
committerJoshua Christopher <jcc242@nau.edu>
Fri, 1 Jun 2018 16:36:17 +0000 (10:36 -0600)
parallel_in_time/CMakeLists.txt
parallel_in_time/test/CMakeLists.txt

index db5df0f55aa3c619d136142fa1328fae14c44d28..5e8d5bddd9493c22c61146dc69c9b008d8681f85 100644 (file)
@@ -12,16 +12,20 @@ set(PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
 set(SRC_PATH "${PROJECT_PATH}/src")
 set(TEST_SRC_PATH "${PROJECT_PATH}/test")
 # set(BIN_PATH  "${PROJECT_BINARY_DIR}/bin")
+set(LIB_NAME "${TARGET}_lib")
 set(BIN_NAME "${TARGET}")
 set(TEST_PATH "${PROJECT_BINARY_DIR}/test")
 set(TEST_NAME "test_${TARGET}")
 
-SET(TARGET_SRC
-  ${SRC_PATH}/${TARGET}.cc
+SET(LIB_SRC
   ${SRC_PATH}/BraidFuncs.cc
   ${SRC_PATH}/Utilities.cc
   )
 
+SET(TARGET_SRC
+  ${SRC_PATH}/${TARGET}.cc
+  )
+
 SET(TEST_SRC
   ${TEST_SRC_PATH}/test_braid.cc
   )
@@ -35,7 +39,7 @@ add_definitions(-DUSE_MPI)
 
 if(DO_MFG)
   # If we are doing the manufactured solution, tell
-  # the C++ processor so it can enable it
+  # the C++ processor so it can enable MFG solutions
   add_definitions(-DDO_MFG)
 endif(DO_MFG)
 
@@ -49,9 +53,6 @@ IF(NOT ${deal.II_FOUND})
     "or set an environment variable \"DEAL_II_DIR\" that contains this path."
     )
 ENDIF()
-# include_directories(${DEAL_II_INCLUDE_DIRS})
-
-
 
 # Find braid details
 if (NOT "$ENV{BRAID_DIR}" STREQUAL "")
@@ -60,10 +61,15 @@ endif()
 # Include the braid paths and libraries
 include_directories(${BRAID_DIR})
 
+# Build the library
+ADD_LIBRARY(${LIB_NAME} SHARED ${LIB_SRC})
+DEAL_II_SETUP_TARGET(${LIB_NAME})
+
 DEAL_II_INITIALIZE_CACHED_VARIABLES()
 PROJECT(${TARGET})
 DEAL_II_INVOKE_AUTOPILOT()
 target_link_libraries(${TARGET} ${BRAID_DIR}libbraid.a) # link braid
+target_link_libraries(${TARGET} ${LIB_NAME})
 set_target_properties(${TARGET} PROPERTIES
   LINK_FLAGS "${MPI_LINK_FLAGS}") # Link MPI
 set_target_properties(${MAIN_NAME} PROPERTIES
@@ -71,7 +77,6 @@ set_target_properties(${MAIN_NAME} PROPERTIES
 
 # Lastly build the tests
 enable_testing()
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${TEST_PATH})
 add_subdirectory(test)
 
 
index 2877d5ffb6b54e130201b5520f0615a5eda80035..d3ea75bd367e8211f402782b4d547e3c9d0befee 100644 (file)
@@ -1,2 +1,3 @@
+include_directories(${SRC_PATH})
 set(TEST_LIBRARIES ${LIB_NAME} ${BRAID_DIR}/libbraid.a)
 DEAL_II_PICKUP_TESTS()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.