# ---------------------------------------------------------------------------- # CMake file for libAR2 See root CMakeLists.txt # # ---------------------------------------------------------------------------- project(libAR2) file(GLOB_RECURSE lib_srcs ${CMAKE_CURRENT_SOURCE_DIR}/*.c) file(GLOB_RECURSE lib_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/*.h) file(GLOB_RECURSE lib_hbase ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/AR2/*.h) set(lib_includes ${lib_hdrs} ${lib_hbase}) if (JPEG_FOUND) include_directories(include ${CMAKE_CURRENT_SOURCE_DIR}/../../../include ${JPEG_INCLUDE_DIR}) else (JPEG_FOUND) remove_from_list(lib_srcs jpeg.c) include_directories(include ${CMAKE_CURRENT_SOURCE_DIR}/../../../include) add_definitions(-DAR2_REMOVE_JPEG) endif (JPEG_FOUND) # ---------------------------------------------------------------------------------- # Define the library target: # ---------------------------------------------------------------------------------- add_library(libAR2 STATIC ${lib_srcs} ${lib_includes}) if (CMAKE_COMPILER_IS_GNUCXX) # Fix x64 issues on Linux if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) add_definitions(-fPIC) endif() endif (CMAKE_COMPILER_IS_GNUCXX) #option ("ARToolKit_ADAPTATIVE_TEMPLATE" "Build artoolkit with adaptative templates" ON) #TODO generate config from config.in # Add definitions #if (${ARToolKit_ADAPTATIVE_TEMPLATE}) # add_definitions(-DAR2_CAPABLE_ADAPTIVE_TEMPLATE=1) #endif() # set the lib version set_target_properties(libAR2 PROPERTIES OUTPUT_NAME libAR2 VERSION "${ARToolKit_VERSION}" SOVERSION "${ARToolKit_VERSION_MAJOR}" ) if (JPEG_FOUND) target_link_libraries(libAR2 ${JPEG_LIBRARY}) endif (JPEG_FOUND) artoolkit_config_lib(libAR2) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/AR2 DESTINATION include FILES_MATCHING PATTERN "*.h") install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")