Fixed several problems when createing VS project files with cmake:

1) gcc flags were used, and -Wall for irrlicht caused 1000's of
   useless warning messages.
2) Force static build of irrlicht.
3) Remove unnecessary dist target (which is unix only).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13349 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-07-25 07:19:30 +00:00
parent 2d504379ca
commit 12deb466be
2 changed files with 16 additions and 6 deletions

View File

@ -52,6 +52,7 @@ if(MSVC)
set(ENV{PATH} ${PROJECT_SOURCE_DIR}/dependencies/include)
set(ENV{LIB} ${PROJECT_SOURCE_DIR}/dependencies/lib)
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies)
add_definitions(/D_IRR_STATIC_LIB_)
endif()
if(APPLE)
@ -242,7 +243,10 @@ add_subdirectory(tools/font_tool)
# ==== Make dist target ====
add_custom_target(dist
if(MSVC)
# Don't create a dist target for VS
else()
add_custom_target(dist
COMMAND rm -rf ${CMAKE_BINARY_DIR}/SuperTuxKart-${PROJECT_VERSION} && rm -f ${CMAKE_BINARY_DIR}/SuperTuxKart-${PROJECT_VERSION}.tar.bz2
&& echo "Exporting..."
&& svn export ${PROJECT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/SuperTuxKart-${PROJECT_VERSION}
@ -251,7 +255,9 @@ add_custom_target(dist
&& tar -cjf ${CMAKE_BINARY_DIR}/SuperTuxKart-${PROJECT_VERSION}.tar.bz2 ./SuperTuxKart-${PROJECT_VERSION}
&& echo "Done, cleaning up"
&& rm -rf ${CMAKE_BINARY_DIR}/SuperTuxKart-${PROJECT_VERSION}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif()
# ==== Install target ====
install(TARGETS supertuxkart RUNTIME DESTINATION ${STK_INSTALL_BINARY_DIR} BUNDLE DESTINATION .)

View File

@ -12,10 +12,14 @@ if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch i386 -F/Library/Frameworks")
endif()
add_definitions(-Wall -pipe -fexpensive-optimizations -I/usr/X11R6/include -DIRRLICHT_EXPORTS=1 -DNDEBUG=1)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O3 -fno-exceptions -fno-rtti -fstrict-aliasing")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES")
add_definitions(-DNDEBUG=1 -DIRRLICHT_EXPORTS=1 -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES)
if(MSVC)
add_definitions(/D_IRR_STATIC_LIB_)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" /MTd)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall -pipe -O3 -fno-exceptions -fno-rtti -fstrict-aliasing -fexpensive-optimizations -I/usr/X11R6/include")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pipe -O3 -fno-exceptions -fno-rtti -fstrict-aliasing -fexpensive-optimizations -I/usr/X11R6/include")
endif()
set(IRRLICHT_SOURCES
source/Irrlicht/CTRStencilShadow.cpp