Skip to content
Snippets Groups Projects
Commit cb5886c3 authored by jan.koester's avatar jan.koester
Browse files

fixes

parent 18376e9a
No related merge requests found
project(libhtmlpp)
project(libhtmlpp CXX)
cmake_minimum_required(VERSION 3.0)
enable_testing ()
set(LIBV "1.0.0")
set(Upstream_VERSION 1.0.0)
SET(CMAKE_CXX_FLAGS "-fPIC -Wall")
set(CMAKE_CXX_FLAGS "-fPIC -Wall")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
......
......@@ -3,6 +3,14 @@ set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
include(GenerateExportHeader)
set(headers
css.h
html.h
request.h
utils.h
exception.h
)
set(libhtmlSrcs
css.cpp
html.cpp
......@@ -10,16 +18,35 @@ set(libhtmlSrcs
exception.cpp
)
add_library(htmlpp SHARED ${libhtmlSrcs} )
add_library(htmlpp SHARED ${libhtmlSrcs} ${headers} )
target_compile_definitions(htmlpp PUBLIC -DSHARED)
add_library(htmlpp-static STATIC ${libhtmlSrcs} )
add_library(htmlpp-static STATIC ${libhtmlSrcs} ${headers})
generate_export_header(htmlpp)
target_link_libraries(htmlpp)
target_link_libraries(htmlpp-static)
target_include_directories(htmlpp
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/htmlpp>
PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
)
set_property(TARGET htmlpp APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/include")
target_include_directories(htmlpp-static
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/htmlpp>
PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
)
set_property(TARGET htmlpp-static APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_INSTALL_INCLUDEDIR}")
SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
......@@ -37,11 +64,7 @@ endif()
install(TARGETS htmlpp-static DESTINATION lib EXPORT htmlppTargets)
install(FILES
css.h
html.h
request.h
utils.h
exception.h
${headers}
"${CMAKE_BINARY_DIR}/config.h"
"${CMAKE_CURRENT_BINARY_DIR}/htmlpp_export.h"
DESTINATION include/htmlpp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment