Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49512 - in trunk/tools/build/CMake: LinkTest sanity sanity/one_clean_one_warn sanity/one_clean_one_warn/src sanity/one_clean_one_warn/test sanity/wont_link sanity/wont_link/src sanity/wont_link/test
From: mike.jackson_at_[hidden]
Date: 2008-11-01 09:27:36


Author: imikejackson
Date: 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
New Revision: 49512
URL: http://svn.boost.org/trac/boost/changeset/49512

Log:
Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor
Added:
   trunk/tools/build/CMake/LinkTest/
   trunk/tools/build/CMake/LinkTest/CMakeLists.txt (contents, props changed)
   trunk/tools/build/CMake/sanity/
   trunk/tools/build/CMake/sanity/CMakeLists.txt (contents, props changed)
   trunk/tools/build/CMake/sanity/one_clean_one_warn/
   trunk/tools/build/CMake/sanity/one_clean_one_warn/CMakeLists.txt (contents, props changed)
   trunk/tools/build/CMake/sanity/one_clean_one_warn/src/
   trunk/tools/build/CMake/sanity/one_clean_one_warn/src/CMakeLists.txt (contents, props changed)
   trunk/tools/build/CMake/sanity/one_clean_one_warn/src/green.cpp (contents, props changed)
   trunk/tools/build/CMake/sanity/one_clean_one_warn/src/warn.cpp (contents, props changed)
   trunk/tools/build/CMake/sanity/one_clean_one_warn/test/
   trunk/tools/build/CMake/sanity/one_clean_one_warn/test/CMakeLists.txt (contents, props changed)
   trunk/tools/build/CMake/sanity/one_clean_one_warn/test/times_out.cpp (contents, props changed)
   trunk/tools/build/CMake/sanity/wont_link/
   trunk/tools/build/CMake/sanity/wont_link/CMakeLists.txt (contents, props changed)
   trunk/tools/build/CMake/sanity/wont_link/src/
   trunk/tools/build/CMake/sanity/wont_link/src/CMakeLists.txt (contents, props changed)
   trunk/tools/build/CMake/sanity/wont_link/src/compiles_nowarn.cpp (contents, props changed)
   trunk/tools/build/CMake/sanity/wont_link/test/
   trunk/tools/build/CMake/sanity/wont_link/test/CMakeLists.txt (contents, props changed)
   trunk/tools/build/CMake/sanity/wont_link/test/link_error.cpp (contents, props changed)

Added: trunk/tools/build/CMake/LinkTest/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/LinkTest/CMakeLists.txt 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
+
+project(LinkTest)
+include_directories (${INCLUDES})
+add_executable(link ${SOURCE} COMPILE_FLAGS "${COMPILE_FLAGS}")

Added: trunk/tools/build/CMake/sanity/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/CMakeLists.txt 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,39 @@
+# Find each subdirectory containing a CMakeLists.txt file, and include
+# it. This avoids the need to manually list which libraries in Boost
+# have CMakeLists.txt files.
+
+# return a list of directories that we should add_subdirectory()
+macro(BOOST_COLLECT_SUBPROJECT_DIRECTORY_NAMES varname filename)
+ file(GLOB BOOST_LIBRARY_CMAKE_FILES
+ RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*/${filename}")
+ foreach(BOOST_LIB_CMAKE_FILE ${BOOST_LIBRARY_CMAKE_FILES})
+ get_filename_component(BOOST_LIB_DIR ${BOOST_LIB_CMAKE_FILE} PATH)
+ set(${varname} ${${varname}} ${BOOST_LIB_DIR})
+ endforeach(BOOST_LIB_CMAKE_FILE ${BOOST_LIBRARY_CMAKE_FILES})
+endmacro(BOOST_COLLECT_SUBPROJECT_DIRECTORY_NAMES varname)
+
+macro(ADD_SUBDIRECTORIES prefix)
+ foreach(subdir ${ARGN})
+ MESSAGE(STATUS "${prefix}${subdir}")
+ add_subdirectory(${subdir})
+ endforeach(subdir ${ARGN})
+endmacro(ADD_SUBDIRECTORIES prefix)
+
+# Find all of the subdirectories with .cmake files in them. These are
+# the libraries with dependencies.
+boost_collect_subproject_directory_names(BOOST_MODULE_DIRS "module.cmake")
+
+foreach(subdir ${BOOST_MODULE_DIRS})
+ include("${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/module.cmake")
+endforeach(subdir)
+
+# Find all of the subdirectories with CMakeLists.txt files in
+# them. This contains all of the Boost libraries.
+boost_collect_subproject_directory_names(BOOST_SUBPROJECT_DIRS "CMakeLists.txt")
+
+# Add all of the Boost projects in reverse topological order, so that
+# a library's dependencies show up before the library itself.
+set(CPACK_INSTALL_CMAKE_COMPONENTS_ALL)
+list(SORT BOOST_SUBPROJECT_DIRS)
+topological_sort(BOOST_SUBPROJECT_DIRS BOOST_ _DEPENDS)
+add_subdirectories(" + " ${BOOST_SUBPROJECT_DIRS})

Added: trunk/tools/build/CMake/sanity/one_clean_one_warn/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/one_clean_one_warn/CMakeLists.txt 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,7 @@
+boost_library_project(
+ one_clean_one_warn
+ SRCDIRS src
+ TESTDIRS test
+)
+
+

Added: trunk/tools/build/CMake/sanity/one_clean_one_warn/src/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/one_clean_one_warn/src/CMakeLists.txt 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,5 @@
+boost_add_library(
+ one_clean_one_warn
+ green.cpp warn.cpp
+ )
+

Added: trunk/tools/build/CMake/sanity/one_clean_one_warn/src/green.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/one_clean_one_warn/src/green.cpp 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,2 @@
+static void foo() { }
+

Added: trunk/tools/build/CMake/sanity/one_clean_one_warn/src/warn.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/one_clean_one_warn/src/warn.cpp 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,4 @@
+#warning this one has a warning
+
+static void bar() { }
+

Added: trunk/tools/build/CMake/sanity/one_clean_one_warn/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/one_clean_one_warn/test/CMakeLists.txt 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,4 @@
+boost_test_run(times_out)
+boost_test_compile(this_passes times_out.cpp)
+boost_test_compile_fail(this_unexpectedly_passes times_out.cpp)
+

Added: trunk/tools/build/CMake/sanity/one_clean_one_warn/test/times_out.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/one_clean_one_warn/test/times_out.cpp 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,4 @@
+int main(int, char**)
+{
+ while(true) ;
+}

Added: trunk/tools/build/CMake/sanity/wont_link/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/wont_link/CMakeLists.txt 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,7 @@
+boost_library_project(
+ WontLinkProject
+ SRCDIRS src
+ TESTDIRS test
+)
+
+

Added: trunk/tools/build/CMake/sanity/wont_link/src/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/wont_link/src/CMakeLists.txt 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,5 @@
+boost_add_library(
+ wont_link
+ compiles_nowarn.cpp
+ )
+

Added: trunk/tools/build/CMake/sanity/wont_link/src/compiles_nowarn.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/wont_link/src/compiles_nowarn.cpp 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,8 @@
+int this_function_is_declared_but_not_defined();
+
+void provoke_link_error()
+{
+ this_function_is_declared_but_not_defined();
+}
+
+

Added: trunk/tools/build/CMake/sanity/wont_link/test/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/wont_link/test/CMakeLists.txt 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,2 @@
+boost_test_run(link_error DEPENDS wont_link)
+

Added: trunk/tools/build/CMake/sanity/wont_link/test/link_error.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/build/CMake/sanity/wont_link/test/link_error.cpp 2008-11-01 09:27:35 EDT (Sat, 01 Nov 2008)
@@ -0,0 +1,9 @@
+#include <iostream>
+
+void provoke_link_error();
+
+int main(int, char**)
+{
+ provoke_link_error();
+ return 0;
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk