Fix cmake build issues (#5670)

* Fix cmake build issues
* Temporary force linking of external object
This commit is contained in:
Magne Sjaastad 2020-03-12 11:24:59 +01:00 committed by GitHub
parent 8bf37b00aa
commit 40ac705db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 18 deletions

View File

@ -1709,6 +1709,12 @@ bool RiaApplication::generateCode( const QString& fileName, QString* errMsg )
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 ) );
if ( !generator )
{

View File

@ -27,12 +27,7 @@ set( PROJECT_FILES
)
# NOTE! Adding the library as a cmake "OBJECT" library
# 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
add_library( ${PROJECT_NAME}
${PROJECT_FILES}
)
@ -47,18 +42,6 @@ target_link_libraries ( ${PROJECT_NAME}
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})