On lundi 18 novembre 2019 22:05:40 CET Albert Astals Cid wrote:
> El dilluns, 18 de novembre de 2019, a les 21:28:26 CET, Tobias C. Berner va
escriure:
> > Moin moin
>
> > Using cmake version 3.15.5 with out-of-source build using the cmake args:
> Same version as me, it still works when using your params :/
>
> Anyhow it seems Christophe had a potential patch?
>
The patch was not complete. Test with the one attached.
(tested with make & ninja)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 191fc938..7e84f5fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,7 +60,7 @@ include(KDEFrameworkCompilerSettings)
include(ECMAddAppIcon)
include(GenerateExportHeader)
-include(thirdparty/CMakeLists.txt)
+add_subdirectory(thirdparty)
if(NOT WIN32)
set_package_properties(LibSpectre PROPERTIES DESCRIPTION "A PostScript rendering library"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ecc0963d..3c26c4c6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -101,9 +101,9 @@ target_link_libraries(cantorpart KF5::Parts KF5::NewStuff
KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets
Qt5::PrintSupport cantorlibs cantor_config )
-if(Discount_FOUND)
+# if(Discount_FOUND)
target_link_libraries(cantorpart Discount::Lib)
-endif(Discount_FOUND)
+# endif(Discount_FOUND)
if(BUILD_TESTING)
add_subdirectory(test)
diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
index 2cc921b2..313a2a84 100644
--- a/thirdparty/CMakeLists.txt
+++ b/thirdparty/CMakeLists.txt
@@ -7,19 +7,18 @@ set (DISCOUNT_ONLY_LIBRARY ON)
set (DISCOUNT_MAKE_INSTALL OFF)
ExternalProject_Add(
discount_project
- URL ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/discount-2.2.6-patched.tar
+ URL ${CMAKE_CURRENT_SOURCE_DIR}/discount-2.2.6-patched.tar
SOURCE_SUBDIR cmake
CMAKE_ARGS DISCOUNT_ONLY_LIBRARY DISCOUNT_MAKE_INSTALL
CMAKE_CACHE_ARGS "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
- PREFIX ${CMAKE_CURRENT_BINARY_DIR}/thirdparty
- STEP_TARGETS configure build
- EXCLUDE_FROM_ALL TRUE
+ PREFIX ${CMAKE_CURRENT_BINARY_DIR}
+ INSTALL_COMMAND ""
)
ExternalProject_Get_Property(discount_project source_dir)
ExternalProject_Get_Property(discount_project binary_dir)
-add_library(Discount::Lib STATIC IMPORTED)
+add_library(Discount::Lib STATIC IMPORTED GLOBAL)
set_target_properties(Discount::Lib PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${source_dir}
IMPORTED_LOCATION ${binary_dir}/libmarkdown${CMAKE_STATIC_LIBRARY_SUFFIX}