mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix cmake build issues (#5670)
* Fix cmake build issues * Temporary force linking of external object
This commit is contained in:
@@ -1709,6 +1709,12 @@ bool RiaApplication::generateCode( const QString& fileName, QString* errMsg )
|
|||||||
|
|
||||||
std::string fileExt = QFileInfo( fileName ).suffix().toStdString();
|
std::string fileExt = QFileInfo( fileName ).suffix().toStdString();
|
||||||
|
|
||||||
|
{
|
||||||
|
// TODO: Manually instantiate the markdown generator until cmake issues are fixed
|
||||||
|
// This will make sure the markdown generator is registered in the factory in the cafPdmScripting library
|
||||||
|
caf::PdmMarkdownGenerator testObj;
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<caf::PdmCodeGenerator> generator( caf::PdmCodeGeneratorFactory::instance()->create( fileExt ) );
|
std::unique_ptr<caf::PdmCodeGenerator> generator( caf::PdmCodeGeneratorFactory::instance()->create( fileExt ) );
|
||||||
if ( !generator )
|
if ( !generator )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,12 +27,7 @@ set( PROJECT_FILES
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# NOTE! Adding the library as a cmake "OBJECT" library
|
add_library( ${PROJECT_NAME}
|
||||||
# to make sure the linker is not pruning the seemingly unused features,
|
|
||||||
# and to make sure that the static initialization based registration of the features into the factory is done properly
|
|
||||||
# see https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/Object-Library
|
|
||||||
# and https://cmake.org/cmake/help/v3.15/command/add_library.html?highlight=add_library#object-libraries
|
|
||||||
add_library( ${PROJECT_NAME} OBJECT
|
|
||||||
${PROJECT_FILES}
|
${PROJECT_FILES}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -47,18 +42,6 @@ target_link_libraries ( ${PROJECT_NAME}
|
|||||||
LibCore
|
LibCore
|
||||||
)
|
)
|
||||||
|
|
||||||
# Before cmake 3.12 OBJECT libraries could not use the target_link_libraries command,
|
|
||||||
# So we need to set the POSITION_INDEPENDENT_CODE option manually
|
|
||||||
|
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
# Not to be used until we can use cmake 3.12 or above
|
|
||||||
#target_link_libraries ( ${PROJECT_NAME}
|
|
||||||
# cafCommand
|
|
||||||
# cafUserInterface
|
|
||||||
# ${QT_LIBRARIES}
|
|
||||||
#)
|
|
||||||
|
|
||||||
|
|
||||||
source_group("" FILES ${PROJECT_FILES})
|
source_group("" FILES ${PROJECT_FILES})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user