Last active
August 29, 2015 14:16
-
-
Save phaustin/fd489d49798e5eb3c81c to your computer and use it in GitHub Desktop.
cmake snippets
This file contains hidden or 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
| # | |
| # two compiler specifications have to appear first | |
| # | |
| set(CMAKE_C_COMPILER /usr/local/bin/gcc-4.9) | |
| set(CMAKE_CXX_COMPILER /usr/local/bin/g++-4.9) | |
| cmake_minimum_required(VERSION 3.1) | |
| project(temp) | |
| set(CMAKE_Fortran_COMPILER gfortran) | |
| enable_language(Fortran) |
This file contains hidden or 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
| project(bright) | |
| cmake_minimum_required(VERSION 2.8) | |
| set(CMAKE_MODULE_PATH "/home/phil/cmake") | |
| set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/testlib) | |
| set(CMAKE_INSTALL_PREFIX /home/phil/lib/python) | |
| set(CMAKE_Fortran_COMPILER g95) | |
| enable_language(Fortran) | |
| set(CMAKE_Fortran_FLAGS "-fno-second-underscore") | |
| FILE(GLOB files_f90 "*.f90") | |
| LIST(REMOVE_ITEM files_f90 "${CMAKE_SOURCE_DIR}/sensor_planck_functions_test.f90") | |
| #message("here are the files 1: ${files_f90}") | |
| LIST(REMOVE_ITEM files_f90 "${CMAKE_SOURCE_DIR}/test.f90") | |
| #message("here are the files 2: ${files_f90}") | |
| include(UseCython) | |
| find_package(PythonLibs REQUIRED) | |
| find_package(NumPy REQUIRED) | |
| include_directories(${PYTHON_INCLUDE_PATH} ${NUMPY_INCLUDE_PATH}) | |
| cython_add_module(bright ${files_f90} plkavg.f r1mach.f xstopx.f ErrPack.f) | |
| install(TARGETS bright LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) | |
| add_custom_target(test COMMAND python ${CMAKE_SOURCE_DIR}/test_bright.py | |
| DEPENDS COMMENT "execute test_bright.py") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment