2014-05-14 12:17:36 -04:00
|
|
|
# cmake file examples
|
|
|
|
# https://code.google.com/p/opencv-feature-tracker/source/browse/CMakeLists.txt?r=f804b03e704147e65183c19a50f57abedb22f45c
|
|
|
|
|
|
|
|
|
|
|
|
# TODO:
|
|
|
|
# cmake clean... orz
|
|
|
|
# http://stackoverflow.com/questions/9680420/looking-for-a-cmake-clean-command-to-clear-up-cmake-output
|
|
|
|
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2014-05-14 12:41:08 -04:00
|
|
|
project(r3)
|
2014-05-14 12:17:36 -04:00
|
|
|
|
|
|
|
SET(CMAKE_MODULE_PATH
|
|
|
|
${PROJECT_SOURCE_DIR}/cmake_modules
|
|
|
|
${CMAKE_MODULE_PATH}
|
|
|
|
)
|
|
|
|
|
2014-05-14 12:47:52 -04:00
|
|
|
include_directories(. "${PROJECT_SOURCE_DIR}/include" ${INCLUDE_DIRECTORIES} /opt/local/include)
|
2014-05-14 12:17:36 -04:00
|
|
|
link_directories(${LINK_DIRECTORIES} /opt/local/lib)
|
|
|
|
find_package(PCRE REQUIRED)
|
2014-05-16 10:05:23 -04:00
|
|
|
# find_package(Judy REQUIRED)
|
2014-05-14 22:08:42 -04:00
|
|
|
find_package(Jemalloc REQUIRED)
|
2014-05-14 12:17:36 -04:00
|
|
|
|
2014-05-16 10:05:23 -04:00
|
|
|
set(LIBS ${LIBS} ${PCRE_LIBRARIES} ${Jemalloc_LIBRARIES} r3)
|
2014-05-14 12:17:36 -04:00
|
|
|
|
2014-05-16 10:41:19 -04:00
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -pipe -g3 -funroll-loops")
|
2014-05-14 12:17:36 -04:00
|
|
|
# set (CMAKE_CXX_FLAGS "-std=c++0x -arch x86_64 -stdlib=libc++ -g3 -Wall -O0")
|
|
|
|
enable_testing()
|
|
|
|
|
2014-05-14 12:47:52 -04:00
|
|
|
add_subdirectory(src)
|
2014-05-14 12:17:36 -04:00
|
|
|
add_subdirectory(tests)
|
|
|
|
|
2014-05-16 08:30:31 -04:00
|
|
|
install (FILES include/r3.h DESTINATION include)
|
|
|
|
install (FILES include/r3_define.h DESTINATION include)
|
|
|
|
install (FILES include/r3_str.h DESTINATION include)
|
|
|
|
|
2014-05-14 22:08:42 -04:00
|
|
|
add_test(test_r3 ${CMAKE_CURRENT_BINARY_DIR}/tests/test_r3)
|
2014-05-14 12:17:36 -04:00
|
|
|
|
2014-05-14 12:47:52 -04:00
|
|
|
add_executable(demo demo.c)
|