[9] | 1 | #################################################
|
---|
| 2 | # ___________ ____ ______ __ __ _____ #
|
---|
| 3 | # \____ \__ \ _/ ___\\____ \| | \/ ___/ #
|
---|
| 4 | # | |_> > __ \\ \___| |_> > | /\___ \ #
|
---|
| 5 | # | __(____ /\___ > __/|____//____ > #
|
---|
| 6 | # |__| \/ \/|__| \/ #
|
---|
| 7 | # #
|
---|
| 8 | #################################################
|
---|
| 9 |
|
---|
| 10 | # TODO: write the output variables of this CMake file.
|
---|
| 11 |
|
---|
| 12 | # Check PACPUS_ROOT
|
---|
[50] | 13 | if(NOT PACPUS_ROOT)
|
---|
| 14 | if(NOT ENV{PACPUS_ROOT} STREQUAL "")
|
---|
| 15 | set(PACPUS_ROOT $ENV{PACPUS_ROOT})
|
---|
| 16 | message(STATUS "Detected PACPUS_ROOT, set to '${PACPUS_ROOT}'")
|
---|
| 17 | endif()
|
---|
[9] | 18 | endif()
|
---|
| 19 |
|
---|
| 20 | # Configure Pacpus
|
---|
| 21 | include(${PACPUS_ROOT}/cmake/PacpusUtilities.cmake)
|
---|
| 22 | include(${PACPUS_ROOT}/cmake/PacpusConfiguration.cmake)
|
---|
| 23 | include(${PACPUS_ROOT}/cmake/PacpusDependencies.cmake)
|
---|
| 24 | include(${PACPUS_ROOT}/cmake/PacpusPlatforms.cmake)
|
---|
| 25 |
|
---|
| 26 | # Hint directories
|
---|
| 27 | set(PACPUS_INCLUDE_HINT ${PACPUS_ROOT}/include)
|
---|
| 28 | set(PACPUS_LIBRARY_HINT ${PACPUS_ROOT}/lib)
|
---|
| 29 |
|
---|
| 30 | # Locate the include files
|
---|
| 31 | find_path(
|
---|
[50] | 32 | PACPUS_INCLUDE_DIR
|
---|
| 33 | NAMES
|
---|
| 34 | "Pacpus"
|
---|
| 35 | HINTS
|
---|
| 36 | ${PACPUS_INCLUDE_HINT}
|
---|
| 37 | DOC
|
---|
| 38 | "The Pacpus include directory"
|
---|
[9] | 39 | )
|
---|
| 40 |
|
---|
| 41 | # List of required modules
|
---|
| 42 | set(PACPUS_MODULES "FileLib" "PacpusLib" "PacpusTools" "dbiteplayerlib")
|
---|
[50] | 43 | if(WIN32)
|
---|
| 44 | list(APPEND PACPUS_MODULES "ROAD_TIME")
|
---|
[9] | 45 | endif()
|
---|
| 46 |
|
---|
| 47 | set(MODULE_MISSING FALSE)
|
---|
| 48 | set(PACPUS_LIBRARIES "")
|
---|
| 49 |
|
---|
| 50 | # Check the presence of each module
|
---|
| 51 | foreach(module ${PACPUS_MODULES})
|
---|
[50] | 52 | find_library(
|
---|
| 53 | PACPUS_${module}_LIB
|
---|
| 54 | NAMES
|
---|
| 55 | ${module}
|
---|
| 56 | HINTS
|
---|
| 57 | ${PACPUS_LIBRARY_HINT}
|
---|
| 58 | )
|
---|
| 59 | find_library(
|
---|
| 60 | PACPUS_${module}_LIBD
|
---|
| 61 | NAMES
|
---|
| 62 | ${module}_d
|
---|
| 63 | HINTS
|
---|
| 64 | ${PACPUS_LIBRARY_HINT}
|
---|
| 65 | )
|
---|
[9] | 66 |
|
---|
[50] | 67 | if(PACPUS_${module}_LIB AND PACPUS_${module}_LIBD)
|
---|
| 68 | list(APPEND PACPUS_LIBRARIES optimized ${PACPUS_${module}_LIB})
|
---|
| 69 | list(APPEND PACPUS_LIBRARIES debug ${PACPUS_${module}_LIBD})
|
---|
| 70 | else()
|
---|
| 71 | set(MODULE_MISSING TRUE)
|
---|
| 72 | endif()
|
---|
[9] | 73 | endforeach()
|
---|
| 74 |
|
---|
| 75 | if(NOT MODULE_MISSING AND PACPUS_INCLUDE_DIR)
|
---|
[50] | 76 | set(PACPUS_FOUND TRUE)
|
---|
[9] | 77 | else()
|
---|
[50] | 78 | set(PACPUS_FOUND FALSE)
|
---|
[9] | 79 | endif()
|
---|