--- /dev/null
+MACRO(CONFIGURE_DEFAULTS)
+ # This is for an advanced option to give aggressive warnings
+ # under different compilers. If yours is not implemented, this option
+ # will not be made available.
+ IF(CMAKE_COMPILER_IS_GNUCXX)
+ # To be complete, we might also do GNUCC flags,
+ # but everything here is C++ code.
+ # -Wshadow and -Woverloaded-virtual are also interesting flags, but OSG
+ # returns too many hits.
+ # FYI, if we do implement GNUCC, then -Wmissing-prototypes in another
+ # interesting C-specific flag.
+ # Also, there is a bug in gcc 4.0. Under C++, -pedantic will create
+ # errors instead of warnings for certain issues, including superfluous
+ # semicolons and commas, and the use of long long. -fpermissive seems
+ # to be the workaround.
+ SET(AGGRESSIVE_WARNING_FLAGS "-Wall -Wparentheses -Wformat=2 -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive")
+ ELSE(CMAKE_COMPILER_IS_GNUCXX)
+ IF(MSVC)
+ # FIXME: What are good aggressive warning flags for Visual Studio?
+ # And do we need to further subcase this for different versions of VS?
+ # CMake variables: MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005
+ SET(AGGRESSIVE_WARNING_FLAGS "/Wall /W4")
+
+
+ ELSE(MSVC)
+ # CMake lacks an elseif, so other non-gcc, non-VS compilers need
+ # to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should
+ # remain unset.
+ ENDIF(MSVC)
+ ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+
+ # This part is for the CMake menu option to toggle the warnings on/off.
+ # This will only be made available if we set values for OSG_AGGRESSIVE_WARNING_FLAGS.
+ IF(AGGRESSIVE_WARNING_FLAGS)
+ OPTION(USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" OFF)
+ MARK_AS_ADVANCED(USE_AGGRESSIVE_WARNINGS)
+
+ IF(USE_AGGRESSIVE_WARNINGS)
+ IF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
+ SET(OLD_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE INTERNAL "Old CXX flags")
+ SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 1 CACHE INTERNAL "Old CXX flags was set")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AGGRESSIVE_WARNING_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
+ ENDIF(NOT "${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
+ ELSE(USE_AGGRESSIVE_WARNINGS)
+ # FIXME: This will lose any changes made after OLD_CMAKE_CXX_FLAGS was
+ # set. The better way would be to parse the string and remove each
+ # option explicitly.
+ IF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
+ SET(CMAKE_CXX_FLAGS "${OLD_CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
+ SET(OLD_CMAKE_CXX_FLAGS_WAS_SET 0 CACHE INTERNAL "Old CXX flags was set")
+ ENDIF("${OLD_CMAKE_CXX_FLAGS_WAS_SET}")
+ ENDIF(USE_AGGRESSIVE_WARNINGS)
+ ENDIF(AGGRESSIVE_WARNING_FLAGS)
+
+ # Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
+ # and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
+ IF(APPLE)
+ SET(CMAKE_INSTALL_NAME_DIR "@executable_path/../Frameworks")
+
+ # These are just defaults/recommendations, but how we want to build
+ # out of the box. But the user needs to be able to change these options.
+ # So we must only set the values the first time CMake is run, or we
+ # will overwrite any changes the user sets.
+ # FORCE is used because the options are not reflected in the UI otherwise.
+ # Seems like a good place to add version specific compiler flags too.
+ IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
+ # This is really fragile, but CMake doesn't provide the OS system
+ # version information we need. (Darwin versions can be changed
+ # independently of OS X versions.)
+ # It does look like CMake handles the CMAKE_OSX_SYSROOT automatically.
+ IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
+ #SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX")
+ SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for OSX")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
+ ELSE(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
+ IF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+ SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
+ ELSE(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+ # No Universal Binary support
+ # Should break down further to set the -mmacosx-version-min,
+ # but the SDK detection is too unreliable here.
+ ENDIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+ ENDIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
+ ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
+ ENDIF(APPLE)
+
+ SET(OUTPUT_BINDIR ${CMAKE_BINARY_DIR}/bin)
+ MAKE_DIRECTORY(${OUTPUT_BINDIR})
+
+ SET(OUTPUT_LIBDIR ${CMAKE_BINARY_DIR}/lib)
+ MAKE_DIRECTORY(${OUTPUT_LIBDIR})
+ IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
+ # If CMake >= 2.6.0
+ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
+ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
+ IF(WIN32)
+ SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
+ ELSE(WIN32)
+ SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
+ ENDIF(WIN32)
+ ELSE(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
+ SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
+ SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
+ ENDIF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION GREATER 4)
+
+ENDMACRO(CONFIGURE_DEFAULTS)
+
+MACRO(CONFIGURE_END)
+ # This needs to be run very last so other parts of the scripts can take
+ # advantage of this.
+ IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
+ SET(CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
+ ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
+ENDMACRO(CONFIGURE_END)
+
+MACRO(SETUP_CORELIB CORELIB_NAME)
+
+ ADD_LIBRARY(${CORELIB_NAME}
+ SHARED
+ ${HEADERS}
+ ${SOURCES}
+ )
+
+ TARGET_LINK_LIBRARIES(${CORELIB_NAME} ${LIBRARIES})
+
+ IF(LIBRARIES_OPTIMIZED)
+ FOREACH(LIBOPT ${LIBRARIES_OPTIMIZED})
+ TARGET_LINK_LIBRARIES(${CORELIB_NAME} optimized ${LIBOPT})
+ ENDFOREACH(LIBOPT)
+ ENDIF(LIBRARIES_OPTIMIZED)
+
+ IF(LIBRARIES_DEBUG)
+ FOREACH(LIBDEBUG ${LIBRARIES_DEBUG})
+ TARGET_LINK_LIBRARIES(${CORELIB_NAME} debug ${LIBDEBUG})
+ ENDFOREACH(LIBDEBUG)
+ ENDIF(LIBRARIES_DEBUG)
+
+ SET_TARGET_PROPERTIES(${CORELIB_NAME}
+ PROPERTIES
+ PROJECT_LABEL "Core ${CORELIB_NAME}"
+ )
+
+ IF(WIN32)
+ INSTALL(TARGETS ${CORELIB_NAME}
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ )
+ ELSE(WIN32)
+ INSTALL(TARGETS ${CORELIB_NAME}
+ LIBRARY DESTINATION lib
+ )
+ ENDIF(WIN32)
+
+ IF(UNIX AND NOT APPLE)
+ SET_TARGET_PROPERTIES ( ${LIB_NAME} PROPERTIES LINK_FLAGS "-Wl,-E")
+ ENDIF(UNIX AND NOT APPLE)
+
+ENDMACRO(SETUP_CORELIB)
+
+
+MACRO(SETUP_DEMO_LAUNCHER DEMO_NAME)
+
+ IF(IS_APPLICATION)
+ IF(APPLE)
+ # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${CRSFX_MAJOR_VERSION}.${CRSFX_MINOR_VERSION}.${CRSFXCRSFX_PATCH_VERSION}")
+ # Short Version is the "marketing version". It is the version
+ # the user sees in an information panel.
+ SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${CRSFX_MAJOR_VERSION}.${CRSFX_MINOR_VERSION}.${CRSFX_PATCH_VERSION}")
+ # Bundle version is the version the OS looks at.
+ SET(MACOSX_BUNDLE_BUNDLE_VERSION "${CRSFX_MAJOR_VERSION}.${CRSFX_MINOR_VERSION}.${CRSFX_PATCH_VERSION}")
+ SET(MACOSX_BUNDLE_GUI_IDENTIFIER "Mirage Technologies ${DEMO_NAME}" )
+ SET(MACOSX_BUNDLE_BUNDLE_NAME "${DEMO_NAME}" )
+ # SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns")
+ # SET(MACOSX_BUNDLE_COPYRIGHT "")
+ # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
+ SET(PLATFORM_SPECIFIC_CONTROL MACOSX_BUNDLE)
+ ENDIF(APPLE)
+
+ IF(WIN32)
+ IF (REQUIRE_WINMAIN_FLAG)
+ SET(PLATFORM_SPECIFIC_CONTROL WIN32)
+ ENDIF(REQUIRE_WINMAIN_FLAG)
+ ENDIF(WIN32)
+
+ ADD_EXECUTABLE(${DEMO_NAME} ${PLATFORM_SPECIFIC_CONTROL} ${SOURCES} ${HEADERS})
+ IF(APPLE)
+ SETUP_BUNDLE_DEPENDENCIES(${DEMO_NAME})
+ ENDIF(APPLE)
+ ELSE(IS_APPLICATION)
+ ADD_EXECUTABLE(${DEMO_NAME} ${SOURCES} ${HEADERS})
+ ENDIF(IS_APPLICATION)
+
+ TARGET_LINK_LIBRARIES(${DEMO_NAME} ${LIBRARIES})
+ IF(LIBRARIES_OPTIMIZED)
+ FOREACH(LIBOPT ${LIBRARIES_OPTIMIZED})
+ TARGET_LINK_LIBRARIES(${DEMO_NAME} optimized ${LIBOPT})
+ ENDFOREACH(LIBOPT)
+ ENDIF(LIBRARIES_OPTIMIZED)
+
+ IF(LIBRARIES_DEBUG)
+ FOREACH(LIBDEBUG ${LIBRARIES_DEBUG})
+ TARGET_LINK_LIBRARIES(${DEMO_NAME} debug ${LIBDEBUG})
+ ENDFOREACH(LIBDEBUG)
+ ENDIF(LIBRARIES_DEBUG)
+
+ SET_TARGET_PROPERTIES(${DEMO_NAME} PROPERTIES PROJECT_LABEL "Demo ${DEMO_NAME}")
+
+ IF(APPLE)
+ INSTALL(TARGETS ${DEMO_NAME}
+ RUNTIME DESTINATION bin
+ BUNDLE DESTINATION bin
+ )
+ ELSE(APPLE)
+ INSTALL(TARGETS ${DEMO_NAME}
+ RUNTIME DESTINATION bin
+ COMPONENT DESTINATION bin
+ )
+ ENDIF(APPLE)
+
+ #SETUP_DEMO_RESOURCES(${DEMO_NAME})
+
+ENDMACRO(SETUP_DEMO_LAUNCHER)
+
+MACRO(SETUP_BUNDLE_DEPENDENCIES TARGET_NAME)
+ IF(DEPENDENCY_FILES)
+ IF(APPLE AND IS_APPLICATION)
+ INSTALL(PROGRAMS ${DEPENDENCY_FILES}
+ DESTINATION bin/${TARGET_NAME}.app/Contents/Frameworks
+ )
+ ENDIF(APPLE AND IS_APPLICATION)
+ ENDIF(DEPENDENCY_FILES)
+
+ IF(LIBRARIES)
+ IF(APPLE AND IS_APPLICATION)
+ FOREACH(TARGET ${LIBRARIES})
+ GET_TARGET_PROPERTY(TARGET_LOC ${TARGET} LOCATION)
+ INSTALL(PROGRAMS ${TARGET_LOC}
+ DESTINATION bin/${TARGET_NAME}.app/Contents/Frameworks)
+ ENDFOREACH(TARGET)
+ ENDIF(APPLE AND IS_APPLICATION)
+ ENDIF(LIBRARIES)
+
+ IF(DEPENDENCY_DIRS)
+ IF(APPLE AND IS_APPLICATION)
+ INSTALL(DIRECTORY ${DEPENDENCY_DIRS}
+ DESTINATION bin/${TARGET_NAME}.app/Contents/Frameworks
+ PATTERN ".svn" EXCLUDE)
+ ENDIF(APPLE AND IS_APPLICATION)
+ ENDIF(DEPENDENCY_DIRS)
+
+ IF(RESOURCE_FILES)
+ IF(APPLE AND IS_APPLICATION)
+ INSTALL(FILES ${RESOURCE_FILES}
+ DESTINATION bin/${DEMO_NAME}.app/Contents/Resources
+ )
+ ENDIF(APPLE AND IS_APPLICATION)
+ ENDIF(RESOURCE_FILES)
+
+ IF(RESOURCE_DIRS)
+ IF(APPLE AND IS_APPLICATION)
+ INSTALL(DIRECTORY ${RESOURCE_DIRS}
+ DESTINATION bin/${DEMO_NAME}.app/Contents/Resources
+ PATTERN ".svn" EXCLUDE
+ )
+ ENDIF(APPLE AND IS_APPLICATION)
+ ENDIF(RESOURCE_DIRS)
+
+ENDMACRO(SETUP_BUNDLE_DEPENDENCIES TARGET_NAME)
+
+MACRO(SETUP_DEPENDENCIES)
+ IF(DEPENDENCY_FILES)
+ IF(WIN32)
+ INSTALL(PROGRAMS ${DEPENDENCY_FILES}
+ DESTINATION bin
+ )
+ ELSE(WIN32)
+ INSTALL(PROGRAMS ${DEPENDENCY_FILES}
+ DESTINATION lib
+ )
+ ENDIF(WIN32)
+ ENDIF(DEPENDENCY_FILES)
+
+ IF(DEPENDENCY_DIRS)
+ IF(WIN32)
+ INSTALL(DIRECTORY ${DEPENDENCY_DIRS}
+ DESTINATION bin
+ PATTERN ".svn" EXCLUDE
+ PATTERN ".cache" EXCLUDE)
+ ELSE(WIN32)
+ INSTALL(DIRECTORY ${DEPENDENCY_DIRS}
+ DESTINATION lib
+ PATTERN ".svn" EXCLUDE
+ PATTERN ".cache" EXCLUDE)
+ ENDIF(WIN32)
+ ENDIF(DEPENDENCY_DIRS)
+
+ IF(RESOURCE_FILES)
+ INSTALL(FILES ${RESOURCE_FILES}
+ DESTINATION share/${CMAKE_PROJECT_NAME}/resources
+ )
+ ENDIF(RESOURCE_FILES)
+
+ IF(RESOURCE_DIRS)
+ INSTALL(DIRECTORY ${RESOURCE_DIRS}
+ DESTINATION share/${CMAKE_PROJECT_NAME}/resources
+ PATTERN ".svn" EXCLUDE
+ )
+ ENDIF(RESOURCE_DIRS)
+
+ IF(SCRIPT_FILES)
+ INSTALL(PROGRAMS ${SCRIPT_FILES}
+ DESTINATION .
+ PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ )
+ ENDIF(SCRIPT_FILES)
+ENDMACRO(SETUP_DEPENDENCIES)
+
+MACRO(SETUP_DEMO_RESOURCES DEMO_NAME)
+ IF(RESOURCE_FILES)
+ IF(APPLE AND IS_APPLICATION)
+ INSTALL(FILES ${RESOURCE_FILES}
+ DESTINATION bin/${DEMO_NAME}.app/Contents/Resources/${DEMO_NAME}
+ )
+ ELSE(APPLE AND IS_APPLICATION)
+ INSTALL(FILES ${RESOURCE_FILES}
+ DESTINATION share/${CMAKE_PROJECT_NAME}/${DEMO_NAME}
+ )
+ ENDIF(APPLE AND IS_APPLICATION)
+ ENDIF(RESOURCE_FILES)
+
+ IF(RESOURCE_DIRS)
+ IF(APPLE AND IS_APPLICATION)
+ INSTALL(DIRECTORY ${RESOURCE_DIRS}
+ DESTINATION bin/${DEMO_NAME}.app/Contents/Resources/${DEMO_NAME}
+ PATTERN ".svn" EXCLUDE
+ )
+ ELSE(APPLE AND IS_APPLICATION)
+ INSTALL(DIRECTORY ${RESOURCE_DIRS}
+ DESTINATION share/${CMAKE_PROJECT_NAME}/${DEMO_NAME}
+ PATTERN ".svn" EXCLUDE
+ )
+ ENDIF(APPLE AND IS_APPLICATION)
+ ENDIF(RESOURCE_DIRS)
+
+ IF(SCRIPT_FILES)
+ INSTALL(PROGRAMS ${SCRIPT_FILES}
+ DESTINATION .
+ PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ )
+ ENDIF(SCRIPT_FILES)
+ENDMACRO(SETUP_DEMO_RESOURCES)
+
+MACRO(FIND_OSGPLUGIN_LIBRARY MYOSGPLUGIN MYOSGPLUGINNAME)
+
+ FIND_LIBRARY(${MYOSGPLUGIN}
+ NAMES osgdb_${MYOSGPLUGINNAME}
+ PATHS
+ $ENV{OSG_DIR}/lib
+ $ENV{OSG_DIR}
+ $ENV{OSGDIR}/lib
+ $ENV{OSGDIR}
+ $ENV{OSG_ROOT}/lib
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /usr/local/lib
+ /usr/lib
+ /sw/lib
+ /opt/local/lib
+ /opt/csw/lib
+ /opt/lib
+ [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+ /usr/freeware/lib64
+ $ENV{OSG_DIR}/lib/osgPlugins-${OSGVERSION}
+ $ENV{OSG_DIR}/bin/osgPlugins-${OSGVERSION}
+ )
+
+ FIND_LIBRARY(${MYOSGPLUGIN}_DEBUG
+ NAMES osgdb_${MYOSGPLUGINNAME}d
+ PATHS
+ $ENV{OSG_DIR}/lib
+ $ENV{OSG_DIR}
+ $ENV{OSGDIR}/lib
+ $ENV{OSGDIR}
+ $ENV{OSG_ROOT}/lib
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /usr/local/lib
+ /usr/lib
+ /sw/lib
+ /opt/local/lib
+ /opt/csw/lib
+ /opt/lib
+ [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+ /usr/freeware/lib64
+ $ENV{OSG_DIR}/lib/osgPlugins-${OSGVERSION}
+ $ENV{OSG_DIR}/bin/osgPlugins-${OSGVERSION}
+ )
+
+ IF(NOT ${MYOSGPLUGIN}_DEBUG)
+ SET(${MYOSGPLUGIN}_DEBUG ${${MYOSGPLUGIN}} CACHE FILEPATH "Forced version" FORCE)
+ ENDIF(NOT ${MYOSGPLUGIN}_DEBUG)
+
+ENDMACRO(FIND_OSGPLUGIN_LIBRARY MYOSGPLUGIN MYOSGPLUGINNAME)
+
+MACRO(BUILD_JAVA_SWIG LIB_NAME)
+ SWIG_ADD_MODULE(${LIB_NAME} java
+ ${SOURCES}
+ )
+ SWIG_LINK_LIBRARIES(${LIB_NAME}
+ ${LIBRARIES}
+ )
+
+ IF(UNIX)
+ SET_TARGET_PROPERTIES(${LIB_NAME}
+ PROPERTIES
+ PREFIX lib)
+ IF(APPLE)
+ SET_TARGET_PROPERTIES(${LIB_NAME}
+ PROPERTIES
+ SUFFIX .jnilib)
+ ENDIF(APPLE)
+ ENDIF(UNIX)
+ IF(WIN32)
+ INSTALL(TARGETS ${LIB_NAME}
+ RUNTIME DESTINATION share/crsFX/java
+ LIBRARY DESTINATION share/crsFX/java
+ )
+ ELSE(WIN32)
+ INSTALL(TARGETS ${LIB_NAME}
+ LIBRARY DESTINATION share/crsFX/java
+ )
+ ENDIF(WIN32)
+
+ INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/wrapper/java/${BIND_PROJECT}/
+ DESTINATION share/crsFX/java/src/main/java/${INSTALL_DESTINATION}
+ FILES_MATCHING PATTERN "*.java"
+ PATTERN "CMakeFiles" EXCLUDE
+ )
+
+ INSTALL(FILES ${CMAKE_SOURCE_DIR}/scripts/pom.xml
+ DESTINATION share/crsFX/java
+ )
+ENDMACRO(BUILD_JAVA_SWIG)
+
+MACRO(BUILD_PYTHON_SWIG LIB_NAME)
+ SWIG_ADD_MODULE(${LIB_NAME} python
+ ${SOURCES}
+ )
+ SWIG_LINK_LIBRARIES(${LIB_NAME}
+ ${LIBRARIES}
+ )
+ IF(WIN32)
+ INSTALL(TARGETS _${LIB_NAME}
+ RUNTIME DESTINATION share/crsFX/python
+ LIBRARY DESTINATION share/crsFX/python
+ )
+ ELSE(WIN32)
+ INSTALL(TARGETS _${LIB_NAME}
+ LIBRARY DESTINATION share/crsFX/python
+ )
+ ENDIF(WIN32)
+
+ INSTALL(DIRECTORY ${CMAKE_BINARY_DIR}/src/wrapper/python/
+ DESTINATION share/crsFX/python
+ FILES_MATCHING PATTERN "*.py"
+ PATTERN "CMakeFiles" EXCLUDE
+ )
+ENDMACRO(BUILD_PYTHON_SWIG)
+
+MACRO(BUILD_LUA_SWIG LIB_NAME)
+ SWIG_ADD_MODULE(${LIB_NAME} lua
+ ${SOURCES}
+ )
+
+ SWIG_LINK_LIBRARIES(${LIB_NAME}
+ ${LIBRARIES}
+ )
+ IF(WIN32)
+ INSTALL(TARGETS ${LIB_NAME}
+ RUNTIME DESTINATION share/crsFX/lua
+ LIBRARY DESTINATION share/crsFX/lua
+ )
+ ELSE(WIN32)
+ INSTALL(TARGETS ${LIB_NAME}
+ LIBRARY DESTINATION share/crsFX/lua
+ )
+ ENDIF(WIN32)
+
+ INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/wrapper/lua/
+ DESTINATION share/crsFX/lua
+ FILES_MATCHING PATTERN "*.lua"
+ PATTERN "CMakeFiles" EXCLUDE
+ )
+ENDMACRO(BUILD_LUA_SWIG)
+
+