another little tweak
authorkoda
Tue, 25 Sep 2012 02:35:21 +0200
changeset 7708 95de696e4711
parent 7707 e7e7b2082f44
child 7709 631852904cee
another little tweak
hedgewars/CMakeLists.txt
--- a/hedgewars/CMakeLists.txt	Tue Sep 25 02:25:22 2012 +0200
+++ b/hedgewars/CMakeLists.txt	Tue Sep 25 02:35:21 2012 +0200
@@ -127,9 +127,9 @@
         set(powerpc_build "powerpc")
     endif()
 
-    #on OSX we need to provide the main() function when building as executable
+    #on OSX we need to provide the SDL_main() function when building as executable
     if(NOT BUILD_ENGINE_LIBRARY)
-        #let's look for the bundled sdlmain, if not found build our own
+        #let's look for the installed sdlmain file; if it is not found, let's build our own
         find_package(SDL REQUIRED)
         #remove the ";-framework Cocoa" from the SDL_LIBRARY variable
         string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}")
@@ -137,12 +137,12 @@
         find_file(SDLMAIN_LIB libSDLMain.a PATHS ${sdl_dir}/Resources/)
 
         if(SDLMAIN_LIB MATCHES "SDLMAIN_LIB-NOTFOUND")
-            set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
+            set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
             include_directories(${SDL_INCLUDE_DIR})
             add_library (SDLmain STATIC SDLMain.m)
             #add a dependency to the hwengine target
             set(engine_sources ${engine_sources} SDLmain)
-            set(SDLMAIN_LIB "${CMAKE_BINARY_DIR}/bin/libSDLmain.a")
+            set(SDLMAIN_LIB "${LIBRARY_OUTPUT_PATH}/libSDLmain.a")
         endif()
 
         set(pascal_flags "-k${SDLMAIN_LIB}" ${pascal_flags})