diff --git a/CMakeLists.txt b/CMakeLists.txt index 105ebbf..fa39ba0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/cmake/FindTinyXML2.cmake b/cmake/FindTinyXML2.cmake index bb42a9f..eee1d00 100644 --- a/cmake/FindTinyXML2.cmake +++ b/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)