summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-02-15 16:53:03 -0800
committerJosh Blum <josh@joshknows.com>2010-02-15 16:53:03 -0800
commitb2dc873c221fb48ee67dcfb3262fdf55a8725ed1 (patch)
tree5d9026f43520f2126656e4024a7f632e748b98ce /CMakeLists.txt
parent8d76c9a40859182d601d6f58064ddb7181fb6ce6 (diff)
downloaduhd-b2dc873c221fb48ee67dcfb3262fdf55a8725ed1.tar.gz
uhd-b2dc873c221fb48ee67dcfb3262fdf55a8725ed1.tar.bz2
uhd-b2dc873c221fb48ee67dcfb3262fdf55a8725ed1.zip
Added CMakeLists.txt for the include dir.
Setting up the pkg config file through cmake. Added stuff to cmake to add optional flags.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt39
1 files changed, 37 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f16eccbd..4fc1e29f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,11 +19,36 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(UHD)
ENABLE_TESTING()
INCLUDE(CPack)
+#SET(CMAKE_VERBOSE_MAKEFILE true)
+
+########################################################################
+# Install Dirs
+########################################################################
+SET(RUNTIME_DIR bin)
+SET(LIBRARY_DIR lib)
+SET(RESOURCE_DIR share)
+SET(HEADER_DIR include)
########################################################################
# Local Include Dir
########################################################################
-INCLUDE_DIRECTORIES(${UHD_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+########################################################################
+# Optional Compiler Flags
+########################################################################
+INCLUDE(CheckCXXCompilerFlag)
+FUNCTION(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG flag have)
+ CHECK_CXX_COMPILER_FLAG(${flag} ${have})
+ IF(${have})
+ ADD_DEFINITIONS(${flag})
+ ENDIF(${have})
+ENDFUNCTION(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG)
+
+UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-Wall HAVE_WALL)
+UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-Wextra HAVE_WEXTRA)
+UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-pedantic HAVE_PEDANTIC)
+UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-ansi HAVE_ANSI)
########################################################################
# Setup Boost
@@ -40,8 +65,18 @@ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
########################################################################
+# Create Pkg Config File
+########################################################################
+CONFIGURE_FILE(uhd.pc.in uhd.pc @ONLY)
+INSTALL(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc
+ DESTINATION ${LIBRARY_DIR}/pkgconfig
+)
+
+########################################################################
# Add the subdirectories
########################################################################
+ADD_SUBDIRECTORY(apps)
+ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(test)
-ADD_SUBDIRECTORY(apps)