xref: /phasta/phSolver/incompressible/CMakeLists.txt (revision 595995161822a203c8467e0e4a253d7bd7d6df32)
1*59599516SKenneth E. Jansenfile(GLOB SRC_FILES *.cc *.f *.f90 *.c)
2*59599516SKenneth E. Jansenlist(REMOVE_ITEM SRC_FILES "main.c")
3*59599516SKenneth E. Jansenadd_library(incompressible ${SRC_FILES})
4*59599516SKenneth E. Jansenfind_library(ACUSOLVE_LIB libles)
5*59599516SKenneth E. Jansenif(PHASTA_USE_MPI)
6*59599516SKenneth E. Jansen	include_directories(${MPI_INCLUDE_PATH} ${MPI_Fortran_INCLUDE_PATH})
7*59599516SKenneth E. Jansenendif(PHASTA_USE_MPI)
8*59599516SKenneth E. Janseninclude_directories(${PHASTA_BINARY_DIR}/include ${PHASTA_BINARY_DIR})
9*59599516SKenneth E. Jansenadd_executable(phastaIC.exe main.c)
10*59599516SKenneth E. Jansenset_target_properties(phastaIC.exe PROPERTIES HAS_CXX TRUE)
11*59599516SKenneth E. Jansenset_target_properties(incompressible PROPERTIES HAS_CXX TRUE)
12*59599516SKenneth E. Jansenset_target_properties(phastaIC.exe PROPERTIES LINKER_LANGUAGE Fortran)
13*59599516SKenneth E. Jansenset_target_properties(incompressible PROPERTIES LINKER_LANGUAGE Fortran)
14*59599516SKenneth E. Jansen
15*59599516SKenneth E. Jansenif(CMAKE_Fortran_COMPILER_ID MATCHES XL)
16*59599516SKenneth E. Jansen	#force preprocessing of solfar.f
17*59599516SKenneth E. Jansen	set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-qsuffix=cpp=f")
18*59599516SKenneth E. Jansenendif(CMAKE_Fortran_COMPILER_ID MATCHES XL)
19*59599516SKenneth E. Jansenif(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
20*59599516SKenneth E. Jansen	#force preprocessing of solfar.f
21*59599516SKenneth E. Jansen	set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-Mpreprocess")
22*59599516SKenneth E. Jansenendif(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
23*59599516SKenneth E. Jansen#incompressible reuses a fortran module from common w/o telling cmake
24*59599516SKenneth E. Jansen#this is why we specify a module directory in the next cmakelists up
25*59599516SKenneth E. Jansen#and we need to serialize incompressible after common
26*59599516SKenneth E. Jansenadd_dependencies(incompressible common)
27*59599516SKenneth E. Jansenif(PHASTA_USE_MPI)
28*59599516SKenneth E. Jansen	target_link_libraries(phastaIC.exe ${MPI_LIBRARIES} ${MPI_Fortran_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
29*59599516SKenneth E. Jansenendif(PHASTA_USE_MPI)
30*59599516SKenneth E. Jansen
31*59599516SKenneth E. Jansentarget_link_libraries(phastaIC.exe ${ACUSOLVE_LIB})
32*59599516SKenneth E. Jansentarget_link_libraries(phastaIC.exe common incompressible phMetis common phMetis phastaIO)
33*59599516SKenneth E. Jansenif(PHASTA_BUILD_SHAPEFUNCTION)
34*59599516SKenneth E. Jansen	target_link_libraries(phastaIC.exe shapeFunction)
35*59599516SKenneth E. Jansenendif(PHASTA_BUILD_SHAPEFUNCTION)
36*59599516SKenneth E. Jansenif(PHASTA_BUILD_PHSHAPE)
37*59599516SKenneth E. Jansen	target_link_libraries(phastaIC.exe phshape)
38*59599516SKenneth E. Jansenendif(PHASTA_BUILD_PHSHAPE)
39*59599516SKenneth E. Jansentarget_link_libraries(phastaIC.exe ${ACUSOLVE_LIB} incompressible)
40