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