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") 23 set_source_files_properties(itrdrv.f PROPERTIES COMPILE_FLAGS "-qsuffix=cpp=f") 24endif(CMAKE_Fortran_COMPILER_ID MATCHES XL) 25if(CMAKE_Fortran_COMPILER_ID MATCHES PGI) 26 #force preprocessing of solfar.f 27 set_source_files_properties(solfar.f PROPERTIES COMPILE_FLAGS "-Mpreprocess") 28endif(CMAKE_Fortran_COMPILER_ID MATCHES PGI) 29#incompressible reuses a fortran module from common w/o telling cmake 30#this is why we specify a module directory in the next cmakelists up 31#and we need to serialize incompressible after common 32add_dependencies(incompressible common) 33find_library(ACUSOLVE_LIB libles) 34find_library(SVLS_LIB libsvLS) 35#ughhh 36set(PHASTAIC_LIBS 37 ${PHASTA_COMMON_LIBS} 38 incompressible 39 ${ACUSOLVE_LIB} 40 ${SVLS_LIB} 41 incompressible 42 ${PHASTA_COMMON_LIBS} 43) 44set(PHASTAIC_LIBS ${PHASTAIC_LIBS} phastaIO) 45if(PHASTA_BUILD_SHAPEFUNCTION) 46 set(PHASTAIC_LIBS ${PHASTAIC_LIBS} shapeFunction) 47endif(PHASTA_BUILD_SHAPEFUNCTION) 48if(PHASTA_BUILD_PHSHAPE) 49 set(PHASTAIC_LIBS ${PHASTAIC_LIBS} phshape) 50endif(PHASTA_BUILD_PHSHAPE) 51target_link_libraries(phastaIC.exe ${PHASTAIC_LIBS}) 52if(PHASTA_USE_PETSC) 53 #target_link_libraries(phastaC.exe ${PETSC_LIB}/libpetsc.a ${PETSC_PACKAGE_LIBS}) 54 target_link_libraries(phastaIC.exe petsc ${PETSC_PACKAGE_LIBS} ${PHASTAIC_LIBS}) 55endif() 56configure_file( 57 "${CMAKE_CURRENT_SOURCE_DIR}/phastaICConfig.cmake.in" 58 "${CMAKE_BINARY_DIR}/phastaICConfig.cmake" 59) 60 61if(PHASTA_TESTING) 62 add_subdirectory(test) 63endif(PHASTA_TESTING) 64