Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, it took a while, but this is how I manage to create an activex project using cmake. However, I have to say I first had to create the activex project with visual studio in order to generate some files and then I transformed into a cmake project.</p> <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(MyProject) # Very useful if project has more than one target SET(BIN_OUTPUT_DIR ${MyProject_BINARY_DIR}/bin) SET(LIB_OUTPUT_DIR ${MyProject_BINARY_DIR}/lib) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR}) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR}) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}) ADD_DEFINITIONS("-DWIN32 -D_WINDOWS -D_USRDLL") ADD_DEFINITIONS("-D_AFXDLL -D_UNICODE -DUNICODE -D_WINDLL") # Not sure if all this compiler flags are needed, but they reflect the default # parameter when creating an activex project ADD_DEFINITIONS("/Oi /GL /Gy /Z7") SET(CMAKE_SHARED_LINKER_FLAGS "/OPT:REF /OPT:ICF /MACHINE:X86 /SUBSYSTEM:WINDOWS /LTCG") # I left this here just as an example it is not needed FIND_PACKAGE(Boost) SET(TargetName MyTarget) FILE(GLOB mytarget_src *.cpp *.idl *.def) FILE(GLOB mytarget_hdr *.hpp *.h) FILE(GLOB mytarget_res *.rc *.bmp) SOURCE_GROUP("Header Files" FILES ${mytarget_hdr}) SOURCE_GROUP("Resource Files" FILES ${mytarget_res}) # I tried to make this work, but I couldn't, so right now my project doesn't use pch's #ADD_PRECOMPILED_HEADER(${TargetName} stdafx.h stdafx.cpp) # The last directory is a hack, but it is needed, since the midl compiler outputs the # tlb file there, which is later needed by the resource compiler INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${TargetName}.dir/${CMAKE_CFG_INTDIR}) ADD_LIBRARY(${TargetName} SHARED ${mytarget_src} ${mytarget_hdr} ${mytarget_res}) TARGET_LINK_LIBRARIES(${TargetName}) # It is obvious what you put here SET_TARGET_PROPERTIES(${TargetName} PROPERTIES SUFFIX ".ocx") </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload