[libsigcplusplus/cmake-integration] cmake: init - add cmake files



commit f5133ac6ce9266180889254d944a758a2321e984
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Sat Mar 12 11:10:31 2016 +0100

    cmake: init - add cmake files

 CMakeLists.txt          |   45 ++++++++++++++++++++++++++++++++
 examples/CMakeLists.txt |   24 +++++++++++++++++
 sigc++/CMakeLists.txt   |   42 ++++++++++++++++++++++++++++++
 sigc++config.h.cmake    |   66 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/CMakeLists.txt    |   29 ++++++++++++++++++++
 5 files changed, 206 insertions(+), 0 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..5158567
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Copyright 2016, The libsigc++ Development Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+cmake_minimum_required (VERSION 3.4)
+
+set (SIGCXX_MAJOR_VERSION 2)
+set (SIGCXX_MINOR_VERSION 99)
+set (SIGCXX_MICRO_VERSION 1)
+
+set (LIBSIGCPP_PROJECT_VERSION 3.0)
+set (LIBSIGCPP_VERSION ${SIGCXX_MAJOR_VERSION}.${SIGCXX_MINOR_VERSION}.${SIGCXX_MICRO_VERSION})
+set (LIBSIGCPP_SOVERSION 0)
+
+option (SIGCXX_DISABLE_DEPRECATED "Disable deprecated" OFF)
+
+project (libsigc++ ${LIBSIGC++_PROJECT_VERSION})
+
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
+
+set (PROJECT_SOURCE_DIR "${libsigc++_SOURCE_DIR}/sigc++")
+
+include_directories (${libsigc++_SOURCE_DIR})
+include_directories (${libsigc++_BINARY_DIR})
+
+configure_file (sigc++config.h.cmake sigc++config.h)
+
+enable_testing()
+
+add_subdirectory (sigc++)
+add_subdirectory (examples)
+add_subdirectory (tests)
+
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 0000000..8248198
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Copyright 2016, The libsigc++ Development Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+function (add_sigcpp_example EXAMPLE_SOURCE_FILE)
+       get_filename_component (example_name ${EXAMPLE_SOURCE_FILE} NAME_WE)
+       add_executable (${example_name} ${EXAMPLE_SOURCE_FILE})
+       target_link_libraries (${example_name} ${PROJECT_NAME}-${LIBSIGCPP_PROJECT_VERSION})
+endfunction (add_sigcpp_example)
+
+add_sigcpp_example (hello_world.cc)
+add_sigcpp_example (member_method.cc)
diff --git a/sigc++/CMakeLists.txt b/sigc++/CMakeLists.txt
new file mode 100644
index 0000000..9a720dd
--- /dev/null
+++ b/sigc++/CMakeLists.txt
@@ -0,0 +1,42 @@
+# Copyright 2016, The libsigc++ Development Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+set (SOURCE_FILES
+       connection.cc
+       signal_base.cc
+       signal.cc
+       trackable.cc
+       functors/slot_base.cc
+       functors/slot.cc
+)
+
+set (SIGCPP_LIB_NAME ${PROJECT_NAME}-${LIBSIGCPP_PROJECT_VERSION})
+
+add_library(${SIGCPP_LIB_NAME} SHARED ${SOURCE_FILES})
+
+set_property (TARGET ${SIGCPP_LIB_NAME} PROPERTY VERSION ${LIBSIGCPP_VERSION})
+set_property(TARGET ${SIGCPP_LIB_NAME}  PROPERTY SOVERSION ${LIBSIGCPP_SOVERSION})
+
+file (GLOB SIGCPP_HEADERS                      ${PROJECT_SOURCE_DIR}/*.h)
+file (GLOB SIGCPP_ADAPTOR_HEADERS      ${PROJECT_SOURCE_DIR}/adaptors/*.h)
+file (GLOB SIGCPP_FUNCTOR_HEADERS      ${PROJECT_SOURCE_DIR}/functors/*.h)
+
+set (SIGCPP_INCLUDE_DIR include/sigc++-${LIBSIGCPP_PROJECT_VERSION}/sigc++)
+
+install (TARGETS       ${SIGCPP_LIB_NAME}                      DESTINATION lib)
+install (FILES         ${SIGCPP_HEADERS}                       DESTINATION ${SIGCPP_INCLUDE_DIR})
+install (FILES         ${SIGCPP_ADAPTOR_HEADERS}       DESTINATION ${SIGCPP_INCLUDE_DIR}/adaptors)
+install (FILES         ${SIGCPP_FUNCTOR_HEADERS}       DESTINATION ${SIGCPP_INCLUDE_DIR}/functors)
diff --git a/sigc++config.h.cmake b/sigc++config.h.cmake
new file mode 100644
index 0000000..74d348a
--- /dev/null
+++ b/sigc++config.h.cmake
@@ -0,0 +1,66 @@
+
+/* Define to omit deprecated API from the library. */
+#cmakedefine SIGCXX_DISABLE_DEPRECATED
+
+/* Major version number of sigc++. */
+#cmakedefine SIGCXX_MAJOR_VERSION @SIGCXX_MAJOR_VERSION@
+
+/* Micro version number of sigc++. */
+#cmakedefine SIGCXX_MICRO_VERSION @SIGCXX_MICRO_VERSION@
+
+/* Minor version number of sigc++. */
+#cmakedefine SIGCXX_MINOR_VERSION @SIGCXX_MINOR_VERSION@
+
+/* Detect Win32 platform */
+#ifdef _WIN32
+# if defined(_MSC_VER)
+#  define SIGC_MSC 1
+#  define SIGC_WIN32 1
+#  define SIGC_DLL 1
+# elif defined(__CYGWIN__)
+#  define SIGC_CONFIGURE 1
+# elif defined(__MINGW32__)
+#  define SIGC_WIN32 1
+#  define SIGC_CONFIGURE 1
+# else
+#  error "libsigc++ config: Unknown win32 architecture (send me gcc --dumpspecs or equiv)"
+# endif
+#else /* !_WIN32 */
+# define SIGC_CONFIGURE 1
+#endif /* !_WIN32 */
+
+#ifdef SIGC_MSC
+/*
+ * MS VC7 Warning 4251 says that the classes to any member objects in an
+ * exported class must also be exported.  Some of the libsigc++
+ * template classes contain std::list members.  MS KB article 168958 says
+ * that it's not possible to export a std::list instantiation due to some
+ * wacky class nesting issues, so our only options are to ignore the
+ * warning or to modify libsigc++ to remove the std::list dependency.
+ * AFAICT, the std::list members are used internally by the library code
+ * and don't need to be used from the outside, and ignoring the warning
+ * seems to have no adverse effects, so that seems like a good enough
+ * solution for now.
+ */
+# pragma warning(disable:4251)
+
+#if (_MSC_VER < 1900) && !defined (noexcept)
+#define _ALLOW_KEYWORD_MACROS 1
+#define noexcept _NOEXCEPT
+#endif
+
+#else /* SIGC_MSC */
+
+#endif /* !SIGC_MSC */
+
+#ifdef SIGC_DLL
+# if defined(SIGC_BUILD) && defined(_WINDLL)
+#  define SIGC_API __declspec(dllexport)
+# elif !defined(SIGC_BUILD)
+#  define SIGC_API __declspec(dllimport)
+# else
+#  define SIGC_API
+# endif
+#else /* !SIGC_DLL */
+# define SIGC_API
+#endif /* !SIGC_DLL */
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..50341c4
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Copyright 2016, The libsigc++ Development Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+enable_testing ()
+
+function (add_sigcpp_test TEST_SOURCE_FILE)
+       get_filename_component (test_name ${TEST_SOURCE_FILE} NAME_WE)
+       add_executable (${test_name} ${TEST_SOURCE_FILE} testutilities.cc)
+       target_link_libraries (${test_name} ${PROJECT_NAME}-${LIBSIGCPP_PROJECT_VERSION})
+       add_test (${test_name} ${CMAKE_CURRENT_BINARY_DIR}/${test_name})
+endfunction (add_sigcpp_test)
+
+file(GLOB test_files "test_*.cc")
+foreach (test_file ${test_files})
+       add_sigcpp_test (${test_file})
+endforeach()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]