Commit b04cefff authored by jan.koester's avatar jan.koester
Browse files

test

parent c9c9128a
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
project(libconfplus)
cmake_minimum_required(VERSION 3.00)
cmake_minimum_required(VERSION 3.10)

set(WINDOWS_EXPORT_ALL_SYMBOLS ON)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
    set(CMAKE_INSTALL_PREFIX ON CACHE PATH "c:/Program Files/libconfplus")
    set(CMAKE_CXX_FLAGS
        "/EHsc"
    )
else()
    set(CMAKE_CXX_FLAGS
        "${CMAKE_CXX_FLAGS} \
        -fPIC \
        -Wall"
    )

if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
    set(CMAKE_INSTALL_PREFIX ON CACHE PATH "c:/Program Files/libconfplus")
endif()

add_definitions(-D${CMAKE_SYSTEM_NAME})
+9 −7
Original line number Diff line number Diff line
@@ -5,21 +5,23 @@ include_directories(
find_package(YAML REQUIRED)

if(${YAML_FOUND})
    set( yamlsrc
        yaml/yaml.cpp
    set( yamlconfsrc
        "yaml/yamlconf.cpp"
    )

    add_library(yamlconf SHARED ${yamlsrc})
    add_library(yamlconf SHARED ${yamlconfsrc})

    add_dependencies(yamlconf confplus)

    set_target_properties(yamlconf PROPERTIES PREFIX "")
    set_target_properties(yamlconf PROPERTIES OUTPUT_NAME yaml)

    target_include_directories(yamlconf PUBLIC ${YAML_INCLUDE_DIR})
    target_include_directories(yamlconf PRIVATE ${YAML_INCLUDE_DIR})

if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
    target_link_libraries(yamlconf PUBLIC confplus ${YAML_LIBRARIES} kernel32.lib)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
    target_link_libraries(yamlconf PUBLIC confplus PRIVATE ${YAML_LIBRARIES} kernel32.lib )
else()
    target_link_libraries(yamlconf PUBLIC confplus ${YAML_LIBRARIES} dl)
    target_link_libraries(yamlconf PUBLIC confplus PRIVATE ${YAML_LIBRARIES} dl)
endif()

    install(TARGETS yamlconf DESTINATION lib/confplus/backend)
+3 −3
Original line number Diff line number Diff line
@@ -26,11 +26,11 @@
 *******************************************************************************/

#include <iostream>

#include <string>
#include <yaml.h>

#include "conf.h"
#include "yaml.h"
#include "yamlconf.h"
#include "exception.h"

namespace confplus {
    struct YamlStack {
+1 −2
Original line number Diff line number Diff line
@@ -25,8 +25,7 @@
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *******************************************************************************/

#include <yaml.h>

#include "conf.h"
#include "backend.h"

namespace confplus {
+1 −1
Original line number Diff line number Diff line
#ifdef Windows
#define CONFIGPATH "%PROGRAMFILES%\libconfplus\lib\confplus\backend"
#define CONFIGPATH ".\lib\\confplus\\backend"
#else
#define CONFIGPATH "${CMAKE_INSTALL_PREFIX}/lib/confplus/backend"
#endif
 No newline at end of file
Loading