gameServer/CMakeLists.txt
changeset 2203 6bd39d75e0dd
parent 2015 d2848d723690
child 2401 2a694ea2a437
equal deleted inserted replaced
2202:29508a2924c2 2203:6bd39d75e0dd
    27 	-i${hedgewars_SOURCE_DIR}/gameServer
    27 	-i${hedgewars_SOURCE_DIR}/gameServer
    28 	-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
    28 	-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
    29 	-odir ${CMAKE_CURRENT_BINARY_DIR}
    29 	-odir ${CMAKE_CURRENT_BINARY_DIR}
    30 	-hidir ${CMAKE_CURRENT_BINARY_DIR})
    30 	-hidir ${CMAKE_CURRENT_BINARY_DIR})
    31 
    31 
       
    32 if( NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES "Release")
       
    33 set(ghc_flags
       
    34 	-w
       
    35 	-O2
       
    36 	${ghc_flags}
       
    37 )
       
    38 else()
       
    39 set(ghc_flags
       
    40 	-Wall
       
    41 	-debug
       
    42 	-dcore-lint
       
    43 	${ghc_flags}
       
    44 )
       
    45 endif()
       
    46 
    32 add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
    47 add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}"
    33 		COMMAND "${ghc_executable}"
    48 		COMMAND "${ghc_executable}"
    34 		ARGS ${ghc_flags}
    49 		ARGS ${ghc_flags}
    35 		MAIN_DEPENDENCY ${hwserv_main}
    50 		MAIN_DEPENDENCY ${hwserv_main}
    36 		DEPENDS ${hwserver_sources}
    51 		DEPENDS ${hwserver_sources}
    37 		)
    52 		)
    38 
    53 
    39 add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}")
    54 add_custom_target(hedgewars-server ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}")
    40 
    55 
    41 
       
    42 if(APPLE)
       
    43 	set (target_dir ".")
       
    44 else(APPLE)
       
    45 	set (target_dir "bin")
       
    46 endif(APPLE)
       
    47 
       
    48 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
    56 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})