Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - naraku9333

Pages: [1]
1
General / SFML and cmake
« on: September 14, 2013, 07:38:31 pm »
Hello, I am re-writing a CMakeLists.txt file for a project to use FindSFML.cmake and am having problems. The project builds fine but fails linking when static build is selected. I know it isn't a problem with the libs, I've linked to them without issue with the old CMakeLists.txt.

I would really appreciate if someone could point out what I am doing wrong or give me some suggestions. Here is my current attempt.
# ChessPlusPlus
#
# Configuration options:
# -DCMAKE_BUILD_TYPE=Release|Debug
# -DSTATIC_BUILD=1|0

cmake_minimum_required (VERSION 2.8)

project (CHESSPP)

if(WIN32)
    set(SFML_ROOT "" CACHE PATH "Path to SFML root directory")
    option(STATIC_BUILD OFF "Link statically")    
endif()

if(NOT JSONLIB)
    set(JSONLIB ${CHESSPP_SOURCE_DIR}/lib/json-parser)
endif()
if(NOT BOOSTLIB)
    set(BOOSTLIB ${CHESSPP_SOURCE_DIR}/lib/boost)
endif()

include_directories (${JSONLIB})
include_directories (${BOOSTLIB})

file(GLOB_RECURSE CHESSPP_SOURCES "src/*.cpp")
file(GLOB_RECURSE CHESSPP_HEADERS "src/*.hpp")
list(APPEND CHESSPP_SOURCES "lib/json-parser/json.c")

set (CHESSPP_INCLUDE_DIRS "")
foreach (_headerFile ${CHESSPP_HEADERS})
    get_filename_component(_dir ${_headerFile} PATH)
    list (APPEND CHESSPP_INCLUDE_DIRS ${_dir})
endforeach()
list(REMOVE_DUPLICATES CHESSPP_INCLUDE_DIRS)
include_directories(${CHESSPP_INCLUDE_DIRS})

list(APPEND CMAKE_CXX_FLAGS "-std=c++11")
 
# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
if(STATIC_BUILD)
        set(SFML_STATIC_LIBRARIES TRUE)
endif()
find_package(SFML 2 REQUIRED system window graphics network audio)
include_directories (${SFML_INCLUDE_DIR})
link_directories(${SFML_ROOT}/lib)
add_executable (chesspp ${CHESSPP_SOURCES})
target_link_libraries(chesspp ${SFML_LIBRARIES} boost_system boost_filesystem)
 

2
General discussions / SFML Project Wizard for Visual Studio 2010
« on: May 30, 2012, 06:27:38 pm »
I made a custom wizard for VS2010 which creates a console project with the correct compile and linker settings for an SFML project. The wizard then adds a simple source file and image to test the install, create the project and press F5. It also copies the required  dll's into the output directory so manually copying the sfml or libsnd/openal dlls is unnecessary.

Project wizard requires the path to SFML root directory and gives choice of dynamic or static linkage. The project is located at http://code.google.com/p/sfml-project-wizard/ there is an msi installer under downloads.

I used the Ogre project wizard ( http://bitbucket.org/jacmoe/ogreappwizards ) as a guide to make this, primarily the JScript which I was completely unfamiliar with. I'm also not good with html so the wizard UI needs work. I do plan to add functionality to the wizard (choice of empty project, windows project, etc...) recommendations and any feedback in general is appreciated.

This was my first attempt at a custom wizard and making an installer package so they are far from perfect. I tested the install on a non-development system, and the entire process was pretty easy. Install VC++ express, download and extract SFML2 VS2010 package, install the wizard, create project and compile. I'm just hoping it goes that smoothly on other users systems.

Any/all feedback is greatly appreciated.

Pages: [1]