#------------------------------------------------------------------- # This file is part of the CMake build system for ARToolKit # # The contents of this file are placed in the public domain. Feel # free to make use of it in any way you like. #------------------------------------------------------------------- # Configure settings and install targets if (WIN32) set(ARToolKit_RELEASE_PATH "/Release") set(ARToolKit_RELWDBG_PATH "/RelWithDebInfo") set(ARToolKit_MINSIZE_PATH "/MinSizeRel") set(ARToolKit_DEBUG_PATH "/Debug") set(ARToolKit_LIB_RELEASE_PATH "/Release") set(ARToolKit_LIB_RELWDBG_PATH "/RelWithDebInfo") set(ARToolKit_LIB_MINSIZE_PATH "/MinSizeRel") set(ARToolKit_LIB_DEBUG_PATH "/Debug") set(ARToolKit_PLUGIN_PATH "/Plugins") elseif (UNIX) set(ARToolKit_RELEASE_PATH "") set(ARToolKit_RELWDBG_PATH "") set(ARToolKit_MINSIZE_PATH "") set(ARToolKit_DEBUG_PATH "/debug") set(ARToolKit_LIB_RELEASE_PATH "") set(ARToolKit_LIB_RELWDBG_PATH "") set(ARToolKit_LIB_MINSIZE_PATH "") set(ARToolKit_LIB_DEBUG_PATH "") set(ARToolKit_PLUGIN_PATH "/ARTOOLKIT") endif () # create vcproj.user file for Visual Studio to set debug working directory function(artoolkit_create_vcproj_userfile TARGETNAME) if (MSVC) configure_file( ${ARToolKit_TEMPLATES_DIR}/VisualStudioUserFile.vcproj.user.in ${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}.vcproj.user @ONLY ) endif () endfunction(artoolkit_create_vcproj_userfile) # install targets according to current build type function(artoolkit_install_target TARGETNAME SUFFIX) install(TARGETS ${TARGETNAME} BUNDLE DESTINATION "bin${ARToolKit_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" RUNTIME DESTINATION "bin${ARToolKit_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" LIBRARY DESTINATION "lib${ARToolKit_LIB_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" ARCHIVE DESTINATION "lib${ARToolKit_LIB_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" FRAMEWORK DESTINATION "bin${ARToolKit_RELEASE_PATH}${SUFFIX}" CONFIGURATIONS Release None "" ) install(TARGETS ${TARGETNAME} BUNDLE DESTINATION "bin${ARToolKit_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo RUNTIME DESTINATION "bin${ARToolKit_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo LIBRARY DESTINATION "lib${ARToolKit_LIB_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo ARCHIVE DESTINATION "lib${ARToolKit_LIB_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo FRAMEWORK DESTINATION "bin${ARToolKit_RELWDBG_PATH}${SUFFIX}" CONFIGURATIONS RelWithDebInfo ) install(TARGETS ${TARGETNAME} BUNDLE DESTINATION "bin${ARToolKit_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel RUNTIME DESTINATION "bin${ARToolKit_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel LIBRARY DESTINATION "lib${ARToolKit_LIB_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel ARCHIVE DESTINATION "lib${ARToolKit_LIB_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel FRAMEWORK DESTINATION "bin${ARToolKit_MINSIZE_PATH}${SUFFIX}" CONFIGURATIONS MinSizeRel ) install(TARGETS ${TARGETNAME} BUNDLE DESTINATION "bin${ARToolKit_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug RUNTIME DESTINATION "bin${ARToolKit_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug LIBRARY DESTINATION "lib${ARToolKit_LIB_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug ARCHIVE DESTINATION "lib${ARToolKit_LIB_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug FRAMEWORK DESTINATION "bin${ARToolKit_DEBUG_PATH}${SUFFIX}" CONFIGURATIONS Debug ) endfunction(artoolkit_install_target) # setup common target settings function(artoolkit_config_common TARGETNAME) if (NOT IOS) set_target_properties(${TARGETNAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${ARToolKit_BINARY_DIR}/lib LIBRARY_OUTPUT_DIRECTORY ${ARToolKit_BINARY_DIR}/lib RUNTIME_OUTPUT_DIRECTORY ${ARToolKit_BINARY_DIR}/bin ) endif() artoolkit_create_vcproj_userfile(${TARGETNAME}) if (ARToolKit_STATIC) set(ARTOOLKIT_LIBRARIES ${ARTOOLKIT_LIBRARIES} ${TARGETNAME}) add_definitions("-DARTOOLKIT_STATIC") endif() endfunction(artoolkit_config_common) # add plugin include path function(artoolkit_include_plugin TARGETNAME TARGETPATH INCFILE) if (ARToolKit_STATIC) FIND_PATH(ARTOOLKIT_${TARGETNAME}_INCLUDE ${INCFILE} PATHS ${TARGETPATH}) set(ARTOOLKIT_INCLUDES ${ARTOOLKIT_INCLUDES} ${ARTOOLKIT_${TARGETNAME}_INCLUDE} CACHE INTERNAL "" FORCE) mark_as_advanced(FORCE ARTOOLKIT_${TARGETNAME}_INCLUDE) if (ARTOOLKIT_${TARGETNAME}_INCLUDE) set(ARTOOLKIT_PREPROCESSOR "${ARTOOLKIT_PREPROCESSOR} -DARTOOLKIT_${TARGETNAME}_LOAD" CACHE INTERNAL "" FORCE) #message(STATUS "ARTOOLKIT_PREPROCESSOR : ${ARTOOLKIT_PREPROCESSOR}") endif (ARTOOLKIT_${TARGETNAME}_INCLUDE) endif(ARToolKit_STATIC) endfunction(artoolkit_include_plugin) # setup library build function(artoolkit_config_lib LIBNAME) artoolkit_config_common(${LIBNAME}) artoolkit_install_target(${LIBNAME} "") # install debug pdb files if (ARToolKit_INSTALL_PDB) install(FILES ${ARToolKit_BINARY_DIR}/bin${ARToolKit_DEBUG_PATH}/${LIBNAME}.pdb DESTINATION bin${ARToolKit_DEBUG_PATH} CONFIGURATIONS Debug ) install(FILES ${ARToolKit_BINARY_DIR}/bin${ARToolKit_RELWDBG_PATH}/${LIBNAME}.pdb DESTINATION bin${ARToolKit_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo ) endif () endfunction(artoolkit_config_lib) function(artoolkit_config_exe LIBNAME) if (NOT IOS) set_target_properties(${LIBNAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${ARToolKit_BINARY_DIR}/lib LIBRARY_OUTPUT_DIRECTORY ${ARToolKit_BINARY_DIR}/lib RUNTIME_OUTPUT_DIRECTORY ${ARToolKit_BINARY_DIR}/bin ) endif() artoolkit_create_vcproj_userfile(${LIBNAME}) if (ARToolKit_STATIC) add_definitions("-DARTOOLKIT_STATIC") endif() artoolkit_install_target(${LIBNAME} "") if (ARToolKit_INSTALL_PDB) # install debug pdb files install(FILES ${ARToolKit_BINARY_DIR}/lib${ARToolKit_DEBUG_PATH}/${LIBNAME}.pdb DESTINATION bin${ARToolKit_DEBUG_PATH} CONFIGURATIONS Debug ) install(FILES ${ARToolKit_BINARY_DIR}/lib${ARToolKit_RELWDBG_PATH}/${LIBNAME}.pdb DESTINATION bin${ARToolKit_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo ) endif () endfunction(artoolkit_config_exe) function(artoolkit_config_component LIBNAME) artoolkit_config_common(${LIBNAME}) artoolkit_install_target(${LIBNAME} "") if (ARToolKit_INSTALL_PDB) # install debug pdb files install(FILES ${ARToolKit_BINARY_DIR}/lib${ARToolKit_DEBUG_PATH}/${LIBNAME}.pdb DESTINATION bin${ARToolKit_DEBUG_PATH} CONFIGURATIONS Debug ) install(FILES ${ARToolKit_BINARY_DIR}/lib${ARToolKit_RELWDBG_PATH}/${LIBNAME}.pdb DESTINATION bin${ARToolKit_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo ) endif () endfunction(artoolkit_config_component) # setup plugin build function(artoolkit_config_plugin PLUGINNAME) artoolkit_config_common(${PLUGINNAME}) artoolkit_install_target(${PLUGINNAME} ${ARToolKit_PLUGIN_PATH}) if (ARToolKit_INSTALL_PDB) # install debug pdb files install(FILES ${ARToolKit_BINARY_DIR}/bin${ARToolKit_DEBUG_PATH}/${PLUGINNAME}.pdb DESTINATION bin${ARToolKit_DEBUG_PATH} CONFIGURATIONS Debug ) install(FILES ${ARToolKit_BINARY_DIR}/bin${ARToolKit_RELWDBG_PATH}/${PLUGINNAME}.pdb DESTINATION bin${ARToolKit_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo ) endif () endfunction(artoolkit_config_plugin)