diff options
| -rw-r--r-- | CMake/FLTK-Functions.cmake | 2 | ||||
| -rw-r--r-- | CMake/export.cmake | 20 | ||||
| -rw-r--r-- | CMakeLists.txt | 14 | ||||
| -rw-r--r-- | fluid/CMakeLists.txt | 4 |
4 files changed, 23 insertions, 17 deletions
diff --git a/CMake/FLTK-Functions.cmake b/CMake/FLTK-Functions.cmake index 2c29efe73..460f89fbf 100644 --- a/CMake/FLTK-Functions.cmake +++ b/CMake/FLTK-Functions.cmake @@ -28,7 +28,7 @@ function (FLTK_RUN_FLUID TARGET SOURCES) string(REGEX REPLACE "(.*).fl" \\1 basename ${src}) add_custom_command( OUTPUT "${basename}.cxx" "${basename}.h" - COMMAND fluid -c ${CMAKE_CURRENT_SOURCE_DIR}/${src} + COMMAND ${FLTK_FLUID_EXECUTABLE} -c ${CMAKE_CURRENT_SOURCE_DIR}/${src} DEPENDS ${src} MAIN_DEPENDENCY ${src} ) diff --git a/CMake/export.cmake b/CMake/export.cmake index 6e8bc5dd6..81f6e08d1 100644 --- a/CMake/export.cmake +++ b/CMake/export.cmake @@ -1,8 +1,8 @@ # -# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) +# Export CMake file to build the FLTK project using CMake (www.cmake.org) # Written by Michael Surette # -# Copyright 1998-2020 by Bill Spitzak and others. +# Copyright 1998-2021 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this @@ -19,27 +19,23 @@ # final config and export ####################################################################### -# Set the fluid executable path +# Set the fluid executable path used to create .cxx/.h from .fl files + if (CMAKE_CROSSCOMPILING) + # find a fluid executable on the host system find_file(FLUID_PATH NAMES fluid fluid.exe PATHS ENV PATH NO_CMAKE_FIND_ROOT_PATH ) - add_executable(fluid IMPORTED) set (FLTK_FLUID_EXECUTABLE ${FLUID_PATH}) - set (FLUID) # no export - set_target_properties(fluid - PROPERTIES IMPORTED_LOCATION ${FLUID_PATH} - ) + set (FLUID) # don't export else () - add_subdirectory(fluid) + # use the fluid executable we build set (FLTK_FLUID_EXECUTABLE fluid) - set (FLUID fluid) # export + set (FLUID fluid) # export endif (CMAKE_CROSSCOMPILING) -add_subdirectory(src) - # generate FLTK-Targets.cmake for build directory use export(TARGETS ${FLUID} ${FLTK_LIBRARIES} FILE ${CMAKE_CURRENT_BINARY_DIR}/FLTK-Targets.cmake) diff --git a/CMakeLists.txt b/CMakeLists.txt index 577e0656b..72b9102d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,20 @@ endif (debug_build) unset (debug_build) ####################################################################### +# build the FLTK libraries +####################################################################### + +add_subdirectory(src) + +####################################################################### +# build fluid +####################################################################### + +if (NOT ANDROID) + add_subdirectory(fluid) +endif() + +####################################################################### # variables shared by export and install # export.cmake creates configuration files for direct use in a built but uninstalled FLTK # install.cmake creates these files for an installed FLTK diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt index dce95ca3a..e791de655 100644 --- a/fluid/CMakeLists.txt +++ b/fluid/CMakeLists.txt @@ -14,8 +14,6 @@ # https://www.fltk.org/bugs.php # -if (NOT ANDROID) - set (CPPFILES CodeEditor.cxx StyleParse.cxx @@ -115,5 +113,3 @@ if (UNIX) ) endforeach() endif (UNIX) - -endif (NOT ANDROID) |
