cmake -H. -Bobjdir
cd objdir && make
make install
The build is also responsive to
- static/shared toggle
BUILD_SHARED_LIBS
- install location
CMAKE_INSTALL_PREFIX
name/name_L
in library fragments toggleFRAGLIB_UNDERSCORE_L
- shallow/deep library fragments directory structure toggle
FRAGLIB_DEEP
CMAKE_C_COMPILER
andCMAKE_C_FLAGS
See CMakeLists.txt for options details and additional options.
All these build options should be passed as cmake -DOPTION
.
This project installs with libefpConfig.cmake
, libefpConfigVersion.cmake
, and libefpTargets.cmake
files suitable for use with CMake find_package()
in CONFIG
mode.
find_package(libefp)
- find any libefp libraries and headersfind_package(libefp 1.5.0 EXACT CONFIG REQUIRED COMPONENTS static)
- find libefp of exactly specified version built with static libraries; abort on failure
See libefpConfig.cmake.in for details of how to detect the Config file and what CMake variables and targets are exported to your project.
After find_package(libefp ...)
,
- test if package found with
if(${libefp_FOUND})
orif(TARGET libefp::efp)
- link to library (establishes dependency), including header and definitions configuration with
target_link_libraries(mytarget libefp::efp)
- include header files using
target_include_directories(mytarget PRIVATE $<TARGET_PROPERTY:libefp::efp,INTERFACE_INCLUDE_DIRECTORIES>)
- compile target applying
-DUSING_libefp
definition usingtarget_compile_definitions(mytarget PRIVATE $<TARGET_PROPERTY:libefp::efp,INTERFACE_COMPILE_DEFINITIONS>)