forked from At0mn1yIvan/ppc-2023-mpi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Lab3): complete lab 3 global optimizathon
- Loading branch information
1 parent
65b1a24
commit 015a5a6
Showing
4 changed files
with
656 additions
and
0 deletions.
There are no files selected for viewing
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,36 @@ | ||
get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME) | ||
enable_testing() | ||
|
||
if( USE_MPI ) | ||
if( UNIX ) | ||
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized") | ||
endif( UNIX ) | ||
|
||
set(ProjectId "${ProjectId}_mpi") | ||
project( ${ProjectId} ) | ||
message( STATUS "-- " ${ProjectId} ) | ||
|
||
file(GLOB_RECURSE header_files "*.h") | ||
file(GLOB_RECURSE source_files "*.cpp") | ||
set(PACK_LIB "${ProjectId}_lib") | ||
add_library(${PACK_LIB} STATIC ${header_files} ${source_files}) | ||
|
||
add_executable( ${ProjectId} ${source_files} ) | ||
|
||
target_link_libraries(${ProjectId} ${PACK_LIB}) | ||
if( MPI_COMPILE_FLAGS ) | ||
set_target_properties( ${ProjectId} PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}" ) | ||
endif( MPI_COMPILE_FLAGS ) | ||
|
||
if( MPI_LINK_FLAGS ) | ||
set_target_properties( ${ProjectId} PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}" ) | ||
endif( MPI_LINK_FLAGS ) | ||
target_link_libraries( ${ProjectId} ${MPI_LIBRARIES} ) | ||
target_link_libraries(${ProjectId} gtest gtest_main) | ||
|
||
enable_testing() | ||
add_test(NAME ${ProjectId} COMMAND ${ProjectId}) | ||
else( USE_MPI ) | ||
message( STATUS "-- ${ProjectId} - NOT BUILD!" ) | ||
endif( USE_MPI ) |
Oops, something went wrong.