From e9600607c0d72c1fdd5c78351c299f5f529399f3 2017-06-09 08:50:51 From: mperrinel Date: 2017-06-09 08:50:51 Subject: [PATCH] Add dependencies between target to avoid bug compilation when building in multithread --- diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index cfa7c6d..ad0effb 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -14,6 +14,7 @@ include_directories("${INCLUDES_DIR}") # Find Qt modules # SCIQLOP_FIND_QT(Core Widgets) + # # Find dependent libraries @@ -68,6 +69,10 @@ target_link_libraries(${EXECUTABLE_NAME} # Link with Qt5 modules qt5_use_modules(${EXECUTABLE_NAME} Core Widgets) + + +add_dependencies(${EXECUTABLE_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME}) + # Add the files to the list of files to be analyzed diff --git a/cmake/sciqlop_package.cmake b/cmake/sciqlop_package.cmake index 8300aff..4337a56 100644 --- a/cmake/sciqlop_package.cmake +++ b/cmake/sciqlop_package.cmake @@ -42,7 +42,6 @@ SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Setu SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_NAME}) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) -message("exepath" ${CPACK_PACKAGE_INSTALL_DIRECTORY}) if (WIN32) SET(CPACK_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index c5f5dc1..a65ba0b 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -67,6 +67,9 @@ set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES}) qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets PrintSupport) +add_dependencies(${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME}) + + # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order. # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets