xref: /phasta/phSolver/incompressible/CMakeLists.txt (revision 18c3b980caf3bafba8f6b33a166d68bf7084ae7d)
159599516SKenneth E. Jansenfile(GLOB SRC_FILES *.cc *.f *.f90 *.c)
259599516SKenneth E. Jansenlist(REMOVE_ITEM SRC_FILES "main.c")
359599516SKenneth E. Jansenadd_library(incompressible ${SRC_FILES})
459599516SKenneth E. Jansenfind_library(ACUSOLVE_LIB libles)
559599516SKenneth E. Jansenif(PHASTA_USE_MPI)
659599516SKenneth E. Jansen	include_directories(${MPI_INCLUDE_PATH} ${MPI_Fortran_INCLUDE_PATH})
759599516SKenneth E. Jansenendif(PHASTA_USE_MPI)
8*18c3b980SCameron Smithinclude_directories(${PHASTA_BINARY_DIR})
959599516SKenneth E. Jansenadd_executable(phastaIC.exe main.c)
1059599516SKenneth E. Jansenset_target_properties(phastaIC.exe PROPERTIES HAS_CXX TRUE)
1159599516SKenneth E. Jansenset_target_properties(incompressible PROPERTIES HAS_CXX TRUE)
1259599516SKenneth E. Jansenset_target_properties(phastaIC.exe PROPERTIES LINKER_LANGUAGE Fortran)
1359599516SKenneth E. Jansenset_target_properties(incompressible PROPERTIES LINKER_LANGUAGE Fortran)
1459599516SKenneth E. Jansen
1559599516SKenneth E. Jansenif(CMAKE_Fortran_COMPILER_ID MATCHES XL)
1659599516SKenneth E. Jansen	#force preprocessing of solfar.f
1759599516SKenneth E. Jansen	set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-qsuffix=cpp=f")
1859599516SKenneth E. Jansenendif(CMAKE_Fortran_COMPILER_ID MATCHES XL)
1959599516SKenneth E. Jansenif(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
2059599516SKenneth E. Jansen	#force preprocessing of solfar.f
2159599516SKenneth E. Jansen	set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-Mpreprocess")
2259599516SKenneth E. Jansenendif(CMAKE_Fortran_COMPILER_ID MATCHES PGI)
2359599516SKenneth E. Jansen#incompressible reuses a fortran module from common w/o telling cmake
2459599516SKenneth E. Jansen#this is why we specify a module directory in the next cmakelists up
2559599516SKenneth E. Jansen#and we need to serialize incompressible after common
2659599516SKenneth E. Jansenadd_dependencies(incompressible common)
2759599516SKenneth E. Jansenif(PHASTA_USE_MPI)
2859599516SKenneth E. Jansen	target_link_libraries(phastaIC.exe ${MPI_LIBRARIES} ${MPI_Fortran_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
2959599516SKenneth E. Jansenendif(PHASTA_USE_MPI)
3059599516SKenneth E. Jansen
3159599516SKenneth E. Jansentarget_link_libraries(phastaIC.exe ${ACUSOLVE_LIB})
322992f42eSCameron Smithtarget_link_libraries(phastaIC.exe common incompressible common phastaIO)
3359599516SKenneth E. Jansenif(PHASTA_BUILD_SHAPEFUNCTION)
3459599516SKenneth E. Jansen	target_link_libraries(phastaIC.exe shapeFunction)
3559599516SKenneth E. Jansenendif(PHASTA_BUILD_SHAPEFUNCTION)
3659599516SKenneth E. Jansenif(PHASTA_BUILD_PHSHAPE)
3759599516SKenneth E. Jansen	target_link_libraries(phastaIC.exe phshape)
3859599516SKenneth E. Jansenendif(PHASTA_BUILD_PHSHAPE)
3959599516SKenneth E. Jansentarget_link_libraries(phastaIC.exe ${ACUSOLVE_LIB} incompressible)
40f3b67ec7SCameron Smith
41f3b67ec7SCameron Smithadd_subdirectory(test)
42