# CMakeLists.txt ---
# Copyright © 2011 Jordi Gutiérrez Hermoso
# Author: Jordi Gutiérrez Hermoso
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
set(project-name "autogad")
project(${project-name})
cmake_minimum_required(VERSION 2.6)
find_program(MKOCTFILE_EXECUTABLE mkoctfile)
if(NOT MKOCTFILE_EXECUTABLE)
message(SEND_ERROR "Failed to find mkoctfile, is it in your $PATH?")
endif()
## Compile the mexfiles
add_subdirectory("graphCUTS/GCmex1point4/")
## Compile the octfile
set(OCT_CXXFLAGS
"-O2 -Wall -Wextra -std=c++0x")
set(ENV{CXXFLAGS} ${OCT_CXXFLAGS})
set(OCT_FILE
"bwlabeln.oct")
set(OCT_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/bwlabeln.cc")
add_custom_command(OUTPUT ${OCT_FILE}
COMMAND ${MKOCTFILE_EXECUTABLE} "${OCT_SRC}"
DEPENDS "bwlabeln.cc"
COMMENT "Generating ${OCT_FILE}"
VERBATIM)
add_custom_target(bwlabeln ALL
DEPENDS ${OCT_FILE})
## Install stuff
file(GLOB m-files "*.m")
set(data_dir "share/${project-name}")
install(FILES
${m-files}
DESTINATION ${data_dir})
install(PROGRAMS
"main.m"
DESTINATION ${data_dir})
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${OCT_FILE}
DESTINATION ${data_dir})
set(NAZ_DATA_DIR ${CMAKE_INSTALL_PREFIX}/${data_dir})
configure_file(run.py.in run.py)
install(PROGRAMS
"${CMAKE_BINARY_DIR}/run.py"
DESTINATION bin/
RENAME "${project-name}")
install(DIRECTORY
"niak"
"SB2_Release_200"
"data"
"Transformations"
"Save_Data_with9_goodOne_Journal"
DESTINATION share/${project-name}
PATTERN ".hg" EXCLUDE)