Memo‎ > ‎

Often using CMake commands (to me)

posted Dec 10, 2011, 7:06 PM by Teng-Yok Lee   [ updated Dec 24, 2011, 6:18 PM ]
  • target_LINK_LIBRARIES # Link libraries to a target. Different configurations (Debug or Optimized) can be specified.
  • link_directories: Specify directories in which the linker will look for libraries.
  • include_directories: Add include directories to the build.
  • file(GLOB HEADER_FILES "*.h" ) # grab all .h files into the list HEADER_FILES.
  • Use CUDA
FIND_PACKAGE(CUDA)
INCLUDE(FindCUDA)    #Include the FindCUDA script
  • CMAKE_PROJECT_NAME: The name of the current project.
  • set_target_properties: Targets can have properties that affect how they are built. One usage is to create different file names under different configuration. Eg. set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
        DEBUG_OUTPUT_NAME "${CMAKE_PROJECT_NAME}_d"
        RELEASE_OUTPUT_NAME "${CMAKE_PROJECT_NAME}_r"
    )
  • How to use MFC with CMake from CMake FAQ. (Note: .cpp, .h, and .rc must be included!)




Comments