From f441e197f3ba3120ed220f9d99d73759668cc74f Mon Sep 17 00:00:00 2001 From: drodri Date: Thu, 12 Feb 2015 13:56:43 +0100 Subject: [PATCH] added biicode support, tested VS12, mingw, ubuntu, mac --- CMakeLists.txt | 6 +++++- README.md | 7 +++++++ biicode.cmake | 26 ++++++++++++++++++++++++++ biicode.conf | 18 ++++++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 biicode.cmake create mode 100644 biicode.conf diff --git a/CMakeLists.txt b/CMakeLists.txt index 731f09f77..efa0eef41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -545,6 +545,11 @@ configure_file("${GLFW_SOURCE_DIR}/src/glfw3.pc.in" #-------------------------------------------------------------------- add_subdirectory(src) +IF(BIICODE) + INCLUDE(biicode.cmake) + return () +ENDIF() + if (GLFW_BUILD_EXAMPLES) add_subdirectory(examples) endif() @@ -583,4 +588,3 @@ if (GLFW_INSTALL) "${GLFW_BINARY_DIR}/cmake_uninstall.cmake") endif() endif() - diff --git a/README.md b/README.md index 91b3ae5ec..51d261907 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,13 @@ See the guide in the GLFW documentation. +### Using GLFW with biicode + +GLFW is available at [biicode](http://www.biicode.com) C/C++ dependency +manager, you can find the [block here](http://www.biicode.com/diego/glfw), and +[examples of use here](http://docs.biicode.com/c++/examples/glfw.html) + + ## Reporting bugs Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues). diff --git a/biicode.cmake b/biicode.cmake new file mode 100644 index 000000000..1c78705fd --- /dev/null +++ b/biicode.cmake @@ -0,0 +1,26 @@ +INIT_BIICODE_BLOCK() + +#Biicode defines its own targets. Include src CMakeLists to load variables +#with the adequate source files depending on the system + +FOREACH(var ${BII_LIB_SRC}) + STRING(REGEX MATCH "deps/.*\\.c" item ${var}) + IF(item) + LIST(APPEND glfw_deps_SOURCES ${var}) + ENDIF() +ENDFOREACH() +SET(BII_LIB_SRC) +SET(BII_LIB_DEPS glfw ${glfw_LIBRARIES}) + +if(glfw_deps_SOURCES) + SET(BII_BLOCK_TARGET "${BII_BLOCK_USER}_${BII_BLOCK_NAME}_interface") + ADD_LIBRARY(glfw_deps ${glfw_deps_SOURCES}) + target_include_directories(glfw_deps PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps) + SET(BII_LIB_DEPS ${BII_LIB_DEPS} glfw_deps) +endif() + +# This defines the library (static), tests and examples executables +ADD_BIICODE_TARGETS() + +# to make transitive the location of includes +target_include_directories(${BII_LIB_TARGET} INTERFACE ${GLFW_BINARY_DIR}/src) diff --git a/biicode.conf b/biicode.conf new file mode 100644 index 000000000..5a619055b --- /dev/null +++ b/biicode.conf @@ -0,0 +1,18 @@ +# Biicode configuration file +[requirements] + +[parent] + diego/glfw: 2 + +[paths] + # locations in which biicode should look for includes + deps + include + +[dependencies] + # The main headers depend on all sources, and the src/CMakeLists.txt + *glfw*.h + include/* src/* CMake/* *.in COPYING.txt + # This has to be made explicit to avoid detection of dependency to system getopt.h + deps/getopt.c + deps/getopt.h + tests/* + deps/getopt.h + examples/* + deps/getopt.h