This is an old revision of the document!
SRS
1. Script CMake
- CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12) project(curso_terralib_srs) add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_VERSION=3 -DBOOST_UBLAS_TYPE_CHECK=0 -DBOOST_LOG_DYN_LINK) if(APPLE) add_definitions(-ftemplate-depth-1024) endif() if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER MATCHES ".*clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++11") endif() find_package(Boost 1.54.0 REQUIRED system chrono timer filesystem) find_package(terralib REQUIRED) include_directories(${Boost_INCLUDE_DIR} ${terralib_INCLUDE_DIRS} ${terralib_DIR}) file(GLOB CURSO_SRC_FILES *.cpp) add_executable(curso_terralib_srs ${CURSO_SRC_FILES}) target_link_libraries(curso_terralib_srs terralib_mod_srs ${BOOST_SYSTEM_LIBRARY})
2. Código do Exemplo:
- main.cpp
// TerraLib #include <terralib/common/TerraLib.h> #include <terralib/srs.h> // STL #include <iostream> #include <memory> int main(int argc, char* argv[]) { TerraLib::getInstance().initialize(); // Seu código vai aqui!! TerraLib::getInstance().finalize(); return EXIT_SUCCESS; }
3. Opções do CMake:
-DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_PREFIX_PATH:PATH="/home/terralib5/mylibs;/home/terralib5/mylibs/terralib5/lib/cmake"