简体   繁体   中英

Cmake managed C++

I have cli wrapper function which i am trying to configure in cmake. After i generate the project with cmake the generated .proj file does not have the property of clr support is set to no common languaage runtime support. below is my cmake file

    # This is the root ITK CMakeLists file.
    cmake_minimum_required(VERSION 2.8.9)
    if(COMMAND CMAKE_POLICY)
     cmake_policy(SET CMP0003 NEW)
    endif()

    set_target_properties(${TargetName} PROPERTIES COMPILE_FLAGS "/clr")
    SET(LINK_LIBRARIES
       D:\\2016\\RandomSlicing\\Processing\\lib\\obliquePlane.lib
    )
    # The header files
    SET(HEADERS
     ObliquePlaneWrapper.h
    obliquePlane.h
    )

 # The implementation files
  SET(SOURCES
   ObliquePlaneWrapper.cpp
  )

 # Find ITK.
 find_package(ITK REQUIRED)
 include(${ITK_USE_FILE})

 # Add this as include directory
 INCLUDE_DIRECTORIES(
   ${CMAKE_SOURCE_DIR}
   ${SOURCE_PATH}
   ${VXL_INCLUDE_DIRS}
 )

 # Main library
 #ADD_EXECUTABLE(obliquePlane ${HEADERS} ${SOURCES})
 ADD_LIBRARY(ObliquePlaneWrapper SHARED  ${HEADERS} ${SOURCES})
 TARGET_LINK_LIBRARIES(ObliquePlaneWrapper ${LINK_LIBRARIES} ${ITK_LIBRARIES})            

I manually set this property in the All_build project and the corresponding .proj file. When i build the project it is searching for the ObliquePlaneWrapper.dll which it should be generating. Is this a problem because of some flag not set for common language runtime support

You can manually supply Compile Flags to specific sources to be compiled with specific flags. This includes \\CLR for Visual C++. See example here.

https://cmake.org/pipermail/cmake/2011-April/043773.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM