[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})
|
---|
[91] | 16 | message(STATUS "Detected PACPUS_ROOT in environment, set to '${PACPUS_ROOT}'")
|
---|
[80] | 17 | else()
|
---|
| 18 | if(PACPUS_FIND_REQUIRED)
|
---|
[91] | 19 | MESSAGE(FATAL_ERROR "Could'not find PACPUS_ROOT ")
|
---|
[80] | 20 | else()
|
---|
[91] | 21 | MESSAGE(STATUS "Could'not find PACPUS_ROOT ")
|
---|
| 22 | return()
|
---|
[80] | 23 | endif()
|
---|
[50] | 24 | endif()
|
---|
[91] | 25 | else()
|
---|
| 26 | message(STATUS "Detected PACPUS_ROOT as argument with the path: '${PACPUS_ROOT}'")
|
---|
[9] | 27 | endif()
|
---|
| 28 |
|
---|
| 29 |
|
---|
[80] | 30 |
|
---|
[9] | 31 | # Hint directories
|
---|
| 32 | set(PACPUS_INCLUDE_HINT ${PACPUS_ROOT}/include)
|
---|
| 33 | set(PACPUS_LIBRARY_HINT ${PACPUS_ROOT}/lib)
|
---|
| 34 |
|
---|
| 35 | # Locate the include files
|
---|
| 36 | find_path(
|
---|
[50] | 37 | PACPUS_INCLUDE_DIR
|
---|
| 38 | NAMES
|
---|
| 39 | "Pacpus"
|
---|
| 40 | HINTS
|
---|
| 41 | ${PACPUS_INCLUDE_HINT}
|
---|
| 42 | DOC
|
---|
| 43 | "The Pacpus include directory"
|
---|
[9] | 44 | )
|
---|
| 45 |
|
---|
| 46 | # List of required modules
|
---|
| 47 | set(PACPUS_MODULES "FileLib" "PacpusLib" "PacpusTools" "dbiteplayerlib")
|
---|
[50] | 48 | if(WIN32)
|
---|
| 49 | list(APPEND PACPUS_MODULES "ROAD_TIME")
|
---|
[9] | 50 | endif()
|
---|
| 51 |
|
---|
| 52 | set(MODULE_MISSING FALSE)
|
---|
| 53 | set(PACPUS_LIBRARIES "")
|
---|
| 54 |
|
---|
| 55 | # Check the presence of each module
|
---|
| 56 | foreach(module ${PACPUS_MODULES})
|
---|
[50] | 57 | find_library(
|
---|
| 58 | PACPUS_${module}_LIB
|
---|
| 59 | NAMES
|
---|
| 60 | ${module}
|
---|
| 61 | HINTS
|
---|
| 62 | ${PACPUS_LIBRARY_HINT}
|
---|
| 63 | )
|
---|
| 64 | find_library(
|
---|
| 65 | PACPUS_${module}_LIBD
|
---|
| 66 | NAMES
|
---|
| 67 | ${module}_d
|
---|
| 68 | HINTS
|
---|
| 69 | ${PACPUS_LIBRARY_HINT}
|
---|
| 70 | )
|
---|
[9] | 71 |
|
---|
[50] | 72 | if(PACPUS_${module}_LIB AND PACPUS_${module}_LIBD)
|
---|
| 73 | list(APPEND PACPUS_LIBRARIES optimized ${PACPUS_${module}_LIB})
|
---|
| 74 | list(APPEND PACPUS_LIBRARIES debug ${PACPUS_${module}_LIBD})
|
---|
| 75 | else()
|
---|
| 76 | set(MODULE_MISSING TRUE)
|
---|
| 77 | endif()
|
---|
[9] | 78 | endforeach()
|
---|
| 79 |
|
---|
| 80 | if(NOT MODULE_MISSING AND PACPUS_INCLUDE_DIR)
|
---|
[50] | 81 | set(PACPUS_FOUND TRUE)
|
---|
[80] | 82 |
|
---|
| 83 | # Configure Pacpus
|
---|
| 84 | list(APPEND CMAKE_MODULE_PATH "${PACPUS_ROOT}/cmake")
|
---|
| 85 | include(${PACPUS_ROOT}/cmake/PacpusUtilities.cmake)
|
---|
| 86 | include(${PACPUS_ROOT}/cmake/PacpusConfiguration.cmake)
|
---|
| 87 | include(${PACPUS_ROOT}/cmake/PacpusDependencies.cmake)
|
---|
| 88 | include(${PACPUS_ROOT}/cmake/PacpusPlatforms.cmake)
|
---|
| 89 |
|
---|
| 90 | #set(CMAKE_INSTALL_PREFIX ${PACPUS_ROOT})
|
---|
| 91 | set(PACPUS_INSTALL_DIR ${PACPUS_ROOT})
|
---|
[91] | 92 | set(PACPUS_LIB_DIR "${PACPUS_ROOT}/lib")
|
---|
[80] | 93 | MESSAGE(STATUS "PACPUS_ROOT found ${PACPUS_ROOT}")
|
---|
| 94 |
|
---|
[9] | 95 | else()
|
---|
[50] | 96 | set(PACPUS_FOUND FALSE)
|
---|
[80] | 97 |
|
---|
| 98 | if(PACPUS_FIND_REQUIRED)
|
---|
| 99 | MESSAGE(FATAL_ERROR "Could'not find PACPUS_ROOT ")
|
---|
| 100 | else()
|
---|
| 101 | MESSAGE(STATUS "Could'not find PACPUS_ROOT ")
|
---|
| 102 | endif()
|
---|
| 103 |
|
---|
[9] | 104 | endif()
|
---|