diff --git a/CMakeLists.txt b/CMakeLists.txt index c9f975109..d8d751e44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,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) @@ -244,7 +245,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} @@ -253,7 +257,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 .) diff --git a/lib/irrlicht/CMakeLists.txt b/lib/irrlicht/CMakeLists.txt index 8c3fe4f11..07d673ac0 100644 --- a/lib/irrlicht/CMakeLists.txt +++ b/lib/irrlicht/CMakeLists.txt @@ -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