Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building tng as a subproject in a subdirectory #1

Open
madebr opened this issue Jul 16, 2020 · 0 comments
Open

Building tng as a subproject in a subdirectory #1

madebr opened this issue Jul 16, 2020 · 0 comments

Comments

@madebr
Copy link

madebr commented Jul 16, 2020

Hello!

Recently, we received a package inclusion request for tng 1.8.2 at conan-center-index.
It appears tng cannot build correctly when used as a subproject.
This can be fixed by applying the following patch:

--- BuildTNG.cmake
+++ BuildTNG.cmake
@@ -1,9 +1,9 @@
 set(TNG_ROOT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
-file(RELATIVE_PATH TNG_ROOT_BINARY_DIR ${CMAKE_SOURCE_DIR} ${TNG_ROOT_SOURCE_DIR})
+file(RELATIVE_PATH TNG_ROOT_BINARY_DIR ${PROJECT_SOURCE_DIR} ${TNG_ROOT_SOURCE_DIR})
 if ("${TNG_ROOT_BINARY_DIR}" MATCHES "^\.\.")
     set(TNG_ROOT_BINARY_DIR tng)
 endif()
-set(TNG_ROOT_BINARY_DIR ${CMAKE_BINARY_DIR}/${TNG_ROOT_BINARY_DIR})
+set(TNG_ROOT_BINARY_DIR ${PROJECT_BINARY_DIR}/${TNG_ROOT_BINARY_DIR})
 
 set(TNG_MAJOR_VERSION "1")
 set(TNG_MINOR_VERSION "8")

I believe this patch would also be useful for the tng library itself.

@madebr madebr changed the title Building tng as a subdirectory Building tng as a subproject in a subdirectory Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant