aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2019-07-25 09:59:29 +0200
committerRenaud G <renaud@rolisteam.org>2019-07-25 09:59:29 +0200
commitbb6b87a2685c0d71b5c38be33c100f85ac0b9cee (patch)
tree81da599ceec1368e55fee5fd6a4dd0173fc39b5f /CMakeLists.txt
parent6f499de159eeac37fe473f945042e13359dc2d40 (diff)
downloadOneRoll-bb6b87a2685c0d71b5c38be33c100f85ac0b9cee.tar.gz
OneRoll-bb6b87a2685c0d71b5c38be33c100f85ac0b9cee.zip
Rework of the component to be a proper lib
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt37
1 files changed, 34 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a9a340..e06bdac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)
-project(diceparser)
+project(diceparser VERSION 1.9.0 DESCRIPTION "Parser of dice command")
set(QT_REQUIRED_VERSION "5.12.0")
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Test Gui Svg)
@@ -53,11 +53,42 @@ SET( dice_sources
node/valueslistnode.cpp
)
-add_library(diceparser SHARED ${dice_sources} )
-target_link_libraries(diceparser PUBLIC Qt5::Core Qt5::Gui Qt5::Svg)
+add_library(diceparser_shared SHARED ${dice_sources} )
+add_library(diceparser_static STATIC ${dice_sources} )
+
+target_include_directories(diceparser_shared PRIVATE include)
+target_include_directories(diceparser_static PRIVATE include)
+
+SET_TARGET_PROPERTIES(diceparser_static PROPERTIES OUTPUT_NAME diceparser CLEAN_DIRECT_OUTPUT 1)
+SET_TARGET_PROPERTIES(diceparser_shared PROPERTIES OUTPUT_NAME diceparser CLEAN_DIRECT_OUTPUT 1)
+
+target_link_libraries(diceparser_shared PUBLIC Qt5::Core Qt5::Gui Qt5::Svg)
+target_link_libraries(diceparser_static PUBLIC Qt5::Core Qt5::Gui Qt5::Svg)
+
+set_target_properties(diceparser_shared PROPERTIES VERSION ${PROJECT_VERSION})
+set_target_properties(diceparser_shared PROPERTIES SOVERSION 1)
+#target_link_libraries(diceparsersta PROPERTIES VERSION ${PROJECT_VERSION})
+
+set_target_properties(diceparser_shared PROPERTIES PUBLIC_HEADER "include/diceparser.h;include/highlightdice.h;include/parsingtoolbox.h;include/dicealias.h;include/diceparserhelper.h")
+#set_target_properties(diceparsersta PROPERTIES PUBLIC_HEADER "include/diceparser.h;include/highlightdice.h;include/parsingtoolbox.h;include/dicealias.h;include/diceparserhelper.h")
add_subdirectory(cli)
add_subdirectory( tests )
#add_subdirectory(irc)
#add_subdirectory(mobile)
#add_subdirectory(webserver)
+
+
+include(GNUInstallDirs)
+
+install(TARGETS diceparser_shared
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+install(TARGETS diceparser_static
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+configure_file(diceparser.pc.in diceparser.pc @ONLY)
+
+install(FILES ${CMAKE_BINARY_DIR}/diceparser.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
+