view CMakeLists.txt @ 10:68f85ffc6029

Finished rbtree. Reworked the iterators in list. Minor tweaks to others.
author Eris Caffee <discordia@eldalin.com>
date Fri, 28 Sep 2012 18:24:53 -0500
parents 9f1e34c4a810
children d359966ed8de
line source
1 cmake_minimum_required (VERSION 2.6 FATAL_ERROR)
2 #set (CMAKE_VERBOSE_MAKEFILE ON)
4 project (data_structures)
6 ################################################################################
7 # Ensure that we are not building in our source directories.
9 set (Build_Dir_OK "TRUE")
10 string (REGEX MATCH "^${CMAKE_SOURCE_DIR}" In_Sub_Dir ${CMAKE_BINARY_DIR})
11 if (In_Sub_Dir)
12 string (REGEX MATCH "^${CMAKE_SOURCE_DIR}/build" In_Build_Dir ${CMAKE_BINARY_DIR})
13 if (NOT In_Build_Dir)
14 set (Build_Dir_OK "FALSE")
15 endif ()
16 endif ()
18 if (NOT Build_Dir_OK)
19 message (FATAL_ERROR "You must run cmake from a directory that is not in your source tree, or that is in a special subdirectory of the tree whose name begins with 'build'.")
20 endif ()
23 if (CMAKE_BUILD_TYPE STREQUAL "")
24 # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This messes up differentiation between debug and release builds.
25 set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
26 endif ()
29 if (CMAKE_COMPILER_IS_GNUCXX)
30 add_definitions(-pedantic -Wall -std=gnu99)
31 endif ()
34 ################################################################################
36 option(Option_Profile_Program "Build for gprof profiling." OFF)
37 if (Option_Profile_Program)
38 add_definitions(-pg)
39 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
40 endif ()
43 ################################################################################
45 set (stack_SRCS src/stack.h src/stack.c src/stack_test.c)
46 add_executable (stack_test
47 ${stack_SRCS}
48 )
50 set (ring_buffer_SRCS src/ring_buffer.h src/ring_buffer.c src/ring_buffer_test.c)
51 add_executable (ring_buffer_test
52 ${ring_buffer_SRCS}
53 )
55 set (queue_SRCS src/queue.h src/queue.c src/queue_test.c)
56 add_executable (queue_test
57 ${queue_SRCS}
58 )
60 set (dequeue_SRCS src/dequeue.h src/dequeue.c src/dequeue_test.c)
61 add_executable (dequeue_test
62 ${dequeue_SRCS}
63 )
65 set (pqueue_SRCS src/pqueue.h src/pqueue.c src/pqueue_test.c)
66 add_executable (pqueue_test
67 ${pqueue_SRCS}
68 )
70 set (list_SRCS src/list.h src/list.c src/list_test.c)
71 add_executable (list_test
72 ${list_SRCS}
73 )
75 set (bst_SRCS src/bst.h src/bst.c src/bst_test.c)
76 add_executable (bst_test
77 ${bst_SRCS}
78 )
80 set (rbtree_SRCS src/rbtree.h src/rbtree.c src/rbtree_test.c)
81 add_executable (rbtree_test
82 ${rbtree_SRCS}
83 )