1file(GLOB SRC_FILES *.cc *.f *.f90 *.c) 2list(REMOVE_ITEM SRC_FILES "main.c") 3add_library(incompressible ${SRC_FILES}) 4find_library(ACUSOLVE_LIB libles) 5if(PHASTA_USE_MPI) 6 include_directories(${MPI_INCLUDE_PATH} ${MPI_Fortran_INCLUDE_PATH}) 7endif(PHASTA_USE_MPI) 8include_directories(${PHASTA_BINARY_DIR}/include ${PHASTA_BINARY_DIR}) 9add_executable(phastaIC.exe main.c) 10set_target_properties(phastaIC.exe PROPERTIES HAS_CXX TRUE) 11set_target_properties(incompressible PROPERTIES HAS_CXX TRUE) 12set_target_properties(phastaIC.exe PROPERTIES LINKER_LANGUAGE Fortran) 13set_target_properties(incompressible PROPERTIES LINKER_LANGUAGE Fortran) 14 15if(CMAKE_Fortran_COMPILER_ID MATCHES XL) 16 #force preprocessing of solfar.f 17 set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-qsuffix=cpp=f") 18endif(CMAKE_Fortran_COMPILER_ID MATCHES XL) 19if(CMAKE_Fortran_COMPILER_ID MATCHES PGI) 20 #force preprocessing of solfar.f 21 set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-Mpreprocess") 22endif(CMAKE_Fortran_COMPILER_ID MATCHES PGI) 23#incompressible reuses a fortran module from common w/o telling cmake 24#this is why we specify a module directory in the next cmakelists up 25#and we need to serialize incompressible after common 26add_dependencies(incompressible common) 27if(PHASTA_USE_MPI) 28 target_link_libraries(phastaIC.exe ${MPI_LIBRARIES} ${MPI_Fortran_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) 29endif(PHASTA_USE_MPI) 30 31target_link_libraries(phastaIC.exe ${ACUSOLVE_LIB}) 32target_link_libraries(phastaIC.exe common incompressible phMetis common phMetis phastaIO) 33if(PHASTA_BUILD_SHAPEFUNCTION) 34 target_link_libraries(phastaIC.exe shapeFunction) 35endif(PHASTA_BUILD_SHAPEFUNCTION) 36if(PHASTA_BUILD_PHSHAPE) 37 target_link_libraries(phastaIC.exe phshape) 38endif(PHASTA_BUILD_PHSHAPE) 39target_link_libraries(phastaIC.exe ${ACUSOLVE_LIB} incompressible) 40