Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #########
- #
- # Readme
- #
- # This file creates several things...
- # - some external libraries
- # - the libct2d library
- # - the application program
- # ... and links them against each other
- ###############
- # Define the minimum Version of cmake, you can use
- cmake_minimum_required(VERSION 2.8)
- ###############
- # set some variables
- set(project_name example_ct_project)
- set(exe_name example_ct_application)
- ###############
- # change the project name
- project(${project_name})
- ###############
- # all include files which are needed
- include_directories(../../libct2d/include)
- include_directories(../../libct2d/external_libs/matIO)
- include_directories(../../libct2d/external_libs/KissFFT)
- ###############
- # this creates libct2d
- AUX_SOURCE_DIRECTORY(../../libct2d/src libct2d)
- AUX_SOURCE_DIRECTORY(../../libct2d/src/projectors libct2d_projectors)
- FILE(GLOB libct2d_include ../../libct2d/include/*.h)
- add_library(libct2d SHARED ${libct2d} ${libct2d_projectors} ${libct2d_include})
- ###############
- # this creates matio
- AUX_SOURCE_DIRECTORY(../../libct2d/external_libs/matIO lib_matio)
- add_library(matio SHARED ${lib_matio})
- ###############
- # this creates KissFFT
- AUX_SOURCE_DIRECTORY(../../libct2d/external_libs/KissFFT lib_kissfft)
- add_library(kissfft SHARED ${lib_kissfft})
- ###############
- # this creates the application exe
- FILE(GLOB application_cpp_files *.cpp)
- ADD_EXECUTABLE(${exe_name} ${application_cpp_files} )
- # for the exe two libraries must be linked against it
- target_link_libraries(${exe_name} libct2d)
- target_link_libraries(${exe_name} matio)
- target_link_libraries(${exe_name} kissfft)
- ##############################
- #options for swig and python
- #this pretty much sucks...dunno why it is not enabled by default
- SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
- #this is only for linux/gcc
- #different cases needed for windows/linux
- SET(CMAKE_CXX_FLAGS "-std=c++0x")
- FIND_PACKAGE(SWIG REQUIRED)
- INCLUDE(${SWIG_USE_FILE})
- #finding the PythonLibs is not working on my machine, probably some Path problems
- FIND_PACKAGE(PythonLibs)
- INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
- SET(CMAKE_SWIG_FLAGS "")
- SET_SOURCE_FILES_PROPERTIES(kissCT.i PROPERTIES CPLUSPLUS ON)
- SET_SOURCE_FILES_PROPERTIES(kissCT.i PROPERTIES SWIG_FLAGS "-includeall")
- SWIG_ADD_MODULE(kissCT python kissCT.i main.cpp)
- SWIG_LINK_LIBRARIES(kissCT ${PYTHON_LIBRARIES})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement