Browse Source

NativePlugins for Mac

Josh Engebretson 10 years ago
parent
commit
9c496c1dad
2 changed files with 10 additions and 3 deletions
  1. 1 0
      NativePluginExample/.gitignore
  2. 9 3
      NativePluginExample/Native/CMakeLists.txt

+ 1 - 0
NativePluginExample/.gitignore

@@ -1,2 +1,3 @@
 Native-build/*
 *.dll
+*.dylib

+ 9 - 3
NativePluginExample/Native/CMakeLists.txt

@@ -1,19 +1,25 @@
 cmake_minimum_required (VERSION 2.8)
 
-set (PLUGINNAME MyNativePlugin) 
+set (PLUGINNAME MyNativePlugin)
 
 set (SOURCEFILES MyNativePlugin.cpp)
 
 if (WIN32)
 
 	# compile with static runtime, so our plugin doesn't depend on having some MSVC runtime installed
-	
+
 	set(CompilerFlags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE)
 
 	foreach(CompilerFlag ${CompilerFlags})
 	    string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
 	endforeach()
 
+	set (PLUGINPATH Windows/x64)
+
+else()
+
+	set (PLUGINPATH Mac/x64)
+
 endif()
 
 project(${PLUGINNAME})
@@ -24,4 +30,4 @@ add_library(${PLUGINNAME} SHARED ${SOURCEFILES})
 
 add_custom_command (TARGET ${PLUGINNAME} POST_BUILD
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E copy \"$<TARGET_FILE:${PLUGINNAME}>\" \"${CMAKE_SOURCE_DIR}/../Resources/Plugins/Windows/x64/$<TARGET_FILE_NAME:${PLUGINNAME}>\")
+	ARGS -E copy \"$<TARGET_FILE:${PLUGINNAME}>\" \"${CMAKE_SOURCE_DIR}/../Resources/Plugins/${PLUGINPATH}/$<TARGET_FILE_NAME:${PLUGINNAME}>\")