-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EXAMPLE: Provide example CMakeLists.txt for users of exodus library […
…ci skip]
- Loading branch information
1 parent
c15f996
commit dd43041
Showing
4 changed files
with
1,356 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
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,32 @@ | ||
# Almost all CMake files should start with this | ||
# You should always specify a range with the newest | ||
# and oldest tested versions of CMake. This will ensure | ||
# you pick up the best policies. | ||
cmake_minimum_required(VERSION 3.1...3.26) | ||
project(ExodusCMakeExample VERSION 1.0 LANGUAGES C Fortran) | ||
|
||
### | ||
### Generate Makefile with: | ||
# * mkdir build; cd build | ||
# * CMAKE_PREFIX_PATH={path_to_root_of_seacas_install} ccmake .. | ||
|
||
#### C #### | ||
find_package(SEACASExodus CONFIG) | ||
add_executable(ExodusWriteC ExodusWrite.c) | ||
target_link_libraries(ExodusWriteC PRIVATE SEACASExodus::all_libs) | ||
|
||
|
||
#### FORTRAN ##### | ||
IF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") | ||
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer -fdefault-real-8 -fdefault-integer-8 -fno-range-check") | ||
ELSEIF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "XL") | ||
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qintsize=8 -qrealsize=8") | ||
ELSEIF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Cray") | ||
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -sdefault64") | ||
ELSE() | ||
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i8") | ||
ENDIF() | ||
|
||
find_package(SEACASExodus_for CONFIG) | ||
add_executable(ExodusReadFor ExodusRead.f) | ||
target_link_libraries(ExodusReadFor PRIVATE SEACASExodus_for::all_libs) |
Oops, something went wrong.