mirror of
https://github.com/opentx/opentx.git
synced 2025-07-12 19:10:19 +03:00
Add cmake configuration for Libfox. (#3660)
* Add cmake configuration for Libfox. CMake on OS X does not find libfox in the homebrew location otherwise * Fix findpackage(Fox) for case sensitive systems
This commit is contained in:
parent
789326d2cd
commit
a28cbf88f3
3 changed files with 72 additions and 3 deletions
|
@ -39,6 +39,12 @@ else()
|
||||||
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
|
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Looking for FOX ")
|
||||||
|
find_package(Fox)
|
||||||
|
if ((NOT FOX_FOUND) AND (NOT WIN32))
|
||||||
|
message("Libfox not found, simu target will not be available")
|
||||||
|
endif()
|
||||||
|
|
||||||
include(Macros)
|
include(Macros)
|
||||||
today(DATE)
|
today(DATE)
|
||||||
now(TIME)
|
now(TIME)
|
||||||
|
|
63
cmake/FindFox.cmake
Normal file
63
cmake/FindFox.cmake
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# Imported from the DeskVox project (LPGL 2.1)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
set(hints
|
||||||
|
$ENV{LIB_BASE_PATH}/fox
|
||||||
|
)
|
||||||
|
|
||||||
|
set(paths
|
||||||
|
/usr
|
||||||
|
/usr/local
|
||||||
|
)
|
||||||
|
|
||||||
|
find_path(FOX_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
fx.h
|
||||||
|
HINTS
|
||||||
|
${hints}
|
||||||
|
PATHS
|
||||||
|
${paths}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
include
|
||||||
|
include/fox
|
||||||
|
include/fox-1.6
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(FOX_LIBRARY
|
||||||
|
NAMES
|
||||||
|
FOX-1.6
|
||||||
|
fox-1.6
|
||||||
|
HINTS
|
||||||
|
${hints}
|
||||||
|
PATHS
|
||||||
|
${paths}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
lib64
|
||||||
|
lib
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(FOX_LIBRARY_DEBUG
|
||||||
|
NAMES
|
||||||
|
FOXD-1.6
|
||||||
|
foxd-1.6
|
||||||
|
HINTS
|
||||||
|
${hints}
|
||||||
|
PATHS
|
||||||
|
${paths}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
lib64
|
||||||
|
lib
|
||||||
|
)
|
||||||
|
|
||||||
|
if(FOX_LIBRARY_DEBUG)
|
||||||
|
set(FOX_LIBRARIES optimized ${FOX_LIBRARY} debug ${FOX_LIBRARY_DEBUG})
|
||||||
|
else()
|
||||||
|
set(FOX_LIBRARIES ${FOX_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(FOX
|
||||||
|
DEFAULT_MSG
|
||||||
|
FOX_INCLUDE_DIR
|
||||||
|
FOX_LIBRARY
|
||||||
|
)
|
|
@ -48,7 +48,7 @@ else()
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CPP_FLAGS} -g -O0")
|
set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CPP_FLAGS} -g -O0")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT WIN32)
|
if((NOT WIN32) AND FOX_FOUND)
|
||||||
if(SIMU_DISKIO)
|
if(SIMU_DISKIO)
|
||||||
add_definitions(-DSIMU_DISKIO)
|
add_definitions(-DSIMU_DISKIO)
|
||||||
set(SIMU_SRC ${SIMU_SRC} ../../thirdparty/FatFs/ff.c ../../thirdparty/FatFs/option/ccsbcs.c)
|
set(SIMU_SRC ${SIMU_SRC} ../../thirdparty/FatFs/ff.c ../../thirdparty/FatFs/option/ccsbcs.c)
|
||||||
|
@ -56,8 +56,8 @@ if(NOT WIN32)
|
||||||
|
|
||||||
add_executable(simu WIN32 ${SIMU_SRC} ../../simu.cpp)
|
add_executable(simu WIN32 ${SIMU_SRC} ../../simu.cpp)
|
||||||
add_dependencies(simu ${FIRMWARE_DEPENDENCIES})
|
add_dependencies(simu ${FIRMWARE_DEPENDENCIES})
|
||||||
target_include_directories(simu PUBLIC /usr/local/include/fox-1.6 PUBLIC /usr/include/fox-1.6 /opt/local/include/fox-1.6)
|
target_include_directories(simu PUBLIC ${FOX_INCLUDE_DIR} )
|
||||||
target_link_libraries(simu FOX-1.6 pthread ${SDL_LIBRARY})
|
target_link_libraries(simu ${FOX_LIBRARY} pthread ${SDL_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue