Setup

fluxEngine is distributed in form of an archive with the following relevant subdirectories:

  • bin: All the runtime library files (Windows only)

  • lib: Library files required for linking fluxEngine

    • On Windows systems this will contain a file fluxEngineC1.def from which the user can create an import library for their own compiler.

      Additionally the import library is provided for both Microsoft’s Visual C/C++ compiler, as well as GNU GCC (MinGW).

      The file fluxEngineC1.lib is the import library for MSVC (Microsoft’s Visual C/C++ compiler).

      The file libfluxEngineC1.dll.a is the import library for GNU GCC (MinGW).

    • On Linux systems this will contain two libraries, as well as the dependencies of fluxEngine:

      • libfluxEngineC1.so.0, which is the actual implementation of the public API of fluxEngine. This will be loaded at runtime.

      • A library libfluxEngineC1.so (without the .0 suffix) that is a stub import library that may be used while linking your library. This library is not required at runtime, but ensures that even if the GCC version on the system is older than the GCC used to compile fluxEngine, linking your executable will still work.

    • On macOS systems this will contain libfluxEngineC1.dylib as well as dependency libraries of fluxEngine.

  • include: Contains all the header files required to compile C programs

One needs to add the lib directory to the library search path and link against the fluxEngineC1 library (via e.g. -lfluxEngineC1 for Linux, macOS and MinGW), and add the include directory to the header file search path.

Building with CMake

The following CMake snippet will allow the user to use CMake to generate working binaries that are linked against fluxEngine across all platforms:

 1 set(FLUXENGINE_DIR "" CACHE PATH "The directory where fluxEngine is installed")
 2 if(FLUXENGINE_DIR STREQUAL "")
 3     message(FATAL_ERROR "Please specify the FLUXENGINE_DIR setting.")
 4 endif()
 5 if(NOT EXISTS "${FLUXENGINE_DIR}/include/fluxEngine/fluxEngine.h")
 6     message(FATAL_ERROR "FLUXENGINE_DIR does not point to the directory fluxEngine is located in.")
 7 endif()
 8
 9 target_include_directories(target_name PRIVATE "${FLUXENGINE_DIR}/include")
10 target_link_directories(target_name PRIVATE "${FLUXENGINE_DIR}/lib")
11 target_link_libraries(target_name fluxEngineC1)

Replace target_name with the name of your CMake target.

Note that the above snippet only adds the C headers to the include directory. Please refer to the Building against C++ with CMake section for how to add the C++ include directory as well.