-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,096 changed files
with
173,940 additions
and
1 deletion.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
example/1d-heat-equation/RK3/cpp/multiblock/parallel/4blocks/01/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
cmake_minimum_required(VERSION 3.30) | ||
|
||
project( testprj ) | ||
|
||
set ( PRJ_COMPILE_FEATURES ) | ||
set ( PRJ_COMPILE_DEFINITIONS ) | ||
set ( PRJ_LIBRARIES ) | ||
set ( PRJ_INCLUDE_DIRS ) | ||
|
||
list ( APPEND PRJ_COMPILE_FEATURES cxx_std_23 ) | ||
|
||
find_package ( MPI ) | ||
|
||
message ( STATUS "MPI_FOUND=${MPI_FOUND}" ) | ||
message ( STATUS "MPI_CXX_INCLUDE_DIRS=${MPI_CXX_INCLUDE_DIRS}" ) | ||
message ( STATUS "MPI_LIBRARIES=${MPI_LIBRARIES}" ) | ||
if ( MPI_FOUND ) | ||
list ( APPEND PRJ_INCLUDE_DIRS ${MPI_CXX_INCLUDE_DIRS} ) | ||
list ( APPEND PRJ_LIBRARIES ${MPI_LIBRARIES} ) | ||
endif () | ||
|
||
#get_directory_property( my_import_targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} IMPORTED_TARGETS ) | ||
#message( STATUS "my_import_targets=${my_import_targets}" ) | ||
|
||
list ( APPEND PRJ_LIBRARIES MPI::MPI_C ) | ||
|
||
find_package(Eigen3 CONFIG REQUIRED) | ||
|
||
message ( STATUS "EIGEN3_INCLUDE_DIR = ${EIGEN3_INCLUDE_DIR}" ) | ||
|
||
#list ( APPEND PRJ_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR} ) | ||
list ( APPEND PRJ_LIBRARIES Eigen3::Eigen ) | ||
set ( CGNS_INCLUDE_DIRS $ENV{CGNS_INC} ) | ||
set ( CGNS_LIBRARIES $ENV{CGNS_LIB_SHARED_NAME} ) | ||
|
||
if ( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" ) | ||
set ( CGNS_ROOT "C:/dev/cgns/4.4.0" ) | ||
set ( CGNS_LIBNAME "cgnsdll.lib" ) | ||
|
||
set ( CGNS_INCLUDE_DIRS "${CGNS_ROOT}/include" CACHE PATH "path to CGNS headers" ) | ||
set ( CGNS_LIBRARIES "${CGNS_ROOT}/lib/${CGNS_LIBNAME}" CACHE PATH "path to CGNS library" ) | ||
endif() | ||
|
||
list ( APPEND PRJ_LIBRARIES ${CGNS_LIBRARIES} ) | ||
list ( APPEND PRJ_INCLUDE_DIRS ${CGNS_INCLUDE_DIRS} ) | ||
|
||
if ( WIN32 ) | ||
list ( APPEND PRJ_COMPILE_DEFINITIONS USE_DLL ) | ||
endif () | ||
|
||
list ( APPEND PRJ_COMPILE_DEFINITIONS HX_PARALLEL ) | ||
|
||
message( STATUS "PRJ_INCLUDE_DIRS = ${PRJ_INCLUDE_DIRS}") | ||
|
||
if ( MSVC ) | ||
set_property( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME} ) | ||
endif() | ||
|
||
add_executable( ${PROJECT_NAME} | ||
) | ||
|
||
set( PROJECT_SOURCES | ||
main.cpp | ||
global.h global.cpp | ||
CgnsGrid.h CgnsGrid.cpp | ||
Field.h Field.cpp | ||
LogFile.h LogFile.cpp | ||
Parallel.h Parallel.cpp | ||
Solver.h Solver.cpp | ||
ZoneState.h ZoneState.cpp | ||
) | ||
|
||
message( STATUS "PROJECT_NAME = ${PROJECT_NAME}") | ||
message( STATUS "PROJECT_SOURCES = ${PROJECT_SOURCES}") | ||
|
||
target_sources( ${PROJECT_NAME} | ||
PRIVATE | ||
${PROJECT_SOURCES} | ||
) | ||
|
||
target_include_directories ( ${PROJECT_NAME} | ||
PRIVATE | ||
${PRJ_INCLUDE_DIRS} | ||
) | ||
|
||
target_link_libraries( ${PROJECT_NAME} | ||
PRIVATE | ||
${PRJ_LIBRARIES} | ||
) | ||
|
||
target_compile_features ( ${PROJECT_NAME} | ||
PRIVATE | ||
${PRJ_COMPILE_FEATURES} | ||
) | ||
|
||
target_compile_definitions ( ${PROJECT_NAME} | ||
PRIVATE | ||
${PRJ_COMPILE_DEFINITIONS} | ||
) |
Oops, something went wrong.