summaryrefslogtreecommitdiff
path: root/tools/dyecmd/src/CMakeLists.txt
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-19 10:10:15 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-06-19 10:10:15 +0200
commit61d02a395b0ca594640f0fb917d7162a5aba2c37 (patch)
tree7dd6f7f540dda3d89d37bc7e19f3f4d27dd53c85 /tools/dyecmd/src/CMakeLists.txt
parent5da59b807d9840fb23feb42df729bf5e88ee9678 (diff)
parentac0b338b3e026d0d05a447894de9a6a994da82dc (diff)
downloadmana-online-player-list.tar.gz
mana-online-player-list.tar.bz2
mana-online-player-list.tar.xz
mana-online-player-list.zip
Merge branch 'master' into online-player-listonline-player-list
Conflicts: src/net/tmwa/chathandler.cpp
Diffstat (limited to 'tools/dyecmd/src/CMakeLists.txt')
-rw-r--r--tools/dyecmd/src/CMakeLists.txt99
1 files changed, 42 insertions, 57 deletions
diff --git a/tools/dyecmd/src/CMakeLists.txt b/tools/dyecmd/src/CMakeLists.txt
index f8e717b7..f59eabe2 100644
--- a/tools/dyecmd/src/CMakeLists.txt
+++ b/tools/dyecmd/src/CMakeLists.txt
@@ -1,59 +1,44 @@
-FIND_PACKAGE(SDL REQUIRED)
-FIND_PACKAGE(SDL_image REQUIRED)
-FIND_PACKAGE(PNG REQUIRED)
-
-IF (CMAKE_COMPILER_IS_GNUCXX)
- # Help getting compilation warnings
- SET(CMAKE_CXX_FLAGS "-Wall")
- IF (WIN32)
- # This includes enough debug information to get something useful
- # from Dr. Mingw while keeping binary size down. Almost useless
- # with gdb, though.
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -ggdb0 -gstabs2")
- ENDIF()
-ENDIF()
-
-SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"")
-SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"")
-SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"")
-
-IF (CMAKE_BUILD_TYPE)
- STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
- IF((CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) OR
- (CMAKE_BUILD_TYPE_TOLOWER MATCHES relwithdebinfo))
- SET(FLAGS "${FLAGS} -DDEBUG")
- ENDIF()
-ENDIF()
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${SDL_INCLUDE_DIR}
- ${SDLIMAGE_INCLUDE_DIR}
- ${PNG_INCLUDE_DIR}
- )
+find_package(SDL REQUIRED)
+find_package(SDL_image REQUIRED)
+find_package(PNG REQUIRED)
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+ # Help getting compilation warnings
+ set(CMAKE_CXX_FLAGS "-Wall")
+ if(WIN32)
+ # This includes enough debug information to get something useful from Dr.
+ # Mingw while keeping binary size down. Almost useless with gdb, though.
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -ggdb0 -gstabs2")
+ endif()
+endif()
+
+set(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"")
+set(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"")
+set(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"")
+
+if(CMAKE_BUILD_TYPE)
+ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
+ if((CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) OR (CMAKE_BUILD_TYPE_TOLOWER
+ MATCHES relwithdebinfo))
+ set(FLAGS "${FLAGS} -DDEBUG")
+ endif()
+endif()
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${SDL_INCLUDE_DIR}
+ ${SDLIMAGE_INCLUDE_DIR} ${PNG_INCLUDE_DIR})
# Fix some stuff that gets not hidden by mainline modules
-MARK_AS_ADVANCED(SDLIMAGE_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDLIMAGE_LIBRARY)
-MARK_AS_ADVANCED(SDLMAIN_LIBRARY)
-MARK_AS_ADVANCED(SDL_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDL_LIBRARY)
-
-SET(SRCS
- dye.cpp
- dye.h
- dyecmd.cpp
- imagewriter.cpp
- imagewriter.h
- )
-
-SET (PROGRAMS dyecmd)
-
-ADD_EXECUTABLE(dyecmd WIN32 ${SRCS})
-
-TARGET_LINK_LIBRARIES(dyecmd
- ${SDL_LIBRARY}
- ${SDLIMAGE_LIBRARY}
- ${PNG_LIBRARIES})
-
-SET_TARGET_PROPERTIES(dyecmd PROPERTIES COMPILE_FLAGS "${FLAGS}")
+mark_as_advanced(SDLIMAGE_INCLUDE_DIR)
+mark_as_advanced(SDLIMAGE_LIBRARY)
+mark_as_advanced(SDLMAIN_LIBRARY)
+mark_as_advanced(SDL_INCLUDE_DIR)
+mark_as_advanced(SDL_LIBRARY)
+
+set(SRCS dye.cpp dye.h dyecmd.cpp imagewriter.cpp imagewriter.h)
+
+add_executable(dyecmd WIN32 ${SRCS})
+
+target_link_libraries(dyecmd ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY}
+ ${PNG_LIBRARIES})
+
+set_target_properties(dyecmd PROPERTIES COMPILE_FLAGS "${FLAGS}")