diff options
Diffstat (limited to 'project/cmake/modules/FindTexturePacker.cmake')
| -rw-r--r-- | project/cmake/modules/FindTexturePacker.cmake | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/project/cmake/modules/FindTexturePacker.cmake b/project/cmake/modules/FindTexturePacker.cmake index 2229ff7..f9e4c75 100644 --- a/project/cmake/modules/FindTexturePacker.cmake +++ b/project/cmake/modules/FindTexturePacker.cmake | |||
| @@ -3,6 +3,10 @@ | |||
| 3 | # ----------------- | 3 | # ----------------- |
| 4 | # Finds the TexturePacker | 4 | # Finds the TexturePacker |
| 5 | # | 5 | # |
| 6 | # If WITH_TEXTUREPACKER is defined and points to a directory, | ||
| 7 | # this path will be used to search for the Texturepacker binary | ||
| 8 | # | ||
| 9 | # | ||
| 6 | # This will define the following (imported) targets:: | 10 | # This will define the following (imported) targets:: |
| 7 | # | 11 | # |
| 8 | # TexturePacker::TexturePacker - The TexturePacker executable | 12 | # TexturePacker::TexturePacker - The TexturePacker executable |
| @@ -17,7 +21,21 @@ if(NOT TARGET TexturePacker::TexturePacker) | |||
| 17 | set_target_properties(TexturePacker::TexturePacker PROPERTIES | 21 | set_target_properties(TexturePacker::TexturePacker PROPERTIES |
| 18 | IMPORTED_LOCATION "${CORE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe") | 22 | IMPORTED_LOCATION "${CORE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe") |
| 19 | else() | 23 | else() |
| 20 | add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker) | 24 | if(WITH_TEXTUREPACKER) |
| 21 | add_executable(TexturePacker::TexturePacker ALIAS TexturePacker) | 25 | get_filename_component(_tppath ${WITH_TEXTUREPACKER} ABSOLUTE) |
| 26 | find_program(TEXTUREPACKER_EXECUTABLE TexturePacker PATHS ${_tppath}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(TexturePacker DEFAULT_MSG TEXTUREPACKER_EXECUTABLE) | ||
| 30 | if(TEXTUREPACKER_FOUND) | ||
| 31 | add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL) | ||
| 32 | set_target_properties(TexturePacker::TexturePacker PROPERTIES | ||
| 33 | IMPORTED_LOCATION "${TEXTUREPACKER_EXECUTABLE}") | ||
| 34 | endif() | ||
| 35 | mark_as_advanced(TEXTUREPACKER) | ||
| 36 | else() | ||
| 37 | add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker) | ||
| 38 | add_executable(TexturePacker::TexturePacker ALIAS TexturePacker) | ||
| 39 | endif() | ||
| 22 | endif() | 40 | endif() |
| 23 | endif() | 41 | endif() |
