Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
insertion_sort/CMakeLists.txt
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
64 lines (50 sloc)
2.26 KB
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
# CMake project file for FOO | |
################################################## | |
# Define the project and the depencies that it has | |
################################################## | |
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5...3.20.1) | |
PROJECT(sort Fortran) | |
# Set the FOO version | |
SET(VERSION 0.1.0) | |
# Add our local modules to the module path | |
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/") | |
# Uncomment if it is required that Fortran 90 is supported | |
IF(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90) | |
MESSAGE(FATAL_ERROR "Fortran compiler does not support F90") | |
ENDIF(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90) | |
# This INCLUDE statement executes code that sets the compile flags for DEBUG, | |
# RELEASE, and TESTING. You should review this file and make sure the flags | |
# are to your liking. | |
INCLUDE(${CMAKE_MODULE_PATH}/SetFortranFlags.cmake) | |
# Locate and set parallelization libraries. There are some CMake peculiarities | |
# taken care of here, such as the fact that the FindOpenMP routine doesn't know | |
# about Fortran. | |
#INCLUDE(${CMAKE_MODULE_PATH}/SetParallelizationLibrary.cmake) | |
# Setup the LAPACK libraries. This also takes care of peculiarities, such as | |
# the fact the searching for MKL requires a C compiler, and that the results | |
# are not stored in the cache. | |
#INCLUDE(${CMAKE_MODULE_PATH}/SetUpLAPACK.cmake) | |
# There is an error in CMAKE with this flag for pgf90. Unset it | |
GET_FILENAME_COMPONENT(FCNAME ${CMAKE_Fortran_COMPILER} NAME) | |
IF(FCNAME STREQUAL "pgf90") | |
UNSET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS) | |
ENDIF(FCNAME STREQUAL "pgf90") | |
############################################################ | |
# Define the actual files and folders that make up the build | |
############################################################ | |
# Define the executable name | |
SET(SORTEXE sort) | |
# Define some directories | |
SET(SRC ${CMAKE_SOURCE_DIR}/src) | |
SET(LIB ${CMAKE_SOURCE_DIR}/lib) | |
SET(MOD ${CMAKE_SOURCE_DIR}/mod) | |
SET(BIN ${CMAKE_SOURCE_DIR}/bin) | |
SET(SRCSORT ${SRC}) | |
# Have the .mod files placed in the lib folder | |
SET(CMAKE_Fortran_MODULE_DIRECTORY ${MOD}) | |
# The source for the FOO binary and have it placed in the bin folder | |
ADD_SUBDIRECTORY(${SRCSORT} ${BIN}) | |
# Add a distclean target to the Makefile | |
ADD_CUSTOM_TARGET(distclean | |
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/distclean.cmake | |
) |