Skip to content

Commit

Permalink
fix up CMake files
Browse files Browse the repository at this point in the history
fix SDL2 example build on gcc
  • Loading branch information
fallahn committed Mar 15, 2024
1 parent 7ff665b commit 90b15af
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions SDL2Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif()
SET (CMAKE_CXX_FLAGS_DEBUG "-g -D_DEBUG_")
SET (CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")

find_package(tmxlite REQUIRED)
find_package(TMXLITE REQUIRED)
find_package(SDL2 REQUIRED)

include_directories(
Expand Down Expand Up @@ -50,4 +50,4 @@ install(TARGETS ${PROJECT_NAME}

#install game data
install(DIRECTORY assets
DESTINATION .)
DESTINATION .)
14 changes: 7 additions & 7 deletions SDL2Example/cmake/modules/FindTMXLITE.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include(FindPackageHandleStandardArgs)

# Search for the header file
find_path(TMXLITE_INCLUDE_DIR NAMES tmxlite/Config.hpp PATH_SUFFIXES include)

# Search for the library
find_library(TMXLITE_LIBRARIES NAMES tmxlite PATH_SUFFIXES lib)
find_library(TMXLITE_LIBRARY_DEBUG NAMES tmxlite-d)
find_library(TMXLITE_LIBRARY_RELEASE NAMES tmxlite)

# Did we find everything we need?
FIND_PACKAGE_HANDLE_STANDARD_ARGS(tmxlite DEFAULT_MSG TMXLITE_LIBRARIES TMXLITE_INCLUDE_DIR)
include(SelectLibraryConfigurations)
select_library_configurations(TMXLITE)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TMXLITE DEFAULT_MSG TMXLITE_LIBRARY TMXLITE_INCLUDE_DIR)
3 changes: 2 additions & 1 deletion SDL2Example/src/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ source distribution.
#include "stb_image.h"

#include <iostream>
#include <cstdint>

Texture::Texture()
: m_texture(nullptr)
Expand Down Expand Up @@ -96,4 +97,4 @@ bool Texture::loadFromFile(const std::string& path, SDL_Renderer* renderer)
}

return false;
}
}
4 changes: 2 additions & 2 deletions SFMLExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif()
SET (CMAKE_CXX_FLAGS_DEBUG "-g -D_DEBUG_")
SET (CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")

find_package(tmxlite REQUIRED)
find_package(TMXLITE REQUIRED)
find_package(SFML 2 REQUIRED graphics window system)

include_directories(
Expand All @@ -47,4 +47,4 @@ install(TARGETS ${PROJECT_NAME}

#install game data
install(DIRECTORY assets
DESTINATION .)
DESTINATION .)
14 changes: 7 additions & 7 deletions SFMLExample/cmake/modules/FindTMXLITE.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include(FindPackageHandleStandardArgs)

# Search for the header file
find_path(TMXLITE_INCLUDE_DIR NAMES tmxlite/Config.hpp PATH_SUFFIXES include)

# Search for the library
find_library(TMXLITE_LIBRARIES NAMES tmxlite PATH_SUFFIXES lib)
find_library(TMXLITE_LIBRARY_DEBUG NAMES tmxlite-d)
find_library(TMXLITE_LIBRARY_RELEASE NAMES tmxlite)

# Did we find everything we need?
FIND_PACKAGE_HANDLE_STANDARD_ARGS(tmxlite DEFAULT_MSG TMXLITE_LIBRARIES TMXLITE_INCLUDE_DIR)
include(SelectLibraryConfigurations)
select_library_configurations(TMXLITE)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TMXLITE DEFAULT_MSG TMXLITE_LIBRARY TMXLITE_INCLUDE_DIR)

0 comments on commit 90b15af

Please sign in to comment.