xref: /phasta/phSolver/incompressible/CMakeLists.txt (revision 0d32f9a804c0a2b00cb17c1df80aafdb299b28cb)
1include_directories(${SVLS_INCLUDE_DIR})
2file(GLOB SRC_FILES *.cc *.f *.f90 *.c)
3list(REMOVE_ITEM SRC_FILES "main.cc")
4add_library(incompressible ${SRC_FILES})
5
6find_package(phastaCommon REQUIRED PATHS ${CMAKE_BINARY_DIR})
7set(PHASTAIC_LIBS ${CMAKE_THREAD_LIBS_INIT} ${PHASTA_COMMON_LIBS})
8set(PHASTAIC_INCLUDE_DIRS
9  ${PHASTAIC_INCLUDE_DIRS}
10  ${PHASTA_COMMON_INCLUDE_DIRS}
11  ${PHASTA_BINARY_DIR}
12)
13
14add_executable(phastaIC.exe main.cc)
15include_directories(${PHASTAIC_INCLUDE_DIRS})
16set_target_properties(phastaIC.exe PROPERTIES HAS_CXX TRUE)
17set_target_properties(incompressible PROPERTIES HAS_CXX TRUE)
18set_target_properties(phastaIC.exe PROPERTIES LINKER_LANGUAGE Fortran)
19set_target_properties(incompressible PROPERTIES LINKER_LANGUAGE Fortran)
20if(CMAKE_Fortran_COMPILER_ID MATCHES XL)
21	#force preprocessing of solfar.f
22	set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-qsuffix=cpp=f")
23endif(CMAKE_Fortran_COMPILER_ID MATCHES XL)
24if(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
25	#force preprocessing of solfar.f
26	set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-Mpreprocess")
27endif(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
28#incompressible reuses a fortran module from common w/o telling cmake
29#this is why we specify a module directory in the next cmakelists up
30#and we need to serialize incompressible after common
31add_dependencies(incompressible common)
32find_library(ACUSOLVE_LIB libles)
33find_library(SVLS_LIB libsvLS)
34#ughhh
35set(PHASTAIC_LIBS
36  ${PHASTA_COMMON_LIBS}
37  incompressible
38  ${ACUSOLVE_LIB}
39  ${SVLS_LIB}
40  incompressible
41  ${PHASTA_COMMON_LIBS}
42)
43set(PHASTAIC_LIBS ${PHASTAIC_LIBS} phastaIO)
44if(PHASTA_BUILD_SHAPEFUNCTION)
45  set(PHASTAIC_LIBS ${PHASTAIC_LIBS} shapeFunction)
46endif(PHASTA_BUILD_SHAPEFUNCTION)
47if(PHASTA_BUILD_PHSHAPE)
48  set(PHASTAIC_LIBS ${PHASTAIC_LIBS} phshape)
49endif(PHASTA_BUILD_PHSHAPE)
50target_link_libraries(phastaIC.exe ${PHASTAIC_LIBS})
51if(PHASTA_USE_PETSC)
52	#target_link_libraries(phastaC.exe ${PETSC_LIB}/libpetsc.a ${PETSC_PACKAGE_LIBS})
53	target_link_libraries(phastaIC.exe petsc ${PETSC_PACKAGE_LIBS} ${PHASTAIC_LIBS})
54endif()
55configure_file(
56  "${CMAKE_CURRENT_SOURCE_DIR}/phastaICConfig.cmake.in"
57  "${CMAKE_BINARY_DIR}/phastaICConfig.cmake"
58)
59
60if(PHASTA_TESTING)
61  add_subdirectory(test)
62endif(PHASTA_TESTING)
63