[CMake] Generating makefile from Visual Studio Project (Migrating
to Eclipse)
Olumide
50295 at web.de
Sat Dec 8 12:30:09 EST 2007
Olumide wrote:
> I've still got a few odd's and ends to take care of. To begin with, the
> target application (Autodesk Maya) refuses to lead the plugin because
> its unable to find an initialize function which is included in the
> source file pluginMain.cpp. Specifically, the output should have a .mll
> file extension instead of .dll.
Complete success!!! Plugin compiled, linked and loaded :-) . What was
missing were the linker flags:
set_target_properties(
TestTexturePlugin PROPERTIES SUFFIX ".mll" LINK_FLAGS
"/subsystem:windows /dll /incremental:yes /debug /machine:I386
/export:initializePlugin /export:uninitializePlugin"
)
I'm posting my entire CMakeLists.txt file for posterity.
#############################################################
project( TestTexturePlugin )
set(SOURCES
C:/Work/Demo/TestTexturePlugin/pluginMain.cpp
)
include_directories(
"$(VSINSTALLDIR)include"
"$(VCInstallDir)atlmfc/include"
"$(VCInstallDir)PlatformSDK/include/prerelease"
"$(VCInstallDir)PlatformSDK/include"
"$(FrameworkSDKDir)include"
"C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/include"
"C:/Program Files/Microsoft Visual Studio .NET
2003/Vc7/PlatformSDK/Include"
"C:/Program Files/Alias/Maya6.5/include"
C:/Work/Demo/TestTexturePlugin/
)
add_definitions(
"/D \"WIN32\""
"/D \"_DEBUG\""
"/D \"_AFXDLL\""
"/D \"_MBCS\""
"/D \"_WINDOWS\""
"/D \"NT_PLUGIN\""
"/D \"REQUIRE_IOSTREAM\""
"/D \"CMAKE_INTDIR=Debug\""
"/D \"TestTexturePlugin_EXPORTS\""
)
link_directories(
"$(VCInstallDir)lib"
"$(VCInstallDir)atlmfc/lib"
"$(VCInstallDir)PlatformSDK/lib/prerelease"
"$(VCInstallDir)PlatformSDK/lib"
"$(FrameworkSDKDir)lib"
"C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/lib"
"C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib"
"C:/Program Files/Alias/Maya6.5/lib"
)
add_library( TestTexturePlugin SHARED ${SOURCES} )
set_target_properties(
TestTexturePlugin PROPERTIES SUFFIX ".mll" LINK_FLAGS
"/subsystem:windows /dll /incremental:yes /debug /machine:I386
/export:initializePlugin /export:uninitializePlugin"
)
target_link_libraries( TestTexturePlugin $(NOINHERIT) kernel32 user32
gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32
odbccp32 Foundation OpenMaya )
####################################################################
Thanks again to everyone. I'll be focusing on the actual migration to
eclipse bit next, and probably write a small "how to" when its all done.
- Olumide
More information about the CMake
mailing list