diff --git a/CMakeLists.txt b/CMakeLists.txt index 8eb0c6f61..54862cc3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,8 @@ include_directories("${STK_SOURCE_DIR}/enet/include") # Build the Wiiuse library if(USE_WIIUSE) - add_subdirectory("${STK_SOURCE_DIR}/wiiuse") - include_directories("${STK_SOURCE_DIR}/wiiuse") + add_subdirectory("${STK_SOURCE_DIR}/wiiuse") + include_directories("${STK_SOURCE_DIR}/wiiuse") endif() # Set include paths @@ -42,9 +42,9 @@ include_directories(${IRRLICHT_INCLUDE_DIRS}) # OpenAL if(MSVC) - find_library(OPENAL_LIBRARY OpenAL32 REQUIRED PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") + find_library(OPENAL_LIBRARY OpenAL32 REQUIRED PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") else() - find_package(OpenAL REQUIRED) + find_package(OpenAL REQUIRED) endif() include_directories(${OPENAL_INCLUDE_DIR}) @@ -52,14 +52,13 @@ include_directories(${OPENAL_INCLUDE_DIR}) find_package(OggVorbis REQUIRED) include_directories(${OGGVORBIS_INCLUDE_DIRS}) - # CURL if(CYGWIN) - find_package(CURL REQUIRED) + find_package(CURL REQUIRED) elseif(WIN32) - find_library(CURL_LIBRARIES curl libcurl_imp REQUIRED PATHS ${PROJECT_SOURCE_DIR}/dependencies/lib) + find_library(CURL_LIBRARIES curl libcurl_imp REQUIRED PATHS ${PROJECT_SOURCE_DIR}/dependencies/lib) else() - find_package(CURL REQUIRED) + find_package(CURL REQUIRED) endif() include_directories(${CURL_INCLUDE_DIRS}) @@ -78,24 +77,24 @@ endif() # Set some compiler options if(UNIX) - add_definitions(-Wall) + add_definitions(-Wall) endif() if(WIN32) # By default windows.h has macros defined for min and max that screw up everything add_definitions(-DNOMINMAX) - - # And shut up about unsafe stuff - add_definitions(-D_CRT_SECURE_NO_WARNINGS) + + # And shut up about unsafe stuff + add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() # TODO: remove this switch add_definitions(-DHAVE_OGGVORBIS) if(CMAKE_BUILD_TYPE MATCHES Debug) - add_definitions(-DDEBUG) + add_definitions(-DDEBUG) else() - add_definitions(-DNDEBUG) + add_definitions(-DNDEBUG) endif() @@ -112,27 +111,27 @@ if(APPLE) set(OSX_ICON_FILES ${PROJECT_SOURCE_DIR}/src/ide/Xcode/stk.icns) set_source_files_properties(${OSX_ICON_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set(STK_SOURCES ${STK_SOURCES} ${OSX_ICON_FILES}) - + # build the executable and create an app bundle add_executable(supertuxkart MACOSX_BUNDLE ${STK_SOURCES}) - + find_library(IOKIT_LIBRARY IOKit) find_library(QUICKTIME_LIBRARY QuickTime) find_library(CARBON_LIBRARY Carbon) find_library(AUDIOUNIT_LIBRARY AudioUnit) find_library(COCOA_LIBRARY Cocoa) - + target_link_libraries(supertuxkart ${IOKIT_LIBRARY} ${QUICKTIME_LIBRARY} ${CARBON_LIBRARY} ${AUDIOUNIT_LIBRARY} ${COCOA_LIBRARY}) - + # configure CMake to use a custom Info.plist set_target_properties(supertuxkart PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/src/ide/Xcode/SuperTuxKart-Info.plist) - + add_custom_command(TARGET supertuxkart PRE_BUILD COMMAND ln -s ${PROJECT_SOURCE_DIR}/data ${CMAKE_BINARY_DIR}/bin/supertuxkart.app/Contents/Resources) else() @@ -164,18 +163,18 @@ if(USE_FRIBIDI) endif() if(USE_WIIUSE) - target_link_libraries(supertuxkart wiiuse bluetooth) - add_definitions(-DENABLE_WIIUSE) + target_link_libraries(supertuxkart wiiuse bluetooth) + add_definitions(-DENABLE_WIIUSE) endif() if(WIN32) if(CYGWIN) - find_library(PTHREAD_LIBRARY NAMES pthread PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") - target_link_libraries(supertuxkart ${PTHREAD_LIBRARY}) - else() - find_library(PTHREAD_LIBRARY NAMES pthreadVC2 PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") - target_link_libraries(supertuxkart ${PTHREAD_LIBRARY}) - endif() + find_library(PTHREAD_LIBRARY NAMES pthread PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") + target_link_libraries(supertuxkart ${PTHREAD_LIBRARY}) + else() + find_library(PTHREAD_LIBRARY NAMES pthreadVC2 PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") + target_link_libraries(supertuxkart ${PTHREAD_LIBRARY}) + endif() endif() # Optional tools diff --git a/tools/font_tool/CMakeLists.txt b/tools/font_tool/CMakeLists.txt index faebf15dd..691dbe458 100644 --- a/tools/font_tool/CMakeLists.txt +++ b/tools/font_tool/CMakeLists.txt @@ -3,18 +3,18 @@ option(FONT_TOOL "Compile font tool" OFF) if(FONT_TOOL) find_package(Freetype) find_package(X11) - find_library(FONTCONFIG_LIBRARY fontconfig) + find_library(FONTCONFIG_LIBRARY fontconfig) if(FREETYPE_FOUND) - include_directories(${FREETYPE_INCLUDE_DIRS}) - add_executable(font_tool CFontTool.cpp main.cpp) - target_link_libraries(font_tool ${FREETYPE_LIBRARIES}) - target_link_libraries(font_tool ${X11_Xft_LIB} Xxf86vm) - target_link_libraries(font_tool ${OPENGL_LIBRARIES}) - target_link_libraries(font_tool ${IRRLICHT_LIBRARIES}) - target_link_libraries(font_tool ${FONTCONFIG_LIBRARY}) + include_directories(${FREETYPE_INCLUDE_DIRS}) + add_executable(font_tool CFontTool.cpp main.cpp) + target_link_libraries(font_tool ${FREETYPE_LIBRARIES}) + target_link_libraries(font_tool ${X11_Xft_LIB} Xxf86vm) + target_link_libraries(font_tool ${OPENGL_LIBRARIES}) + target_link_libraries(font_tool ${IRRLICHT_LIBRARIES}) + target_link_libraries(font_tool ${FONTCONFIG_LIBRARY}) else() - message(STATUS "Freetype was not found, the font tool won't be built (only useful for developers)") + message(STATUS "Freetype was not found, the font tool won't be built (only useful for developers)") endif() else() message(STATUS "Font tool deactivated, the font tool won't be built (only useful for developers)")