From f74a3132ce00ba75739e80c5ad5e286752f0fa7e Mon Sep 17 00:00:00 2001 From: jothepro Date: Thu, 24 Mar 2022 22:43:38 +0100 Subject: [PATCH] simplify finding the djinni binary on Windows; minor Readme change; --- Djinni.cmake | 18 +++--------------- README.md | 4 ++-- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Djinni.cmake b/Djinni.cmake index 32d5e9d..ec5e6dd 100644 --- a/Djinni.cmake +++ b/Djinni.cmake @@ -3,7 +3,7 @@ # Djinni CMake # https://github.com/jothepro/djinni-cmake # -# Copyright (c) 2021 jothepro +# Copyright (c) 2021 - 2022 jothepro # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -93,20 +93,8 @@ function(add_djinni_library LIBRARY_TARGET) set_directory_properties(PROPERTIES CMAKE_CONFIGURE_DEPENDS ${DJINNI_IDL}) # find Djinni executable. - # On Windows `find_program()` does not work for finding the `djinni.bat` script. - # The script must either be - # - on the PATH - # - explicitly predefined in cache variable `DJINNI_EXECUTABLE` - # - installed from conan if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - # If the the generator is installed from conan, use find_package to get the installation path - find_package(djinni-generator QUIET) - if(djinni-generator_FOUND) - find_file(DJINNI_EXECUTABLE bin/djinni.bat REQUIRED) - else() - # Otherwise just set the executable and hope that the binary is on the path - set(DJINNI_EXECUTABLE djinni.bat CACHE FILEPATH "path of djinni binary") - endif() + find_program(DJINNI_EXECUTABLE djinni.bat REQUIRED) else() find_program(DJINNI_EXECUTABLE djinni REQUIRED) endif() @@ -242,4 +230,4 @@ function(add_djinni_library LIBRARY_TARGET) PUBLIC_HEADER DESTINATION include ) endif() -endfunction() \ No newline at end of file +endfunction() diff --git a/README.md b/README.md index 28d9299..795e796 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Simple CMake wrapper for [Djinni](https://djinni.xlcpp.dev/). While I like to have a good portion of configuration options in the [Djinni Generator](https://github.com/cross-language-cpp/djinni-generator), I think it is easier to get started with Djinni if a few presumptions are made for the developer. -This wrapper attemts to be a tool that allows a quick and simple start into a new project with C++ using Djinni. +This wrapper attempts to be a tool that allows a quick and simple start into a new project with C++ using Djinni. -It may evolve over time to a more powerful tool with more configuration options. This depends on your feedback and my future requirements. +It may evolve over time to a more powerful utility with more configuration options. This depends on your feedback and my future requirements. ## Features