Skip to content

Commit

Permalink
Revert "Revert "CMake: workaround for CMake-Mac OS X fail""
Browse files Browse the repository at this point in the history
Tests have shown this to work, and the simpler method not :/
Thanks to pepijn for testing

This reverts commit 10d1f64.
  • Loading branch information
hoijui committed Feb 4, 2010
1 parent 8f1f25e commit 0995062
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AI/Interfaces/C/CMakeLists.txt
Expand Up @@ -46,6 +46,8 @@ macro (ConfigureNativeSkirmishAI mySourceDirRel_var additionalSources_var add

# Compile the library
add_library(${myTarget} MODULE ${mySources} ${additionalSources})
FixLibName(${myTarget})

target_link_libraries(${myTarget} ${additionalLibraries})
set_target_properties(${myTarget} PROPERTIES COMPILE_FLAGS "${additionalCompileFlags}")
set_target_properties(${myTarget} PROPERTIES OUTPUT_NAME "SkirmishAI")
Expand Down Expand Up @@ -99,6 +101,8 @@ if (BUILD_${myName}_AIINTERFACE)

aux_source_directory(${mySourceDir} mySources)
add_library(${myTarget} MODULE ${mySources} ${ai_common_SRC} ${CUtils_SRC})
FixLibName(${myTarget})

set_target_properties(${myTarget} PROPERTIES OUTPUT_NAME "AIInterface")

# Install the data files
Expand Down
1 change: 1 addition & 0 deletions AI/Interfaces/Java/CMakeLists.txt
Expand Up @@ -327,6 +327,7 @@ if (BUILD_${myName}_AIINTERFACE)
endif (MINGW)
include_directories(BEFORE ${rts}/lib/streflop)
add_library(${myTarget} MODULE ${myNativeSources} ${ai_common_SRC} ${CUtils_SRC})
FixLibName(${myTarget})
target_link_libraries(${myTarget} streflop)
set_target_properties(${myTarget} PROPERTIES COMPILE_FLAGS "-DUSING_STREFLOP")
set_target_properties(${myTarget} PROPERTIES OUTPUT_NAME "AIInterface")
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Expand Up @@ -2,6 +2,17 @@
cmake_minimum_required(VERSION 2.6)
project(Spring)

# This is needed, as CMake, or at least soem versions of it (eg. 2.8),
# falsely use the ".so" suffix unde Mac OS X for MODULE's
macro (FixLibName targetName)
IF (UNIX)
SET_TARGET_PROPERTIES(${targetName} PROPERTIES PREFIX "lib")
IF (APPLE)
SET_TARGET_PROPERTIES(${targetName} PROPERTIES SUFFIX ".dylib")
ENDIF (APPLE)
ENDIF (UNIX)
endmacro (FixLibName targetName)

LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/rts/build/cmake")

### Install path (relative to CMAKE_INSTALL_PREFIX)
Expand Down

0 comments on commit 0995062

Please sign in to comment.