Skip to content

Commit 6f3f238

Browse files
committed
added optional dependency to tasteful-rpg
1 parent 2349ddc commit 6f3f238

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

CMakeLists.txt

+12-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ ENDIF(NOT MSVC)
1212
set(CMAKE_INCLUDE_CURRENT_DIR ON)
1313
set(CMAKE_AUTOMOC ON)
1414
find_package(Qt5Core REQUIRED)
15+
find_package(TastefulRPG QUIET)
1516

16-
include_directories("include" "lib/tmx/include" "lib/tmxrenderer/include" )
17+
if(TastefulRPG_FOUND)
18+
include_directories("include" "lib/tmx/include" "lib/tmxrenderer/include" ${TastefulRPG_INCLUDE_DIR})
19+
else(TastefulRPG_FOUND)
20+
include_directories("include" "lib/tmx/include" "lib/tmxrenderer/include")
21+
endif(TastefulRPG_FOUND)
1722

1823
FILE(GLOB_RECURSE headers "include" *.h *.hpp)
1924

@@ -40,7 +45,12 @@ add_subdirectory("lib")
4045

4146
add_executable(${target} ${sources} ${headers})
4247

43-
target_link_libraries(${target} tmx tmxrenderer)
48+
if(TastefulRPG_FOUND)
49+
target_link_libraries(${target} tmx tmxrenderer ${TastefulRPG_LIBRARY})
50+
else(TastefulRPG_FOUND)
51+
target_link_libraries(${target} tmx tmxrenderer)
52+
endif(TastefulRPG_FOUND)
53+
4454
qt5_use_modules(${target} Widgets Xml)
4555

4656
#copy data

0 commit comments

Comments
 (0)