pathanimator/c++/CMakeLists.txt

41 lines
1.4 KiB
CMake

cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_BUILD_TYPE None)
set(config release CACHE STRING "build mode <debug|native|generic>")
cmake_policy(SET CMP0017 NEW)
project(pathanimator)
enable_testing()
if (config STREQUAL "debug")
message("building debug version")
add_definitions(-Wall -Wextra -O0 -g)
set(CMAKE_EXE_LINKER_FLAGS "-O0 -g")
set(CMAKE_SHARED_LINKER_FLAGS "-O0 -g")
set(CMAKE_MODULE_LINKER_FLAGS "-O0 -g")
elseif (config STREQUAL "native")
message("building release version optimized for local CPU")
add_definitions(-Wall -Wextra -O3 -march=native -mtune=native)
set(CMAKE_EXE_LINKER_FLAGS "-O3 -march=native -mtune=native")
set(CMAKE_SHARED_LINKER_FLAGS "-O3 -march=native -mtune=native")
set(CMAKE_MODULE_LINKER_FLAGS "-O3 -march=native -mtune=native")
message("building generic release version")
add_definitions(-Wall -Wextra -O3)
set(CMAKE_EXE_LINKER_FLAGS "-O3 ")
set(CMAKE_SHARED_LINKER_FLAGS "-O3 ")
set(CMAKE_MODULE_LINKER_FLAGS "-O3 ")
endif()
add_definitions(-DPROJECT_ROOT="${PROJECT_SOURCE_DIR}")
add_definitions(-std=c++11)
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_C_STANDARD 11)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
find_package(OpenImageIO REQUIRED)
include_directories (
${CMAKE_SOURCE_DIR}/
)
add_subdirectory(algorithm)
add_executable(pathanimator init.cpp main.cpp image.cpp)
target_link_libraries(pathanimator algorithms OpenImageIO)