OpenRayman/libopenrayman/CMakeLists.txt
Hannes Mann 816a143890 Refactoring, lots of refactoring
* Split OpenRayman into two parts (openrayman and libopenrayman)
  libopenrayman is licensed under LGPLv3
* dsb_interpreter -> dsb_script
  gf_converter -> gf_texture
  This means that all currently available formats share a mostly common interface
  (specify stream via constructor, check if the file is valid via valid()
   and/or extract/decompile via a function returning bool)
* Since all formats can only be created via an std::istream,
  libopenrayman includes two helper stream functions in openrayman::common
  These are in_mem_(i/o)stream and encoded_stream
  in_mem stream read and write to a block of memory (can be created from vector/char*)
  encoded_streams take an existing stream and decodes data after reading it from the original stream
* Some small refactoring to other parts of the engine
2016-07-07 08:16:48 +02:00

24 lines
1.3 KiB
CMake

file(GLOB_RECURSE SOURCES src/*.cc)
include_directories(AFTER "${CMAKE_SOURCE_DIR}/libopenrayman/include")
include_directories(AFTER "${CMAKE_SOURCE_DIR}/lib/lodepng")
include_directories(AFTER "${CMAKE_SOURCE_DIR}/lib/json/src")
add_library(libopenrayman_shared SHARED ${SOURCES} "${CMAKE_SOURCE_DIR}/lib/lodepng/lodepng.cpp" "${CMAKE_SOURCE_DIR}/lib/lodepng/lodepng_util.cpp")
add_library(libopenrayman_static STATIC ${SOURCES} "${CMAKE_SOURCE_DIR}/lib/lodepng/lodepng.cpp" "${CMAKE_SOURCE_DIR}/lib/lodepng/lodepng_util.cpp")
set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/libopenrayman/bin")
target_link_libraries(libopenrayman_static nlohmann_json)
target_link_libraries(libopenrayman_shared nlohmann_json)
set_target_properties(libopenrayman_static PROPERTIES OUTPUT_NAME "libopenrayman")
set_target_properties(libopenrayman_shared PROPERTIES OUTPUT_NAME "libopenrayman")
set_target_properties(libopenrayman_static PROPERTIES PREFIX "")
set_target_properties(libopenrayman_shared PROPERTIES PREFIX "")
if(WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc -s")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++ -s")
endif()