From 6d314014340b786534e5792763b1e3810e200464 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Fri, 29 Jan 2021 18:31:16 +0100 Subject: [PATCH] add link to tutorial and suggest find_simple_library() --- README.md | 2 +- cmake/FindLibExample.cmake | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9fba6e4..a393b4a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Here's how the files are used: ## The build system -Not a lot to discuss here, this is pretty standard. See the tutorial on Planète Casio (in French) (TODO: link once published) for an introduction to CMake in the context of add-ins. You might be interested in [`configure_file()`](https://cmake.org/cmake/help/latest/command/configure_file.html) and [`install()`](https://cmake.org/cmake/help/latest/command/install.html), which are rarely used in add-ins. +Not a lot to discuss here, this is pretty standard. See the [tutorial on Planète Casio](https://www.planet-casio.com/Fr/forums/topic16647-1-tutoriel-compiler-des-add-ins-avec-cmake-fxsdk.html) (in French) for an introduction to CMake in the context of add-ins. You might be interested in [`configure_file()`](https://cmake.org/cmake/help/latest/command/configure_file.html) and [`install()`](https://cmake.org/cmake/help/latest/command/install.html), which are rarely used in add-ins. The fxSDK provides two variables to help you install your files: diff --git a/cmake/FindLibExample.cmake b/cmake/FindLibExample.cmake index 565bf51..0f94b29 100644 --- a/cmake/FindLibExample.cmake +++ b/cmake/FindLibExample.cmake @@ -17,6 +17,13 @@ if(NOT "${EX_PATH}" STREQUAL "libexample.a") OUTPUT_VARIABLE EX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) endif() +# The commands above seem common for gint libraries, so the fxSDK provides a +# helper function to get that directly. We simply provide the archive name, +# header file name, macro name, and names for output variables. +# include(FindSimpleLibrary) +# find_simple_library(libexample.a include/example/config.h "EX_VERSION" +# PATH_VAR EX_PATH VERSION_VAR EX_VERSION) + # This CMake utility will handle the version comparisons and other checks. We # just specify: # -> Some variables that are defined only if the library is found (so if