From: <he...@us...> - 2009-03-07 08:14:42
|
Revision: 54 http://simspark.svn.sourceforge.net/simspark/?rev=54&view=rev Author: hedayat Date: 2009-03-07 08:14:16 +0000 (Sat, 07 Mar 2009) Log Message: ----------- Improve Windows support: now you can build simspark in Windows, and create installers on it :) Modified Paths: -------------- trunk/spark/CMakeLists.txt trunk/spark/ChangeLog trunk/spark/cmake/FindODE.cmake trunk/spark/lib/kerosin/CMakeLists.txt trunk/spark/lib/oxygen/CMakeLists.txt trunk/spark/lib/salt/CMakeLists.txt trunk/spark/lib/zeitgeist/CMakeLists.txt trunk/spark/plugin/CMakeLists.txt trunk/spark/plugin/filesystemzip/CMakeLists.txt trunk/spark/plugin/imageperceptor/CMakeLists.txt trunk/spark/spark/CMakeLists.txt trunk/spark/test/CMakeLists.txt trunk/spark/test/scenetest/CMakeLists.txt trunk/spark/utility/rcssnet/CMakeLists.txt trunk/spark/utility/tinyxml/CMakeLists.txt Removed Paths: ------------- trunk/spark/cmake/FindSDL.cmake trunk/spark/windows/sparkconfig.h Modified: trunk/spark/CMakeLists.txt =================================================================== --- trunk/spark/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -36,8 +36,9 @@ endif (NOT USE_COREFOUNDATION STREQUAL "OFF") set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) +set(ENV{SDLDIR} C:/library/SDL/ "C:/Program Files/SDL/" C:/SDL/) + if(WIN32) - find_package(zlib REQUIRED) set(Boost_USE_STATIC_LIBS ON) endif(WIN32) find_package(Ruby REQUIRED) @@ -49,6 +50,7 @@ find_package(OpenGL REQUIRED) find_package(SDL REQUIRED) find_package(FMOD) +find_package(ZLIB) set(HAVE_IL_IL_H 1) set(HAVE_KEROSIN_KEROSIN_H 1) @@ -115,6 +117,9 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(${Boost_INCLUDE_DIRS} ${ODE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/windows/include) + set(BUILD_SHARED_LIBS FALSE) +else(WIN32) + set(BUILD_SHARED_LIBS TRUE) endif(WIN32) ########## library version numbers ########## Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/ChangeLog 2009-03-07 08:14:16 UTC (rev 54) @@ -1,3 +1,29 @@ +2009-03-07 Hedayat Vatankhah <he...@gr...> + + * test/scenetest/CMakeLists.txt: + - exclude from build in Windows + + * test/CMakeLists.txt: + * plugin/CMakeLists.txt: + - fixed for Windows compatibility + - add Boost library dir to link directories + + * cmake/FindODE.cmake: + - add search paths for latest ode release (ode-0.11) + + * plugin/filesystemzip/CMakeLists.txt: + - build only if zlib is available + + * spark/CMakeLists.txt: + * lib/zeitgeist/CMakeLists.txt: + * lib/salt/CMakeLists.txt: + * lib/oxygen/CMakeLists.txt: + * lib/kerosin/CMakeLists.txt: + * utility/tinyxml/CMakeLists.txt: + * utility/rcssnet/CMakeLists.txt: + * CMakeLists.txt: + - Do not build shared libraries on windows for now + 2009-02-17 Marian Buchta <mar...@gm...> * CMakeLists.txt Modified: trunk/spark/cmake/FindODE.cmake =================================================================== --- trunk/spark/cmake/FindODE.cmake 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/cmake/FindODE.cmake 2009-03-07 08:14:16 UTC (rev 54) @@ -17,15 +17,19 @@ C:/ode/include ) FIND_LIBRARY(ODE_LIBRARY - NAMES ode + NAMES ode ode_double ode_single PATHS /usr/lib /usr/lib64 /usr/local/lib $ENV{OGRE_HOME}/lib # OGRE SDK on WIN32 - C:/library/ode/lib/releaselib - "C:/Program Files/ode/lib/releaselib" - C:/ode/lib/releaselib + C:/library/ode/lib/ + "C:/Program Files/ode/lib/" + C:/ode/lib/ + PATH_SUFFIXES + releaselib + ReleaseDoubleDLL ReleaseDoubleLib + ReleaseSingleDLL ReleaseSingleLib ) IF(ODE_INCLUDE_DIR) Deleted: trunk/spark/cmake/FindSDL.cmake =================================================================== --- trunk/spark/cmake/FindSDL.cmake 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/cmake/FindSDL.cmake 2009-03-07 08:14:16 UTC (rev 54) @@ -1,185 +0,0 @@ -# Locate SDL library -# This module defines -# SDL_LIBRARY, the name of the library to link against -# SDL_FOUND, if false, do not try to link to SDL -# SDL_INCLUDE_DIR, where to find SDL.h -# -# This module responds to the the flag: -# SDL_BUILDING_LIBRARY -# If this is defined, then no SDL_main will be linked in because -# only applications need main(). -# Otherwise, it is assumed you are building an application and this -# module will attempt to locate and set the the proper link flags -# as part of the returned SDL_LIBRARY variable. -# -# Don't forget to include SDLmain.h and SDLmain.m your project for the -# OS X framework based version. (Other versions link to -lSDLmain which -# this module will try to find on your behalf.) Also for OS X, this -# module will automatically add the -framework Cocoa on your behalf. -# -# -# Additional Note: If you see an empty SDL_LIBRARY_TEMP in your configuration -# and no SDL_LIBRARY, it means CMake did not find your SDL library -# (SDL.dll, libsdl.so, SDL.framework, etc). -# Set SDL_LIBRARY_TEMP to point to your SDL library, and configure again. -# Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this value -# as appropriate. These values are used to generate the final SDL_LIBRARY -# variable, but when these values are unset, SDL_LIBRARY does not get created. -# -# -# $SDLDIR is an environment variable that would -# correspond to the ./configure --prefix=$SDLDIR -# used in building SDL. -# l.e.galup 9-20-02 -# -# Modified by Eric Wing. -# Added code to assist with automated building by using environmental variables -# and providing a more controlled/consistent search behavior. -# Added new modifications to recognize OS X frameworks and -# additional Unix paths (FreeBSD, etc). -# Also corrected the header search path to follow "proper" SDL guidelines. -# Added a search for SDLmain which is needed by some platforms. -# Added a search for threads which is needed by some platforms. -# Added needed compile switches for MinGW. -# -# On OSX, this will prefer the Framework version (if found) over others. -# People will have to manually change the cache values of -# SDL_LIBRARY to override this selection or set the CMake environment -# CMAKE_INCLUDE_PATH to modify the search paths. -# -# Note that the header path has changed from SDL/SDL.h to just SDL.h -# This needed to change because "proper" SDL convention -# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability -# reasons because not all systems place things in SDL/ (see FreeBSD). - -FIND_PATH(SDL_INCLUDE_DIR SDL.h - HINTS - $ENV{SDLDIR} - PATH_SUFFIXES include - PATHS - ~/Library/Frameworks - /Library/Frameworks - /usr/local/include/SDL - /usr/include/SDL - /usr/local/include/SDL12 - /usr/local/include/SDL11 # FreeBSD ports - /usr/include/SDL12 - /usr/include/SDL11 - /usr/local/include - /usr/include - /sw/include/SDL # Fink - /sw/include - /opt/local/include/SDL # DarwinPorts - /opt/local/include - /opt/csw/include/SDL # Blastwave - /opt/csw/include - /opt/include/SDL - /opt/include - C:/library/SDL/include - "C:/Program Files/SDL/include" - C:/SDL/include -) -#MESSAGE("SDL_INCLUDE_DIR is ${SDL_INCLUDE_DIR}") - -# SDL-1.1 is the name used by FreeBSD ports... -# don't confuse it for the version number. -FIND_LIBRARY(SDL_LIBRARY_TEMP - NAMES SDL SDL-1.1 - HINTS - $ENV{SDLDIR} - PATH_SUFFIXES lib64 lib - PATHS - /usr/local - /usr - /sw - /opt/local - /opt/csw - /opt - C:/library/SDL/lib - "C:/Program Files/SDL/lib" - C:/SDL/lib -) - -#MESSAGE("SDL_LIBRARY_TEMP is ${SDL_LIBRARY_TEMP}") - -IF(NOT SDL_BUILDING_LIBRARY) - IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") - # Non-OS X framework versions expect you to also dynamically link to - # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms - # seem to provide SDLmain for compatibility even though they don't - # necessarily need it. - FIND_LIBRARY(SDLMAIN_LIBRARY - NAMES SDLmain SDLmain-1.1 - HINTS - $ENV{SDLDIR} - PATH_SUFFIXES lib64 lib - PATHS - /usr/local - /usr - /sw - /opt/local - /opt/csw - /opt - C:/library/SDL/lib - "C:/Program Files/SDL/lib" - C:/SDL/lib - ) - ENDIF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") -ENDIF(NOT SDL_BUILDING_LIBRARY) - -# SDL may require threads on your system. -# The Apple build may not need an explicit flag because one of the -# frameworks may already provide it. -# But for non-OSX systems, I will use the CMake Threads package. -IF(NOT APPLE) - FIND_PACKAGE(Threads) -ENDIF(NOT APPLE) - -# MinGW needs an additional library, mwindows -# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows -# (Actually on second look, I think it only needs one of the m* libraries.) -IF(MINGW) - SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") -ENDIF(MINGW) - -SET(SDL_FOUND "NO") -IF(SDL_LIBRARY_TEMP) - # For SDLmain - IF(NOT SDL_BUILDING_LIBRARY) - IF(SDLMAIN_LIBRARY) - SET(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP}) - ENDIF(SDLMAIN_LIBRARY) - ENDIF(NOT SDL_BUILDING_LIBRARY) - - # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa. - # CMake doesn't display the -framework Cocoa string in the UI even - # though it actually is there if I modify a pre-used variable. - # I think it has something to do with the CACHE STRING. - # So I use a temporary variable until the end so I can set the - # "real" variable in one-shot. - IF(APPLE) - SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa") - ENDIF(APPLE) - - # For threads, as mentioned Apple doesn't need this. - # In fact, there seems to be a problem if I used the Threads package - # and try using this line, so I'm just skipping it entirely for OS X. - IF(NOT APPLE) - SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) - ENDIF(NOT APPLE) - - # For MinGW library - IF(MINGW) - SET(SDL_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL_LIBRARY_TEMP}) - ENDIF(MINGW) - - # Set the final string here so the GUI reflects the final state. - SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") - # Set the temp variable to INTERNAL so it is not seen in the CMake GUI - SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "") - - SET(SDL_FOUND "YES") -ENDIF(SDL_LIBRARY_TEMP) - -#MESSAGE("SDL_LIBRARY is ${SDL_LIBRARY}") - Modified: trunk/spark/lib/kerosin/CMakeLists.txt =================================================================== --- trunk/spark/lib/kerosin/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/lib/kerosin/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -118,7 +118,7 @@ include_directories(${CMAKE_SOURCE_DIR}/lib ${FREETYPE_INCLUDE_DIRS} ${DevIL_INCLUDE_DIR} ${SDL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) -add_library(kerosin SHARED ${kerosin_LIB_SRCS} ${kerosin_LIB_HDRS}) +add_library(kerosin ${kerosin_LIB_SRCS} ${kerosin_LIB_HDRS}) target_link_libraries(kerosin ${FREETYPE_LIBRARIES} ${DevIL_LIBRARIES} ${SDL_LIBRARY} ${OPENGL_LIBRARIES} ${kerosin_require_libs}) Modified: trunk/spark/lib/oxygen/CMakeLists.txt =================================================================== --- trunk/spark/lib/oxygen/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/lib/oxygen/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -219,7 +219,7 @@ include_directories(${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/utility/) -add_library(oxygen SHARED ${oxygen_LIB_SRCS} ${oxygen_LIB_HDRS}) +add_library(oxygen ${oxygen_LIB_SRCS} ${oxygen_LIB_HDRS}) target_link_libraries(oxygen rcssnet3D ${Boost_LIBRARIES} ${ODE_LIBRARY} ${oxygen_require_libs}) Modified: trunk/spark/lib/salt/CMakeLists.txt =================================================================== --- trunk/spark/lib/salt/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/lib/salt/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -26,7 +26,7 @@ sharedlibrary.cpp ) -add_library(salt SHARED ${salt_LIB_SRCS} ${salt_LIB_HDRS}) +add_library(salt ${salt_LIB_SRCS} ${salt_LIB_HDRS}) target_link_libraries(salt libobject ${salt_require_libs}) Modified: trunk/spark/lib/zeitgeist/CMakeLists.txt =================================================================== --- trunk/spark/lib/zeitgeist/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/lib/zeitgeist/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -56,7 +56,7 @@ include_directories(${CMAKE_SOURCE_DIR}/lib ${RUBY_INCLUDE_PATH}) -add_library(zeitgeist SHARED ${zeitgeist_LIB_SRCS} ${zeitgeist_LIB_HDRS}) +add_library(zeitgeist ${zeitgeist_LIB_SRCS} ${zeitgeist_LIB_HDRS}) target_link_libraries(zeitgeist ${RUBY_LIBRARY} ${zeitgeist_require_libs}) Modified: trunk/spark/plugin/CMakeLists.txt =================================================================== --- trunk/spark/plugin/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/plugin/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -1,13 +1,11 @@ include_directories(${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/utility - ${Boost_INCLUDE_DIRS} ${ODE_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) + ${Boost_INCLUDE_DIRS} ${ODE_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) +link_directories(${Boost_LIBRARY_DIRS}) -if (APPLE) - if (USE_COREFOUNDATION) - set(spark_libs kerosin oxygen zeitgeist salt /System/Library/Frameworks/CoreFoundation.framework) - else (USE_COREFOUNDATION) - set(spark_libs kerosin oxygen zeitgeist salt) - endif (USE_COREFOUNDATION) -endif (APPLE) +set(spark_libs kerosin oxygen zeitgeist salt) +if (APPLE AND USE_COREFOUNDATION) + set(spark_libs ${spark_libs} /System/Library/Frameworks/CoreFoundation.framework) +endif (APPLE AND USE_COREFOUNDATION) add_subdirectory(filesystemstd) add_subdirectory(filesystemzip) Modified: trunk/spark/plugin/filesystemzip/CMakeLists.txt =================================================================== --- trunk/spark/plugin/filesystemzip/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/plugin/filesystemzip/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -8,15 +8,14 @@ filesystemzip_c.cpp ) -if (Boost_REGEX_FOUND) +if (Boost_REGEX_FOUND AND ZLIB_FOUND) add_library(filesystemzip MODULE ${filesystemzip_LIB_SRCS}) - if(WIN32) - include_directories(${ZLIB_INCLUDE_DIR}) - endif(WIN32) + include_directories(${ZLIB_INCLUDE_DIR}) - target_link_libraries(filesystemzip ${Boost_REGEX_LIBRARY} ${spark_libs} z) + target_link_libraries(filesystemzip ${Boost_REGEX_LIBRARY} + ${spark_libs} ${ZLIB_LIBRARIES}) set_target_properties(filesystemzip PROPERTIES VERSION 0.0.0 SOVERSION 0) install(TARGETS filesystemzip DESTINATION ${LIBDIR}/${CMAKE_PROJECT_NAME}) -endif (Boost_REGEX_FOUND) +endif (Boost_REGEX_FOUND AND ZLIB_FOUND) Modified: trunk/spark/plugin/imageperceptor/CMakeLists.txt =================================================================== --- trunk/spark/plugin/imageperceptor/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/plugin/imageperceptor/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -10,7 +10,7 @@ add_library(imageperceptor MODULE ${imageperceptor_LIB_SRCS}) -target_link_libraries(imageperceptor ${spark_libs}) +target_link_libraries(imageperceptor ${spark_libs} ${Boost_LIBRARIES}) set_target_properties(imageperceptor PROPERTIES VERSION 0.0.0 SOVERSION 0) if (NOT APPLE) Modified: trunk/spark/spark/CMakeLists.txt =================================================================== --- trunk/spark/spark/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/spark/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -8,7 +8,7 @@ include_directories(${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/utility ${FREETYPE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ODE_INCLUDE_DIR} ${DevIL_INCLUDE_DIR}) -add_library(spark SHARED ${spark_LIB_SRCS}) +add_library(spark ${spark_LIB_SRCS}) target_link_libraries(spark salt zeitgeist oxygen kerosin) Modified: trunk/spark/test/CMakeLists.txt =================================================================== --- trunk/spark/test/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/test/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -1,6 +1,8 @@ include_directories(${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/utility ${Boost_INCLUDE_DIRS} ${ODE_INCLUDE_DIR}) +link_directories(${Boost_LIBRARY_DIRS}) + add_subdirectory(coretest) add_subdirectory(fonttest) add_subdirectory(inputtest) Modified: trunk/spark/test/scenetest/CMakeLists.txt =================================================================== --- trunk/spark/test/scenetest/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/test/scenetest/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -11,11 +11,12 @@ include_directories(${SDL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${DevIL_INCLUDE_DIR}) -add_executable(scenetest ${scenetest_SRCS}) +if (NOT WIN32) + add_executable(scenetest ${scenetest_SRCS}) + target_link_libraries(scenetest salt zeitgeist oxygen kerosin) +endif (NOT WIN32) -target_link_libraries(scenetest salt zeitgeist oxygen kerosin) - ########### install files ############### Modified: trunk/spark/utility/rcssnet/CMakeLists.txt =================================================================== --- trunk/spark/utility/rcssnet/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/utility/rcssnet/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -21,7 +21,7 @@ udpsocket.cpp ) -add_library(rcssnet3D SHARED ${rcssnet3D_LIB_SRCS} ${rcssnet3D_LIB_HDRS}) +add_library(rcssnet3D ${rcssnet3D_LIB_SRCS} ${rcssnet3D_LIB_HDRS}) if(WIN32) target_link_libraries(rcssnet3D ${NET_LIBS} WS2_32.lib) Modified: trunk/spark/utility/tinyxml/CMakeLists.txt =================================================================== --- trunk/spark/utility/tinyxml/CMakeLists.txt 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/utility/tinyxml/CMakeLists.txt 2009-03-07 08:14:16 UTC (rev 54) @@ -11,7 +11,7 @@ xmlfunctions.h ) -add_library(tinyxml_ex SHARED ${tinyxml_ex_LIB_SRCS}) +add_library(tinyxml_ex ${tinyxml_ex_LIB_SRCS}) target_link_libraries(tinyxml_ex) Deleted: trunk/spark/windows/sparkconfig.h =================================================================== --- trunk/spark/windows/sparkconfig.h 2009-03-05 20:10:36 UTC (rev 53) +++ trunk/spark/windows/sparkconfig.h 2009-03-07 08:14:16 UTC (rev 54) @@ -1,11 +0,0 @@ -/** this is a static (i.e. not auto generated) win32 specific - configuration file -*/ -#define HAVE_KEROSIN_KEROSIN_H 1 - -#define PACKAGE_NAME "simspark" - -#define HAVE_WINSOCK2_H 1 -#define HAVE_SOCKET 1 -#define HAVE_SOCKETTYPE 1 -#define HAVE_IL_IL_H 1 \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |