52 lines
1.3 KiB
CMake
52 lines
1.3 KiB
CMake
cmake_minimum_required (VERSION 3.8.0)
|
|
project(FMRI CXX)
|
|
|
|
# Allow us to define custom modules
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
|
|
|
|
# Enable modern C++ features
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
# Define executable and dependencies
|
|
file(GLOB fmri_SRC
|
|
"src/*.cpp"
|
|
"src/*.hpp"
|
|
)
|
|
|
|
add_executable(fmri ${fmri_SRC})
|
|
|
|
# Enable better warnings
|
|
target_compile_options(fmri PRIVATE "-Wall" "-Wextra" "-pedantic")
|
|
|
|
# Find dependencies
|
|
find_package(Caffe REQUIRED)
|
|
find_package(OpenGL REQUIRED)
|
|
find_package(GLUT REQUIRED)
|
|
find_package(png++ REQUIRED)
|
|
|
|
target_link_libraries(fmri PUBLIC
|
|
Caffe::Caffe
|
|
GLUT::GLUT
|
|
OpenGL::GLU
|
|
png++::png++
|
|
)
|
|
|
|
target_include_directories(fmri PUBLIC
|
|
${Caffe_INCLUDE_DIRS}
|
|
${OpenCV_INCLUDE_DIRS})
|
|
|
|
# Allow the package to be installed
|
|
install(TARGETS fmri DESTINATION bin)
|
|
|
|
# Build instructions for the deinplace tool
|
|
find_package(Protobuf REQUIRED)
|
|
protobuf_generate_cpp(CAFFE_PROTO_CPP CAFFE_PROTO_HEADERS "src/proto/caffe.proto")
|
|
add_executable(deinplace
|
|
"src/tools/deinplace.cpp"
|
|
${CAFFE_PROTO_CPP}
|
|
${CAFFE_PROTO_HEADERS}
|
|
)
|
|
target_compile_options(deinplace PRIVATE "-Wall" "-Wextra" "-pedantic")
|
|
target_link_libraries(deinplace protobuf::libprotobuf)
|
|
target_include_directories(deinplace PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|