Skip to content

Commit

Permalink
Executable is built in the build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gerstrong committed Jan 1, 2015
1 parent c165e1d commit f3740da
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Platform specific things can be put here
# Compilers and other specific variables can be found here:
# http://www.cmake.org/Wiki/CMake_Useful_Variables


if(SDL2)
Expand All @@ -7,11 +10,6 @@ else()
endif()


if(WIN32)
set(mingw64dir "C:/MinGW64/")
endif(WIN32)


#------------------------------------------------------------------------------
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
Expand All @@ -23,7 +21,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
endif()



IF(NOT DEFINED BUILD_TARGET)
IF(WIN32)
SET(BUILD_TARGET WIN32)
Expand All @@ -37,10 +34,6 @@ MESSAGE( STATUS "Available builds are: WIN32, LINUX GP2X. WIZ, CAANOO, DINGOO, N
ENDIF(NOT DEFINED BUILD_TARGET)


# Platform specific things can be put here
# Compilers and other specific variables can be found here:
# http://www.cmake.org/Wiki/CMake_Useful_Variables

SET(USRDIR /usr)

# Compilation Flags and executables
Expand Down Expand Up @@ -130,12 +123,12 @@ ADD_DEFINITIONS(-std=c++11)


# Directory creation of all the chosen build
set(BUILD_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Build")
set(BUILD_DIR "${BUILD_BASE_DIR}/${BUILD_TARGET}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_BASE_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_DIR})
#set(BUILD_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Build")
#set(BUILD_DIR "${BUILD_BASE_DIR}/${BUILD_TARGET}")
#execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_BASE_DIR})
#execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_DIR})

SET(EXECUTABLE_OUTPUT_PATH ${BUILD_DIR})
#SET(EXECUTABLE_OUTPUT_PATH ${BUILD_DIR})


# main includes
Expand Down Expand Up @@ -319,7 +312,7 @@ IF(WIN32)
SET_TARGET_PROPERTIES(CGeniusExe PROPERTIES OUTPUT_NAME "CGenius")
# ADD_CUSTOM_COMMAND(TARGET CGeniusExe PRE_LINK COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/src/CGLogo.rc ${CMAKE_CURRENT_SOURCE_DIR}/CGLogo.rc )
# ADD_CUSTOM_COMMAND(TARGET CGeniusExe PRE_LINK COMMAND ${mingw64dir}bin/icotool -c -o ${CMAKE_CURRENT_SOURCE_DIR}/CGLogo.ico ${CMAKE_CURRENT_SOURCE_DIR}/vfsroot/cglogo512.png )
ADD_CUSTOM_COMMAND(TARGET CGeniusExe PRE_LINK COMMAND ${mingw64dir}bin/windres ${CMAKE_CURRENT_SOURCE_DIR}/CGLogo.rc ${CMAKE_CURRENT_SOURCE_DIR}/CGLogo.o)
ADD_CUSTOM_COMMAND(TARGET CGeniusExe PRE_LINK COMMAND windres ${CMAKE_CURRENT_SOURCE_DIR}/CGLogo.rc ${CMAKE_CURRENT_SOURCE_DIR}/CGLogo.o)
SET_TARGET_PROPERTIES(CGeniusExe PROPERTIES LINK_FLAGS "-mwindows ${CMAKE_CURRENT_SOURCE_DIR}/CGLogo.o")
# LINK_DIRECTORIES(/opt/mingw32/lib)
MESSAGE(STATUS "Will build with the CG-Icon for Windows." )
Expand Down

0 comments on commit f3740da

Please sign in to comment.