mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 10:01:38 +08:00
CMakeLists.txt: using target_sources() and making CPP-files private!
This commit is contained in:
parent
3dd8246405
commit
2697e66e31
@ -72,7 +72,8 @@ include(CMakePackageConfigHelpers)
|
|||||||
|
|
||||||
|
|
||||||
if(JKQtPlotter_BUILD_SHARED_LIBS)
|
if(JKQtPlotter_BUILD_SHARED_LIBS)
|
||||||
add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS})
|
add_library(${libsh_name} SHARED )
|
||||||
|
target_sources(${libsh_name} PRIVATE ${SOURCES} PUBLIC ${HEADERS})
|
||||||
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||||
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
|
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
|
||||||
target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets Qt5::PrintSupport)
|
target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets Qt5::PrintSupport)
|
||||||
@ -100,7 +101,8 @@ if(JKQtPlotter_BUILD_SHARED_LIBS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(JKQtPlotter_BUILD_STATIC_LIBS)
|
if(JKQtPlotter_BUILD_STATIC_LIBS)
|
||||||
add_library(${lib_name} STATIC ${SOURCES} ${HEADERS})
|
add_library(${lib_name} STATIC )
|
||||||
|
target_sources(${lib_name} PRIVATE ${SOURCES} PUBLIC ${HEADERS})
|
||||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||||
set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 11)
|
set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 11)
|
||||||
|
@ -34,7 +34,8 @@ include(CMakePackageConfigHelpers)
|
|||||||
|
|
||||||
|
|
||||||
if(JKQtPlotter_BUILD_SHARED_LIBS)
|
if(JKQtPlotter_BUILD_SHARED_LIBS)
|
||||||
add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} ${RESOURCES})
|
add_library(${libsh_name} SHARED )
|
||||||
|
target_sources(${libsh_name} PRIVATE ${SOURCES} ${RESOURCES} PUBLIC ${HEADERS})
|
||||||
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||||
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
|
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
|
||||||
target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL JKQTCommonSharedLib)
|
target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL JKQTCommonSharedLib)
|
||||||
@ -63,6 +64,7 @@ endif()
|
|||||||
|
|
||||||
if(JKQtPlotter_BUILD_STATIC_LIBS)
|
if(JKQtPlotter_BUILD_STATIC_LIBS)
|
||||||
add_library(${lib_name} STATIC ${SOURCES} ${HEADERS} ${RESOURCES})
|
add_library(${lib_name} STATIC ${SOURCES} ${HEADERS} ${RESOURCES})
|
||||||
|
target_sources(${lib_name} PRIVATE ${SOURCES} ${RESOURCES} PUBLIC ${HEADERS})
|
||||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||||
set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 11)
|
set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 11)
|
||||||
|
@ -39,7 +39,8 @@ endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS)
|
|||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
if(JKQtPlotter_BUILD_SHARED_LIBS)
|
if(JKQtPlotter_BUILD_SHARED_LIBS)
|
||||||
add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} ${RESOURCES})
|
add_library(${libsh_name} SHARED
|
||||||
|
target_sources(${libsh_name} PRIVATE ${SOURCES} ${RESOURCES} PUBLIC ${HEADERS})
|
||||||
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||||
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
|
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
|
||||||
target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport JKQTCommonSharedLib)
|
target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport JKQTCommonSharedLib)
|
||||||
@ -70,7 +71,8 @@ if(JKQtPlotter_BUILD_SHARED_LIBS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(JKQtPlotter_BUILD_STATIC_LIBS)
|
if(JKQtPlotter_BUILD_STATIC_LIBS)
|
||||||
add_library(${lib_name} STATIC ${SOURCES} ${HEADERS} ${RESOURCES})
|
add_library(${lib_name} STATIC )
|
||||||
|
target_sources(${lib_name} PRIVATE ${SOURCES} ${RESOURCES} PUBLIC ${HEADERS})
|
||||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||||
set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 11)
|
set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 11)
|
||||||
|
@ -141,7 +141,8 @@ include(CMakePackageConfigHelpers)
|
|||||||
|
|
||||||
|
|
||||||
if(JKQtPlotter_BUILD_SHARED_LIBS)
|
if(JKQtPlotter_BUILD_SHARED_LIBS)
|
||||||
add_library(${libsh_name} SHARED ${SOURCES} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${HEADERS} ${HEADERS_GRAPHS} ${HEADERS_GUI} ${RESOURCES})
|
add_library(${libsh_name} SHARED )
|
||||||
|
target_sources(${libsh_name} PRIVATE ${SOURCES} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${RESOURCES} PUBLIC ${HEADERS} ${HEADERS_GRAPHS} ${HEADERS_GUI})
|
||||||
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
set_property(TARGET ${libsh_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||||
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
|
set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}")
|
||||||
target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Svg Qt5::Xml JKQTCommonSharedLib JKQTMathTextSharedLib)
|
target_link_libraries(${libsh_name} PUBLIC Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Svg Qt5::Xml JKQTCommonSharedLib JKQTMathTextSharedLib)
|
||||||
@ -169,7 +170,8 @@ if(JKQtPlotter_BUILD_SHARED_LIBS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(JKQtPlotter_BUILD_STATIC_LIBS)
|
if(JKQtPlotter_BUILD_STATIC_LIBS)
|
||||||
add_library(${lib_name} STATIC ${SOURCES} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${HEADERS} ${HEADERS_GRAPHS} ${HEADERS_GUI} ${RESOURCES})
|
add_library(${lib_name} STATIC )
|
||||||
|
target_sources(${libsh_name} PRIVATE ${SOURCES} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${RESOURCES} PUBLIC ${HEADERS} ${HEADERS_GRAPHS} ${HEADERS_GUI})
|
||||||
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
set_property(TARGET ${lib_name} PROPERTY VERSION "${PROJECT_VERSION}")
|
||||||
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}")
|
||||||
set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 11)
|
set_property(TARGET ${lib_name} PROPERTY CXX_STANDARD 11)
|
||||||
|
Loading…
Reference in New Issue
Block a user