Skip to content
Snippets Groups Projects
Commit 86db68e9 authored by Antoine Lorence's avatar Antoine Lorence
Browse files

[CMake] 'core' is now a shared library

parent 77c0068f
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ find_package(Qt5OpenGL)
find_package(Qt5PrintSupport)
# We want to generate everything in the right target folder, for easier deployment
file(MAKE_DIRECTORY ${DEPLOY_OUTPUT_DIRECTORY}/lib)
set(DEPLOY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/eiimage CACHE PATH "The folder to use for deployment." FORCE)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${DEPLOY_OUTPUT_DIRECTORY}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${DEPLOY_OUTPUT_DIRECTORY}/lib)
......@@ -97,17 +98,17 @@ if(WIN32)
endforeach()
# Qt and compiler dll
if(Qt5Core_VERSION_STRING GREATER 5.3)
if(CMAKE_BUILD_TYPE MATCHES "Release")
set(DEPLOY_FLAG "--release")
if(Qt5Core_VERSION_STRING VERSION_GREATER 5.3)
if(CMAKE_BUILD_TYPE MATCHES Release)
set(DEPLOY_FLAGS "--release")
else()
set(DEPLOY_FLAG "--debug")
set(DEPLOY_FLAGS "--debug")
endif()
endif()
add_custom_target(WinQtDeploy ALL
windeployqt ${DEPLOY_FLAG} ${DEPLOY_OUTPUT_DIRECTORY}/qwt.dll
COMMAND windeployqt ${DEPLOY_FLAG} ${DEPLOY_OUTPUT_DIRECTORY}/eiimage.exe
windeployqt ${DEPLOY_FLAGS} ${DEPLOY_OUTPUT_DIRECTORY}/qwt.dll
COMMAND windeployqt ${DEPLOY_FLAGS} ${DEPLOY_OUTPUT_DIRECTORY}/eiimage.exe
COMMENT "Copy Qt & compiler DLL to the target directory")
add_dependencies(WinQtDeploy eiimage)
endif()
......@@ -200,8 +200,6 @@ target_link_libraries(eiimage
Qt5::Script
Qt5::Xml
${RandomLib_LIBRARIES}
GenericInterface
ImageIn
)
add_custom_command(TARGET eiimage POST_BUILD
......
......@@ -18,9 +18,12 @@ set(SRCS
PlugOperation.cpp
PlugOperation.h
)
add_library(core ${SRCS})
add_library(core SHARED ${SRCS} $<TARGET_OBJECTS:GenericInterface> $<TARGET_OBJECTS:ImageIn>)
target_link_libraries(core
GenericInterface
ImageIn
Qt5::Widgets
${QWT_LIBRARY}
${QWT_LIBRARIES}
${JPEG_LIBRARY}
${PNG_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
Subproject commit 1597854502dc79b30e476b199ba88e3518ef9b3c
Subproject commit 9ba87b46e81835754952a7b968ea975f1ba409d7
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