Skip to content

Commit

Permalink
build: fix tinyxml2 finder
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Dec 17, 2015
1 parent bb8066b commit f8c9b6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Expand Up @@ -61,10 +61,10 @@ if (NOT USE_MINIZ)
include_directories(${ZLIB_INCLUDE_DIRS})
endif (NOT USE_MINIZ)

add_executable(test test/test.cpp)
set_target_properties(test PROPERTIES
add_executable(run_tests test/test.cpp)
set_target_properties(run_tests PROPERTIES
COMPILE_FLAGS ${EXAMPLE_CFLAGS})
target_link_libraries(test tmxparser ${TINYXML2_LIBRARIES})
target_link_libraries(run_tests tmxparser ${TINYXML2_LIBRARIES})
include_directories("${PROJECT_BINARY_DIR}")
include_directories("${PROJECT_SOURCE_DIR}/src")

Expand Down
37 changes: 11 additions & 26 deletions cmake/FindTinyXML2.cmake
@@ -1,30 +1,15 @@
# This file licensed under GNU GPL v3
# Source: https://code.google.com/p/mgep/source/browse/branches/clientv2/CMakeModules/FindTinyXML.cmake
# Copyright (c) 2014 Andrew Kelley
# This file is MIT licensed.
# See http://opensource.org/licenses/MIT

# - Find TinyXML
# Find the native TinyXML includes and library
#
# TINYXML2_FOUND - True if TinyXML2 found.
# TINYXML2_INCLUDE_DIR - where to find tinyxml2.h, etc.
# TINYXML2_LIBRARIES - List of libraries when using TinyXML2.
#
# TINYXML2_FOUND
# TINYXML2_INCLUDE_DIR
# TINYXML2_LIBRARIES

IF( TINYXML2_INCLUDE_DIR )
# Already in cache, be silent
SET( TinyXML2_FIND_QUIETLY TRUE )
ENDIF( TINYXML2_INCLUDE_DIR )
find_path(TINYXML2_INCLUDE_DIR NAMES tinyxml2.h)
find_library(TINYXML2_LIBRARIES NAMES tinyxml2)

FIND_PATH( TINYXML2_INCLUDE_DIR "tinyxml2.h"
PATH_SUFFIXES "tinyxml2" )

FIND_LIBRARY( TINYXML2_LIBRARIES
NAMES "tinyxml2"
PATH_SUFFIXES "tinyxml2" )

# handle the QUIETLY and REQUIRED arguments and set TINYXML2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE( "FindPackageHandleStandardArgs" )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( "TinyXML2" DEFAULT_MSG TINYXML2_INCLUDE_DIR TINYXML2_LIBRARIES )

MARK_AS_ADVANCED( TINYXML2_INCLUDE_DIR TINYXML2_LIBRARIES )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TINYXML2 DEFAULT_MSG TINYXML2_LIBRARIES TINYXML2_INCLUDE_DIR)

mark_as_advanced(TINYXML2_INCLUDE_DIR TINYXML2_LIBRARIES)

0 comments on commit f8c9b6b

Please sign in to comment.