# Command lines: # mkdir ..\Build\FaceBasics-D2D # cd ..\Build\FaceBasics-D2D # cmake -C ..\..\FaceBasics-D2D\initial_cache.cmake -G "Visual Studio 12 Win64" ..\..\FaceBasics-D2D -DCMAKE_INSTALL_PREFIX=..\Install # # This generates the solution file, which is used in Microsoft VisualC++ # KinectFace.sln project(KinectFace) cmake_minimum_required(VERSION 2.8.11) set(KinectFace_VERSION_MAJOR 0) set(KinectFace_VERSION_MINOR 1) set(KinectFace_VERSION_PATCH 0) #### Ugly way of including packages (manually -- following Qingju's recommendation): include_directories("C:\\local\\boost_1_55_0") link_directories("C:\\local\\boost_1_55_0\\lib64-msvc-12.0") set(Boost_USE_STATIC_LIBS ON) #### Old version (using find_package): this should work, but it doesn't :-( # find_package(Boost 1.55.0 COMPONENTS system date_time regex REQUIRED) # if(Boost_FOUND) # message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}") # else(Boost_FOUND) # message(FATAL_ERROR "Boost not found") # endif() # include_directories(${Boost_INCLUDE_DIRS}) # # add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib. Seems to be necessary because we use /MD, i.e. link to the dynamic CRT. # # add_definitions(-DBOOST_ALL_NO_LIB) # Don't use the automatic library linking by boost with VS2010 (#pragma ...). Instead, we specify everything in cmake. # Include Microsoft Kinect SDK (Windows) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) find_package(KinectSDK REQUIRED) add_definitions(-D_UNICODE) include_directories(${KinectSDK_INCLUDE_DIR}) # Source and header files: set(SOURCE FaceBasics.cpp ImageRenderer.cpp ) set(HEADERS FaceBasics.h ImageRenderer.h resource.h stdafx.h FaceBasics.rc ) add_executable(KinectFace WIN32 ${SOURCE} ${HEADERS}) target_link_libraries(KinectFace ${KinectSDK_LIBRARIES} ${Boost_LIBRARIES}) configure_file(params.json ${CMAKE_CURRENT_BINARY_DIR}/params.json COPYONLY) install(TARGETS KinectFace DESTINATION bin) install(FILES ${KinectSDK_DLLS} params.json DESTINATION bin) install(DIRECTORY NuiDatabase DESTINATION bin) include(InstallRequiredSystemLibraries) # This module will include any runtime libraries that are needed by the project for the current platform set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_PACKAGE_VERSION_MAJOR "${KinectFace_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${KinectFace_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${KinectFace_VERSION_PATCH}") include(CPack)