Skip to content

Commit

Permalink
simplify finding the djinni binary on Windows; minor Readme change;
Browse files Browse the repository at this point in the history
  • Loading branch information
jothepro committed Mar 24, 2022
1 parent 0d4378c commit f74a313
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
18 changes: 3 additions & 15 deletions Djinni.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -242,4 +230,4 @@ function(add_djinni_library LIBRARY_TARGET)
PUBLIC_HEADER DESTINATION include
)
endif()
endfunction()
endfunction()
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f74a313

Please sign in to comment.