-
Notifications
You must be signed in to change notification settings - Fork 57
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
24,620 changed files
with
877,618 additions
and
48 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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,105 @@ | ||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) | ||
# Maps to Visual Studio solution file (Tutorial.sln) | ||
# The solution will have all targets (exe, lib, dll) | ||
# as Visual Studio projects (.vcproj) | ||
|
||
project(MOHIDNumerics) | ||
enable_language(Fortran) | ||
|
||
# if build type not specified, default to release | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "release") | ||
endif() | ||
|
||
# Turn on the ability to create folders to organize projects (.vcproj) | ||
# It creates "CMakePredefinedTargets" folder by default and adds CMake | ||
# defined projects like INSTALL.vcproj and ZERO_CHECK.vcproj | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
|
||
message("Project name " ${CMAKE_PROJECT_NAME}) | ||
|
||
#SET(CMAKE_VERBOSE_MAKEFILE TRUE) | ||
|
||
################################################################# | ||
# BUILD PATHS | ||
################################################################# | ||
|
||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) | ||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) | ||
SET(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/modules) | ||
INCLUDE_DIRECTORIES(${CMAKE_Fortran_MODULE_DIRECTORY}) | ||
|
||
message(STATUS "Building paths") | ||
message(STATUS "Executable output path " ${EXECUTABLE_OUTPUT_PATH}) | ||
message(STATUS "Library output path " ${LIBRARY_OUTPUT_PATH}) | ||
message(STATUS "Modules output path " ${CMAKE_Fortran_MODULE_DIRECTORY}) | ||
|
||
################################################################# | ||
# CONFIGURATION TYPES & BUILD MODE & BUILD_TESTS | ||
################################################################# | ||
|
||
SET(CMAKE_CONFIGURATION_TYPES RELEASE) | ||
IF(NOT CMAKE_BUILD_TYPE) | ||
SET(CMAKE_BUILD_TYPE RELEASE CACHE STRING | ||
"Choose the type of build, options are: NONE RELEASE" | ||
FORCE) | ||
|
||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS NONE RELEASE) | ||
ENDIF(NOT CMAKE_BUILD_TYPE) | ||
|
||
################################################################# | ||
# FFLAGS depend on the compiler and the build type | ||
################################################################# | ||
|
||
GET_FILENAME_COMPONENT(Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME) | ||
|
||
ADD_DEFINITIONS(-D${CMAKE_Fortran_COMPILER_ID}) | ||
|
||
message(STATUS "COMPILER INFO: ${CMAKE_Fortran_COMPILER_ID} - ${Fortran_COMPILER_NAME}") | ||
|
||
IF (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" OR Fortran_COMPILER_NAME MATCHES "gfortran*") | ||
# gfortran | ||
set(FORTRAN_FLAGS "-fdefault-real-8 -ffree-line-length-0 -cpp -Wimplicit-interface ${EXTRA_FLAGS} ") | ||
set (CMAKE_Fortran_FLAGS "${FORTRAN_FLAGS} ${MACROS} ${INCLUDES} " CACHE STRING "" FORCE) | ||
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 ${EXTRA_FLAGS} " CACHE STRING "" FORCE) | ||
set (CMAKE_Fortran_FLAGS_DEBUG "-g -fbacktrace -fbounds-check -fprofile-arcs -ftest-coverage -Wimplicit-interface ${EXTRA_FLAGS} " CACHE STRING "" FORCE) | ||
ELSEIF (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR Fortran_COMPILER_NAME MATCHES "ifort*") | ||
# ifort | ||
set(FORTRAN_FLAGS " -fpp ${EXTRA_FLAGS} ") | ||
set (CMAKE_Fortran_FLAGS "${FORTRAN_FLAGS} ${MACROS} ${INCLUDES}" CACHE STRING "" FORCE) | ||
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 ${EXTRA_FLAGS} " CACHE STRING "" FORCE) | ||
set (CMAKE_Fortran_FLAGS_DEBUG "-traceback -debug all -check all -ftrapuv -warn nointerfaces ${EXTRA_FLAGS} " CACHE STRING "" FORCE) | ||
# A partir de CMake 3.1 | ||
# -prof-gen:srcpos -prof-dir${PROJECT_BINARY_DIR} | ||
|
||
ELSEIF (${CMAKE_Fortran_COMPILER_ID} STREQUAL "XL" OR Fortran_COMPILER_NAME MATCHES "xlf*") | ||
# xlf (untested) | ||
set(FORTRAN_FLAGS "-q64 -qrealsize=8 -qsuffix=f=f90:cpp=f90 ${EXTRA_FLAGS} ") | ||
set (CMAKE_Fortran_FLAGS "${FORTRAN_FLAGS} ${MACROS} ${INCLUDES}" CACHE STRING "" FORCE) | ||
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -qstrict ${EXTRA_FLAGS} " CACHE STRING "" FORCE) | ||
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -qfullpath -qkeepparm ${EXTRA_FLAGS} " CACHE STRING "" FORCE) | ||
ELSE () | ||
message ("No optimized Fortran compiler flags are known, we just try -O2...") | ||
set (CMAKE_Fortran_FLAGS_RELEASE "-O2") | ||
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g") | ||
ENDIF () | ||
|
||
#SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--allow-multiple-definition") | ||
#SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-multiple-definition") | ||
|
||
message (STATUS "CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER}) | ||
message (STATUS "CMAKE_Fortran_FLAGS: " ${CMAKE_Fortran_FLAGS}) | ||
message (STATUS "CMAKE_Fortran_FLAGS_RELEASE: " ${CMAKE_Fortran_FLAGS_RELEASE}) | ||
|
||
################################################################# | ||
# ADD SOURCE SUBDIRS | ||
################################################################# | ||
|
||
SET(LIBRARY_SOURCE_PATH ${CMAKE_SOURCE_DIR}/src/lib) | ||
SET(APP_SOURCE_PATH ${CMAKE_SOURCE_DIR}/src/app) | ||
|
||
message(STATUS "Library source path " ${LIBRARY_SOURCE_PATH}) | ||
message(STATUS "Application source path " ${APP_SOURCE_PATH}) | ||
|
||
ADD_SUBDIRECTORY(${LIBRARY_SOURCE_PATH}) | ||
ADD_SUBDIRECTORY(${APP_SOURCE_PATH}) |
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
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
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
Oops, something went wrong.