[shaderz] r25 committed - CMake build working on Mac. Submitting to test on Windows.

1 view
Skip to first unread message

sha...@googlecode.com

unread,
Jun 4, 2010, 2:23:26 PM6/4/10
to shade...@googlegroups.com
Revision: 25
Author: vijay.michaeljoseph
Date: Fri Jun 4 11:22:21 2010
Log: CMake build working on Mac. Submitting to test on Windows.
http://code.google.com/p/shaderz/source/detail?r=25

Modified:
/trunk/CMakeLists.txt

=======================================
--- /trunk/CMakeLists.txt Wed Jun 2 12:05:09 2010
+++ /trunk/CMakeLists.txt Fri Jun 4 11:22:21 2010
@@ -19,52 +19,64 @@
find_package(CG REQUIRED)
find_package(OpenGL REQUIRED)

-if(WIN32)
- # get the external dependencies for OpenSceneGraph if running on windows
- message("Settingup environment for windows. Downloading of 3rd party lib
dependencies for OpenSceneGraph.")
- execute_process( COMMAND svn checkout
https://osgtoy.svn.sourceforge.net/svnroot/osgtoy/3rdParty/branches/3rdParty_win32binaries_vs80sp1/
${CMAKE_BINARY_DIR}/external/3rdParty )
-endif (WIN32)
-
-set(OpenScenegraphLibPrefix
${CMAKE_BINARY_DIR}/external/build/OpenSceneGraph/lib)
-externalproject_add(
- OpenSceneGraph
- PREFIX external/build/OpenSceneGraph
- SOURCE_DIR external/OpenSceneGraph
- BINARY_DIR external/build/OpenSceneGraph
- CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/build/OpenSceneGraph
- DOWNLOAD_DIR external/OpenSceneGraph
- DOWNLOAD_COMMAND ""
-
SVN_REPOSITORY "http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk "
- UPDATE_COMMAND svn "update" )
-
-set(osgNVLibPrefix ${CMAKE_BINARY_DIR}/external/build/osgnv/lib)
-ExternalProject_Add(
- osgnv
- DEPENDS OpenSceneGraph
- SOURCE_DIR "external/osgnv"
- BINARY_DIR external/build/osgnv
- PREFIX external/build/osgnv
- CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/build/osgnv
-DOPENSCENEGRAPH_LIB_DIR=${CMAKE_BINARY_DIR}/external/build/OpenSceneGraph/lib
-DOPENSCENEGRAPH_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/build/OpenSceneGraph/include
- DOWNLOAD_COMMAND ""
- SVN_REPOSITORY "https://osgnv.svn.sourceforge.net/svnroot/osgnv"
- UPDATE_COMMAND svn "update"
- )
-
-
+option( DOWNLOAD_AND_BUILD_DEPENDENCIES "Download+Build OpenSceneGraph and
osgnv source code using svn" false )
+if(DOWNLOAD_AND_BUILD_DEPENDENCIES)
+ # 3rd party libs required on windows
+ if(WIN32)
+ # get the external dependencies for OpenSceneGraph if running on windows
+ message("Settingup environment for windows. Downloading of 3rd party lib
dependencies for OpenSceneGraph.")
+ execute_process( COMMAND
+ svn checkout
+
https://osgtoy.svn.sourceforge.net/svnroot/osgtoy/3rdParty/branches/3rdParty_win32binaries_vs80sp1/
+ ${CMAKE_SOURCE_DIR}/external/3rdParty )
+ set(OSG_WIN ${CMAKE_SOURCE_DIR}/external/3rdParty )
+ endif (WIN32)
+
+ set(OpenSceneGraph_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/external/build/OpenSceneGraph/include)
+ set(OpenSceneGraph_LIBRARIES
${CMAKE_SOURCE_DIR}/external/build/OpenSceneGraph/lib ${OSG_WIN} )
+ externalproject_add(
+ OpenSceneGraph
+ PREFIX ${CMAKE_SOURCE_DIR}/external/build/OpenSceneGraph
+ SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/OpenSceneGraph
+ BINARY_DIR ${CMAKE_SOURCE_DIR}/external/build/OpenSceneGraph/build
+ CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/external/build/OpenSceneGraph
+ DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/external/build/OpenSceneGraph
+ DOWNLOAD_COMMAND svn checkout
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk
${CMAKE_SOURCE_DIR}/external/OpenSceneGraph
+
SVN_REPOSITORY "http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk "
+ UPDATE_COMMAND svn "update" )
+
+ set(osgnv_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/external/build/osgnv/include)
+ set(osgnv_LIBRARIES ${CMAKE_SOURCE_DIR}/external/build/osgnv/lib)
+ ExternalProject_Add(
+ osgnv
+ DEPENDS OpenSceneGraph
+ SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/osgnv
+ BINARY_DIR ${CMAKE_SOURCE_DIR}/external/build/osgnv/build
+ PREFIX ${CMAKE_SOURCE_DIR}/external/build/osgnv
+ DOWNLOAD_COMMAND svn checkout
https://osgnv.svn.sourceforge.net/svnroot/osgnv
${CMAKE_SOURCE_DIR}/external/osgnv
+ SVN_REPOSITORY "https://osgnv.svn.sourceforge.net/svnroot/osgnv"
+ UPDATE_COMMAND svn "update"
+ CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/external/build/osgnv
+
-DOPENSCENEGRAPH_LIB_DIR=${CMAKE_SOURCE_DIR}/external/build/OpenSceneGraph/lib
+
-DOPENSCENEGRAPH_INCLUDE_DIR=${CMAKE_SOURCE_DIR}/external/build/OpenSceneGraph/include
+ )
+else()
+ find_package(OpenSceneGraph REQUIRED)
+ find_package(osgnv REQUIRED)
+endif (DOWNLOAD_AND_BUILD_DEPENDENCIES)
+
+#############################################
+############## build shaderz ################
+#############################################
# set the include path to new build of OpenSceneGraph, osgnv, cg, opengl
and shaderz/include
INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}/external/build/OpenSceneGraph/include
- ${CMAKE_BINARY_DIR}/external/build/osgnv/include
+ ${OpenSceneGraph_INCLUDE_DIRS}
+ ${osgnv_INCLUDE_DIRS}
${Cg_INCLUDE_DIRS}
${OpenGL_INCLUDE_DIRS}
include )

-link_directories(
- ${OpenScenegraphLibPrefix}
- ${osgNVLibPrefix} )
-
-
# setup for compiling shaderz
SET( SOURCES
src/main.cpp
@@ -106,11 +118,13 @@
ui/shmaterialeditordialog.ui)


-# submit to qt to process files
+# use qt wrappers to process files
qt4_wrap_ui(GENERATED_SOURCES ${FORMS})
qt4_wrap_cpp(GENERATED_SOURCES ${MOCS})


+link_directories( ${OpenSceneGraph_LIBRARIES}
+ ${osgnv_LIBRARIES})

add_executable(
shaderz
@@ -123,9 +137,9 @@

target_link_libraries(
shaderz
- ${QT_LIBRARIES}
- osg osgDB osgUtil osgGA osgViewer osgText OpenThreads
- osgNVCg osgNV osgNVExt
+ ${QT_LIBRARIES}
+ osg osgDB osgUtil osgGA osgViewer osgText osgNVCg osgNV osgNVExt
OpenThreads
+ osgNV
${Cg_LIBRARIES}
${OpenGL_LIBRARIES}
)

Reply all
Reply to author
Forward
0 new messages