diff options
author | Josh Blum <josh@joshknows.com> | 2010-02-15 16:53:03 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-02-15 16:53:03 -0800 |
commit | b2dc873c221fb48ee67dcfb3262fdf55a8725ed1 (patch) | |
tree | 5d9026f43520f2126656e4024a7f632e748b98ce | |
parent | 8d76c9a40859182d601d6f58064ddb7181fb6ce6 (diff) | |
download | uhd-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.
-rw-r--r-- | CMakeLists.txt | 39 | ||||
-rw-r--r-- | apps/CMakeLists.txt | 2 | ||||
-rw-r--r-- | include/CMakeLists.txt | 24 | ||||
-rw-r--r-- | include/uhd/CMakeLists.txt | 33 | ||||
-rw-r--r-- | include/uhd/transport/CMakeLists.txt | 22 | ||||
-rw-r--r-- | include/uhd/usrp/CMakeLists.txt | 25 | ||||
-rw-r--r-- | include/uhd/usrp/dboard/CMakeLists.txt | 25 | ||||
-rw-r--r-- | include/uhd/usrp/mboard/CMakeLists.txt | 24 | ||||
-rw-r--r-- | lib/CMakeLists.txt | 2 | ||||
-rw-r--r-- | uhd.pc.in | 14 |
10 files changed, 201 insertions, 9 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) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index b2943f9f3..f4428f958 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -18,3 +18,5 @@ ADD_EXECUTABLE(discover_usrps discover_usrps.cpp) TARGET_LINK_LIBRARIES(discover_usrps uhd) + +INSTALL(TARGETS discover_usrps RUNTIME DESTINATION ${RUNTIME_DIR}) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 000000000..34b705cab --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# Copyright 2010 Ettus Research LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + + +ADD_SUBDIRECTORY(uhd) + +INSTALL(FILES + uhd.hpp + DESTINATION ${HEADER_DIR} +) diff --git a/include/uhd/CMakeLists.txt b/include/uhd/CMakeLists.txt new file mode 100644 index 000000000..006c54f22 --- /dev/null +++ b/include/uhd/CMakeLists.txt @@ -0,0 +1,33 @@ +# +# Copyright 2010 Ettus Research LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + + +ADD_SUBDIRECTORY(transport) +ADD_SUBDIRECTORY(usrp) + +INSTALL(FILES + device.hpp + device_addr.hpp + dict.hpp + gain_handler.hpp + props.hpp + shared_iovec.hpp + time_spec.hpp + utils.hpp + wax.hpp + DESTINATION ${HEADER_DIR}/uhd +) diff --git a/include/uhd/transport/CMakeLists.txt b/include/uhd/transport/CMakeLists.txt new file mode 100644 index 000000000..b786eb945 --- /dev/null +++ b/include/uhd/transport/CMakeLists.txt @@ -0,0 +1,22 @@ +# +# Copyright 2010 Ettus Research LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + + +INSTALL(FILES + udp.hpp + DESTINATION ${HEADER_DIR}/uhd/transport +) diff --git a/include/uhd/usrp/CMakeLists.txt b/include/uhd/usrp/CMakeLists.txt new file mode 100644 index 000000000..d3040c3cc --- /dev/null +++ b/include/uhd/usrp/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# Copyright 2010 Ettus Research LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + + +ADD_SUBDIRECTORY(dboard) +ADD_SUBDIRECTORY(mboard) + +INSTALL(FILES + usrp.hpp + DESTINATION ${HEADER_DIR}/uhd/usrp +) diff --git a/include/uhd/usrp/dboard/CMakeLists.txt b/include/uhd/usrp/dboard/CMakeLists.txt new file mode 100644 index 000000000..e1ecc3b70 --- /dev/null +++ b/include/uhd/usrp/dboard/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# Copyright 2010 Ettus Research LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + + +INSTALL(FILES + base.hpp + id.hpp + interface.hpp + manager.hpp + DESTINATION ${HEADER_DIR}/uhd/usrp/dboard +) diff --git a/include/uhd/usrp/mboard/CMakeLists.txt b/include/uhd/usrp/mboard/CMakeLists.txt new file mode 100644 index 000000000..79aab8677 --- /dev/null +++ b/include/uhd/usrp/mboard/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# Copyright 2010 Ettus Research LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + + +INSTALL(FILES + base.hpp + test.hpp + usrp2.hpp + DESTINATION ${HEADER_DIR}/uhd/usrp/mboard +) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 46e487f7f..6150fd574 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -31,3 +31,5 @@ ADD_LIBRARY(uhd SHARED TARGET_LINK_LIBRARIES(uhd uhd_usrp) TARGET_LINK_LIBRARIES(uhd uhd_transport) TARGET_LINK_LIBRARIES(uhd ${Boost_LIBRARIES}) + +INSTALL(TARGETS uhd LIBRARY DESTINATION ${LIBRARY_DIR}) @@ -1,11 +1,11 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_PREFIX@/@LIBRARY_DIR@ +includedir=@CMAKE_INSTALL_PREFIX@/@HEADER_DIR@ -Name: uhd +Name: @CPACK_PACKAGE_NAME@ Description: Universal Hardware Driver -Requires: -Version: @VERSION@ +Requires: +Version: @CPACK_PACKAGE_VERSION@ Libs: -L${libdir} -luhd Cflags: -I${includedir} |