1 | #################################################
|
---|
2 | # ___________ ____ ______ __ __ _____ #
|
---|
3 | # \____ \__ \ _/ ___\\____ \| | \/ ___/ #
|
---|
4 | # | |_> > __ \\ \___| |_> > | /\___ \ #
|
---|
5 | # | __(____ /\___ > __/|____//____ > #
|
---|
6 | # |__| \/ \/|__| \/ #
|
---|
7 | # #
|
---|
8 | #################################################
|
---|
9 |
|
---|
10 | # TODO: write the output variables of this CMake file.
|
---|
11 |
|
---|
12 | # Check PACPUS_ROOT
|
---|
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()
|
---|
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(
|
---|
32 | PACPUS_INCLUDE_DIR
|
---|
33 | NAMES
|
---|
34 | "Pacpus"
|
---|
35 | HINTS
|
---|
36 | ${PACPUS_INCLUDE_HINT}
|
---|
37 | DOC
|
---|
38 | "The Pacpus include directory"
|
---|
39 | )
|
---|
40 |
|
---|
41 | # List of required modules
|
---|
42 | set(PACPUS_MODULES "FileLib" "PacpusLib" "PacpusTools" "dbiteplayerlib")
|
---|
43 | if (WIN32)
|
---|
44 | list(APPEND PACPUS_MODULES "ROAD_TIME")
|
---|
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})
|
---|
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 | )
|
---|
66 |
|
---|
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()
|
---|
73 | endforeach()
|
---|
74 |
|
---|
75 | if(NOT MODULE_MISSING AND PACPUS_INCLUDE_DIR)
|
---|
76 | set(PACPUS_FOUND TRUE)
|
---|
77 | else()
|
---|
78 | set(PACPUS_FOUND FALSE)
|
---|
79 | endif()
|
---|