From ec2cb231a48ecbc97a6bf5bbd7abcab2b23848e5 Mon Sep 17 00:00:00 2001 From: Gyusun Yeom Date: Sun, 14 Nov 2021 17:09:12 +0900 Subject: [PATCH] Add glew-cmake README --- README.md | 29 +++++++++++++++++++++++++++++ glew-cmake/maintain.sh | 7 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..838fd6f --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# GLEW-cmake - nightly pre-generated snapshot with old unofficial cmake support + +[GLEW](https://github.com/nigels-com/glew) is upstream of this project. +But *GLEW* repository does not contain generated sources. Only releases include generated sources. + +*GLEW-cmake* has generated sources based on the latest *GLEW*. Sources are generated nightly. +If you need only the latest snapshot of *GLEW*, try the build system of *GLEW*. It is placed under the `build` directory. Official `CMakeLists.txt` is placed in `build/cmake`. +Please check [README_glew.md](./README_glew.md) for using build system of *GLEW*. + +Also, *GLEW-cmake* has unofficial cmake support - It is created when the official CMake support of *GLEW* does not exist. +You can see some CMake script examples in [`glew-cmake`](./glew-cmake/) directory. But, I **strongly** recommend using official CMakeLists of *GLEW*. + +## Usage + +This project provide `libglew_static` and `libglew_shared` library targets and `glewinfo` and `visualinfo` executable targets. + +`libglew_static` provides a static library, and `libglew_shared` provides a shared library. +*glew-cmake* does not affected by [BUILD_SHARED_LIBS](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html). + +You can disable each library target by setting `glew-cmake_BUILD_SHARED` or `glew-cmake_BUILD_STATIC` falsy value (ex. `NO`, `FALSE`). + +If you need only libraries, Please set `ONLY_LIBS` to `ON`. Otherwise, cmake generates executable targets also. + +You can get pkg-config fils by setting `PKG_CONFIG_REPRESENTATIVE_TARGET` to `libglew_static` or `libglew_shared`. + +Simply specify dependency of your target with `libglew_static` or `libglew_shared` by `target_link_libraries`. +It will set the additional include directory & the libraries to link to your target. + +If you are not familiar with cmake, Some `sub-directory-test.cmake`, `fetch-content.cmake` in [`glew-cmake`](./glew-cmake/) could be helpful. diff --git a/glew-cmake/maintain.sh b/glew-cmake/maintain.sh index eb59b6d..020f44a 100755 --- a/glew-cmake/maintain.sh +++ b/glew-cmake/maintain.sh @@ -65,6 +65,10 @@ source_update () { AFTER_COMMIT=`git rev-parse HEAD` if [ "$BEFORE_COMMIT" != "$AFTER_COMMIT" ]; then echo "Source Updated" + git checkout original_repo/${GIT_BRANCH_NAME} -- README.md + git mv -f README.md README_glew.md + git checkout $BEFORE_COMMIT -- README.md + git add -f README.md README_glew.md git commit --amend -m "Merge ${ORIGINAL_REPO_URL} into ${GIT_BRANCH_NAME} HEAD at $(TZ=GMT date)" git push ${PUSH_ARG} origin $GIT_BRANCH_NAME:$GIT_BRANCH_NAME PUSH_COUNT=$((PUSH_COUNT + 1)) @@ -118,7 +122,8 @@ import_tags () { do echo "Import $TAG" git checkout $TAG -- . - git checkout master -- CMakeLists.txt GeneratePkgConfig.cmake + git mv -f README.md README_glew.md + git checkout master -- CMakeLists.txt GeneratePkgConfig.cmake README.md cd "$WORKSPACE/auto" COMMIT_TIME=`git log -1 $TAG --format=%ct` echo "Patch perl scripts for new version"