Ok
lolz123!
**************************************************************************************
First:
(building with mingw-builds gcc 4.9.2 sjlj)
cmake -G 'MSYS Makefiles' -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_LOCAL -D SFML_ROOT=$DIRECTORIO_LOCAL ../..
[...]
-- Detecting CXX compile features - done
-- Found SFML 2.2 in v:/MinGW-Builds/mingw32/msys/local/include
CMake Error at CMakeLists.txt:14 (target_link_libraries):
Cannot specify link libraries for target "LTBL2" which is not built by this
project.-----------
(building with msvc 18.0.31101.0 )
cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA -D SFML_ROOT=$DIRECTORIO_INSTALACION/SFML ../..
-- Found SFML 2.2 in w:/Archivos_de_programa/MSVC2013/x32/SFML/include
CMake Error at CMakeLists.txt:14 (target_link_libraries):
Cannot specify link libraries for target "LTBL2" which is not built by this
project. ------
It requires to add_library. I had to modify the CMakeLists.txt file:
set( SOURCE_PATH "${PROJECT_SOURCE_DIR}/source" )
set( SOURCES
"${SOURCE_PATH}/ltbl/Math.h"
"${SOURCE_PATH}/ltbl/Math.cpp"
"${SOURCE_PATH}/ltbl/lighting/LightDirectionEmission.cpp"
"${SOURCE_PATH}/ltbl/lighting/LightDirectionEmission.h"
"${SOURCE_PATH}/ltbl/lighting/LightPointEmission.cpp"
"${SOURCE_PATH}/ltbl/lighting/LightPointEmission.h"
"${SOURCE_PATH}/ltbl/lighting/LightShape.cpp"
"${SOURCE_PATH}/ltbl/lighting/LightShape.h"
"${SOURCE_PATH}/ltbl/lighting/LightSystem.cpp"
"${SOURCE_PATH}/ltbl/lighting/LightSystem.h"
"${SOURCE_PATH}/ltbl/quadtree/DynamicQuadtree.cpp"
"${SOURCE_PATH}/ltbl/quadtree/DynamicQuadtree.h"
"${SOURCE_PATH}/ltbl/quadtree/Quadtree.cpp"
"${SOURCE_PATH}/ltbl/quadtree/Quadtree.h"
"${SOURCE_PATH}/ltbl/quadtree/QuadtreeNode.cpp"
"${SOURCE_PATH}/ltbl/quadtree/QuadtreeNode.h"
"${SOURCE_PATH}/ltbl/quadtree/QuadtreeOccupant.cpp"
"${SOURCE_PATH}/ltbl/quadtree/QuadtreeOccupant.h"
"${SOURCE_PATH}/ltbl/quadtree/StaticQuadtree.cpp"
"${SOURCE_PATH}/ltbl/quadtree/StaticQuadtree.h"
)
add_library( LTBL2 SHARED ${SOURCES} )
set_target_properties( LTBL2 PROPERTIES DEBUG_POSTFIX -d )
target_link_libraries(LTBL2 ${SFML_LIBRARIES})
*************************************************************************************
Second:
(building with mingw-builds gcc 4.9.2 sjlj)
[ 10%] Building CXX object CMakeFiles/LTBL2.dir/source/ltbl/Math.cpp.obj
p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/source/ltbl/Math.cpp: In fu
nction 'float ltbl::vectorMagnitude(const Vector2f&)':
p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/source/ltbl/Math.cpp:60:9:
error: 'sqrt' is not a member of 'std'
return std::sqrt(vector.x * vector.x + vector.y * vector.y);
^
It requires to modify Math.cpp.
#include <cmath>
*********************************************************************************
Third:
(building with mingw-builds gcc 4.9.2 sjlj)
[ 20%] Building CXX object CMakeFiles/LTBL2.dir/source/ltbl/lighting/LightDirect
ionEmission.cpp.obj
In file included from v:/MinGW-Builds/mingw32/i686-w64-mingw32/include/c++/array
:35:0,
from P:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/sourc
e/ltbl/quadtree/QuadtreeOccupant.h:9,
from P:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/sourc
e/ltbl/lighting/LightDirectionEmission.h:4,
from p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/sourc
e/ltbl/lighting/LightDirectionEmission.cpp:1:
v:/MinGW-Builds/mingw32/i686-w64-mingw32/include/c++/bits/c++0x_warning.h:32:2:
error: #error This file requires compiler and library support for the ISO C++ 20
11 standard. This support is currently experimental, and must be enabled with th
e -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
It requires to modify CMakeLists.txt.
# Compiler-specific flags and definitions
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
endif()
*******************************************************************************
Fourth:
(building with mingw-builds gcc 4.9.2 sjlj)
(building with msvc 18.0.31101.0) <- No import libs unfortunately. :-| Will we have official solution in the future?
(SHARED libraries) - Success!!!
Thanks
lolz123!
DJuego